build,meson: Make feature options boolean
Different options are set as `feature`, also every possible plugin, but this may cause confusion. All options set as `feature` but plugins have been made `boolean` to avoid further confusions. `help2man` is also installed in the CI image because is required to build different libraries.
This commit is contained in:

committed by
Aleksander Morgado

parent
7a7bc2e444
commit
ec2e5403f1
@@ -12,14 +12,14 @@ stages:
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: mobile-broadband/ModemManager
|
||||
FDO_DISTRIBUTION_VERSION: '20.04'
|
||||
FDO_DISTRIBUTION_TAG: '2021-10-03.1'
|
||||
FDO_DISTRIBUTION_TAG: '2021-11-05.1'
|
||||
FDO_DISTRIBUTION_PACKAGES: ca-certificates git gcc autoconf automake libtool
|
||||
libgettextpo-dev libgirepository1.0-dev libglib2.0-dev
|
||||
libgudev-1.0-dev python3-dbus python3-gi autopoint
|
||||
xsltproc dbus gettext gtk-doc-tools libglib2.0-doc
|
||||
gobject-introspection python-is-python3 libsystemd-dev
|
||||
libpolkit-gobject-1-dev valac meson ninja-build
|
||||
libdbus-1-dev bash-completion udev policykit-1
|
||||
libdbus-1-dev bash-completion udev policykit-1 help2man
|
||||
|
||||
build container:
|
||||
extends:
|
||||
@@ -46,7 +46,7 @@ build-no-qmi:
|
||||
script:
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
|
||||
- pushd libmbim
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled -Dbash_completion=false
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
@@ -69,13 +69,13 @@ build-qmi-qrtr-no-mbim:
|
||||
script:
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib.git
|
||||
- pushd libqrtr-glib
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||
- pushd libqmi
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled -Dbash_completion=false -Dmbim_qmux=disabled -Dqrtr=enabled -Dcollection=basic
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false -Dmbim_qmux=false -Dcollection=basic
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
@@ -98,7 +98,7 @@ build-qmi-no-qrtr-no-mbim:
|
||||
script:
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||
- pushd libqmi
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled -Dbash_completion=false -Dmbim_qmux=disabled -Dqrtr=disabled -Dcollection=basic
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false -Dmbim_qmux=false -Dqrtr=false -Dcollection=basic
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
@@ -138,7 +138,7 @@ build-qmi-newest-commands:
|
||||
script:
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||
- pushd libqmi
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled -Dbash_completion=false -Dmbim_qmux=disabled -Dqrtr=disabled -Dcollection=basic
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false -Dmbim_qmux=false -Dqrtr=false -Dcollection=basic
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
@@ -158,19 +158,19 @@ build-single-plugins:
|
||||
script:
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
|
||||
- pushd libmbim
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled -Dbash_completion=false
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib.git
|
||||
- pushd libqrtr-glib
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||
- pushd libqmi
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=disabled -Dbash_completion=false -Dmbim_qmux=enabled -Dqrtr=enabled -Dcollection=basic
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false -Dcollection=basic
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
@@ -195,19 +195,19 @@ build-default:
|
||||
script:
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
|
||||
- pushd libmbim
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=enabled -Dbash_completion=false
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dbash_completion=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib.git
|
||||
- pushd libqrtr-glib
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=enabled
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||
- pushd libqmi
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=enabled -Dbash_completion=false -Dmbim_qmux=enabled -Dqrtr=enabled -Dcollection=basic
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dbash_completion=false -Dcollection=basic
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
@@ -249,23 +249,23 @@ build-meson-release:
|
||||
script:
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
|
||||
- pushd libmbim
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=enabled -Dbash_completion=false
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dbash_completion=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib.git
|
||||
- pushd libqrtr-glib
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=enabled
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- git clone --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||
- pushd libqmi
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=enabled -Dbash_completion=false -Dmbim_qmux=enabled -Dqrtr=enabled -Dcollection=basic
|
||||
- meson setup build --prefix=/usr -Dgtk_doc=false -Dbash_completion=false -Dcollection=basic
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- popd
|
||||
- meson setup build --buildtype=release --prefix=/usr -Dwerror=true -Dgtk_doc=false -Dintrospection=enabled -Dqmi=enabled -Dmbim=enabled -Dqrtr=enabled -Dpolkit=strict -Dsystemd_suspend_resume=true -Dsystemdsystemunitdir=/lib/systemd/system
|
||||
- meson setup build --buildtype=release --prefix=/usr -Dwerror=true -Dgtk_doc=false -Dpolkit=strict -Dsystemdsystemunitdir=/lib/systemd/system
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
- ninja -C build uninstall
|
||||
|
@@ -26,10 +26,11 @@ sources = files(
|
||||
'mmcli-sms.c',
|
||||
)
|
||||
|
||||
deps = [
|
||||
gudev_dep,
|
||||
libmm_glib_dep,
|
||||
]
|
||||
deps = [libmm_glib_dep]
|
||||
|
||||
if enable_udev
|
||||
deps += gudev_dep
|
||||
endif
|
||||
|
||||
executable(
|
||||
'mmcli',
|
||||
|
33
meson.build
33
meson.build
@@ -172,8 +172,10 @@ if enable_bash_completion
|
||||
endif
|
||||
|
||||
# udev support (enabled by default)
|
||||
gudev_dep = dependency('gudev-1.0', version: '>= 232', required: get_option('udev'))
|
||||
enable_udev = gudev_dep.found()
|
||||
enable_udev = get_option('udev')
|
||||
if enable_udev
|
||||
gudev_dep = dependency('gudev-1.0', version: '>= 232')
|
||||
endif
|
||||
config_h.set('WITH_UDEV', enable_udev)
|
||||
|
||||
# udev base directory
|
||||
@@ -232,20 +234,26 @@ enable_at_command_via_dbus = get_option('at_command_via_dbus')
|
||||
config_h.set('WITH_AT_COMMAND_VIA_DBUS', enable_at_command_via_dbus)
|
||||
|
||||
# MBIM support (enabled by default)
|
||||
mbim_glib_dep = dependency('mbim-glib', version: '>= 1.27.3', required: get_option('mbim'))
|
||||
enable_mbim = mbim_glib_dep.found()
|
||||
enable_mbim = get_option('mbim')
|
||||
if enable_mbim
|
||||
mbim_glib_dep = dependency('mbim-glib', version: '>= 1.27.3')
|
||||
endif
|
||||
config_h.set('WITH_MBIM', enable_mbim)
|
||||
|
||||
# QMI support (enabled by default)
|
||||
qmi_glib_dep = dependency('qmi-glib', version: '>= 1.31.1', required: get_option('qmi'))
|
||||
enable_qmi = qmi_glib_dep.found()
|
||||
enable_qmi = get_option('qmi')
|
||||
if enable_qmi
|
||||
qmi_glib_dep = dependency('qmi-glib', version: '>= 1.31.1')
|
||||
endif
|
||||
config_h.set('WITH_QMI', enable_qmi)
|
||||
|
||||
# QRTR support (both as qrtr-glib and qmi-glib apis)
|
||||
qrtr_glib_dep = dependency('qrtr-glib', version: '>= 1.0.0', required: get_option('qrtr'))
|
||||
enable_qrtr = qrtr_glib_dep.found()
|
||||
assert(not enable_qrtr or enable_qmi, 'QRTR support requires QMI enabled')
|
||||
assert(not enable_qrtr or qmi_glib_dep.get_pkgconfig_variable('qmi_qrtr_supported').to_int().is_odd(), 'Couldn\'t find QRTR support in qmi-glib.')
|
||||
enable_qrtr = get_option('qrtr')
|
||||
if enable_qrtr
|
||||
assert(enable_qmi, 'QRTR support requires QMI enabled')
|
||||
assert(qmi_glib_dep.get_pkgconfig_variable('qmi_qrtr_supported').to_int().is_odd(), 'Couldn\'t find QRTR support in qmi-glib.')
|
||||
qrtr_glib_dep = dependency('qrtr-glib', version: '>= 1.0.0')
|
||||
endif
|
||||
config_h.set('WITH_QRTR', enable_qrtr)
|
||||
|
||||
# Distribution version string
|
||||
@@ -257,7 +265,10 @@ endif
|
||||
util_dep = cc.find_library('util')
|
||||
|
||||
# introspection support
|
||||
enable_gir = dependency('gobject-introspection-1.0', version: '>= 0.9.6', required: get_option('introspection')).found()
|
||||
enable_gir = get_option('introspection')
|
||||
if enable_gir
|
||||
dependency('gobject-introspection-1.0', version: '>= 0.9.6')
|
||||
endif
|
||||
|
||||
# vala support
|
||||
enable_vapi = get_option('vapi')
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
option('udev', type: 'feature', value: 'auto', description: 'enable udev support')
|
||||
option('udev', type: 'boolean', value: true, description: 'enable udev support')
|
||||
option('udevdir', type: 'string', value: '', description: 'udev base directory')
|
||||
|
||||
option('dbus_policy_dir', type: 'string', value: '', description: 'd-bus system policy directory')
|
||||
@@ -14,9 +14,9 @@ option('polkit', type: 'combo', choices: ['strict', 'permissive', 'no'], value:
|
||||
|
||||
option('at_command_via_dbus', type: 'boolean', value: false, description: 'enable at commands vida d-bus')
|
||||
|
||||
option('mbim', type: 'feature', value: 'auto', description: 'enable MBIM support')
|
||||
option('qmi', type: 'feature', value: 'auto', description: 'enable QMI support')
|
||||
option('qrtr', type: 'feature', value: 'auto', description: 'enable QRTR support')
|
||||
option('mbim', type: 'boolean', value: true, description: 'enable MBIM support')
|
||||
option('qmi', type: 'boolean', value: true, description: 'enable QMI support')
|
||||
option('qrtr', type: 'boolean', value: true, description: 'enable QRTR support')
|
||||
|
||||
option('dist_version', type: 'string', value: '', description: 'define the custom version (like distribution package name and revision')
|
||||
|
||||
@@ -86,7 +86,7 @@ option('plugin_x22x', type: 'feature', value: 'auto', description: 'enable x22x
|
||||
# shared_icera
|
||||
option('plugin_zte', type: 'feature', value: 'auto', description: 'enable zte plugin support')
|
||||
|
||||
option('introspection', type: 'feature', value: 'auto', description: 'build introspection support')
|
||||
option('introspection', type: 'boolean', value: true, description: 'build introspection support')
|
||||
option('vapi', type: 'boolean', value: false, description: 'build vala bindings')
|
||||
|
||||
option('man', type: 'boolean', value: true, description: 'build manual pages')
|
||||
|
@@ -43,11 +43,15 @@ plugins_incs = [
|
||||
kerneldevice_inc,
|
||||
]
|
||||
|
||||
plugins_deps = [
|
||||
libmm_glib_dep,
|
||||
mbim_glib_dep,
|
||||
qmi_glib_dep,
|
||||
]
|
||||
plugins_deps = [libmm_glib_dep]
|
||||
|
||||
if enable_mbim
|
||||
plugins_deps += mbim_glib_dep
|
||||
endif
|
||||
|
||||
if enable_qmi
|
||||
plugins_deps += qmi_glib_dep
|
||||
endif
|
||||
|
||||
# Common Foxconn modem support library (MBIM only)
|
||||
if plugins_shared['foxconn']
|
||||
|
@@ -45,20 +45,20 @@ incs = [
|
||||
kerneldevice_inc,
|
||||
]
|
||||
|
||||
deps = [
|
||||
libmm_glib_dep,
|
||||
mbim_glib_dep,
|
||||
qmi_glib_dep,
|
||||
]
|
||||
deps = [libmm_glib_dep]
|
||||
|
||||
private_deps = []
|
||||
|
||||
if enable_qmi
|
||||
sources += files('mm-modem-helpers-qmi.c')
|
||||
|
||||
deps += qmi_glib_dep
|
||||
endif
|
||||
|
||||
if enable_mbim
|
||||
sources += files('mm-modem-helpers-mbim.c')
|
||||
|
||||
deps += mbim_glib_dep
|
||||
endif
|
||||
|
||||
if enable_systemd_journal
|
||||
@@ -87,18 +87,18 @@ sources = files(
|
||||
'kerneldevice/mm-kernel-device-helpers.c',
|
||||
)
|
||||
|
||||
deps = [
|
||||
gudev_dep,
|
||||
libhelpers_dep,
|
||||
qrtr_glib_dep,
|
||||
]
|
||||
deps = [libhelpers_dep]
|
||||
|
||||
if enable_qrtr
|
||||
sources += files('kerneldevice/mm-kernel-device-qrtr.c')
|
||||
|
||||
deps += qrtr_glib_dep
|
||||
endif
|
||||
|
||||
if enable_udev
|
||||
sources += files('kerneldevice/mm-kernel-device-udev.c')
|
||||
|
||||
deps += gudev_dep
|
||||
endif
|
||||
|
||||
libkerneldevice = static_library(
|
||||
|
@@ -8,7 +8,7 @@ test_units = {
|
||||
'mmtty': libport_dep,
|
||||
}
|
||||
|
||||
if gudev_dep.found()
|
||||
if enable_udev
|
||||
test_units += {'lsudev': gudev_dep}
|
||||
endif
|
||||
|
||||
|
Reference in New Issue
Block a user