From 30d77d378a0c1721ae8db7342e758a57cf1ae57f Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 27 Oct 2022 21:31:13 +0000 Subject: [PATCH] build: fix building without MBIM support The foxconn shared utils are only built when MBIM is enabled, and therefore the dell and foxconn plugins should only expect those shared utils to be present if MBIM is enabled. The foxconn plugin will be fully disabled when MBIM is disabled. The fibocom shared utils are only built when MBIM is enabled, and therefore the fibocom plugin should not expect them built unconditionally, they will only be present if MBIM is enabled --- meson.build | 14 +++++++++++--- plugins/meson.build | 11 +++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 6363034d..17ec6c20 100644 --- a/meson.build +++ b/meson.build @@ -299,15 +299,23 @@ plugins_shared_reqs = { 'xmm': true, } + +fibocom_shared_reqs = ['xmm'] +dell_shared_reqs = ['novatel', 'sierra', 'telit', 'xmm'] +if enable_mbim + fibocom_shared_reqs += ['fibocom'] + dell_shared_reqs += ['foxconn'] +endif + plugins_options_reqs = { 'altair-lte': {'available': true, 'shared': []}, 'anydata': {'available': true, 'shared': []}, 'broadmobi': {'available': true, 'shared': []}, 'cinterion': {'available': true, 'shared': []}, - 'dell': {'available': true, 'shared': ['foxconn', 'novatel', 'sierra', 'telit', 'xmm']}, + 'dell': {'available': true, 'shared': dell_shared_reqs}, 'dlink': {'available': true, 'shared': []}, - 'fibocom': {'available': true, 'shared': ['fibocom', 'xmm']}, - 'foxconn': {'available': true, 'shared': ['foxconn']}, + 'fibocom': {'available': true, 'shared': fibocom_shared_reqs}, + 'foxconn': {'available': enable_mbim, 'shared': ['foxconn']}, 'generic': {'available': true, 'shared': []}, 'gosuncn': {'available': true, 'shared': []}, 'haier': {'available': true, 'shared': []}, diff --git a/plugins/meson.build b/plugins/meson.build index 5169548a..e08b511e 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -315,13 +315,16 @@ if plugins_options['dell'] plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args incs = plugins_incs + [ - foxconn_inc, novatel_inc, sierra_inc, telit_inc, xmm_inc, ] + if enable_mbim + incs += [foxconn_inc] + endif + plugins += {'plugin-dell': { 'plugin': true, 'module': {'sources': files('dell/mm-plugin-dell.c'), 'include_directories': incs, 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="dell"']}, @@ -348,12 +351,16 @@ if plugins_options['fibocom'] test_udev_rules_dir_c_args = ['-DTESTUDEVRULESDIR_FIBOCOM="@0@"'.format(plugins_dir / 'fibocom')] plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args + incs = plugins_incs + [xmm_inc] + sources = files( 'fibocom/mm-broadband-bearer-fibocom-ecm.c', 'fibocom/mm-broadband-modem-fibocom.c', 'fibocom/mm-plugin-fibocom.c', ) if enable_mbim + incs += [fibocom_inc] + sources += files( 'fibocom/mm-broadband-modem-mbim-xmm-fibocom.c', 'fibocom/mm-broadband-modem-mbim-fibocom.c', @@ -361,7 +368,7 @@ if plugins_options['fibocom'] endif plugins += {'plugin-fibocom': { 'plugin': true, - 'module': {'sources': sources, 'include_directories': plugins_incs + [xmm_inc] + [fibocom_inc], 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="fibocom"']}, + 'module': {'sources': sources, 'include_directories': incs, 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="fibocom"']}, }} plugins_udev_rules += files('fibocom/77-mm-fibocom-port-types.rules')