From: Yu Watanabe Date: Sat, 29 Jul 2023 21:32:53 +0000 (+0900) Subject: meson: introduce HAVE_DMI flag X-Git-Tag: v255-rc1~832^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12b4cffdae29445d4bce32567c314c9c9700eb2d;p=thirdparty%2Fsystemd.git meson: introduce HAVE_DMI flag The condition is used at several places. Let's introduce a simple flag for that. --- diff --git a/meson.build b/meson.build index 8dcc8ead4a0..430457bb1ed 100644 --- a/meson.build +++ b/meson.build @@ -1689,6 +1689,9 @@ if dbus_interfaces_dir == '' or dbus_interfaces_dir == 'yes' endif endif +dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips'] +conf.set10('HAVE_DMI', host_machine.cpu_family() in dmi_arches) + # We support one or the other. If gcrypt is available, we assume it's there to # be used, and use it in preference. opt = get_option('cryptolib') @@ -3166,6 +3169,7 @@ foreach tuple : [ ['xdg-autostart'], # optional features + ['dmi'], ['idn'], ['polkit'], ['nscd'], diff --git a/rules.d/meson.build b/rules.d/meson.build index 20fca222da6..13f25397dcd 100644 --- a/rules.d/meson.build +++ b/rules.d/meson.build @@ -36,7 +36,7 @@ rules = [ conf.get('HAVE_KMOD') == 1], [files('70-memory.rules'), - dmi_arches.contains(host_machine.cpu_family())], + conf.get('HAVE_DMI') == 1], [files('70-power-switch.rules'), enable_logind], diff --git a/src/udev/meson.build b/src/udev/meson.build index 932a7186515..2c100959412 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -144,8 +144,7 @@ udev_progs = [['ata_id/ata_id.c'], ['mtd_probe/mtd_probe.c', 'mtd_probe/probe_smartmedia.c']] -dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips'] -if dmi_arches.contains(host_machine.cpu_family()) +if conf.get('HAVE_DMI') == 1 udev_progs += [['dmi_memory_id/dmi_memory_id.c']] endif diff --git a/test/meson.build b/test/meson.build index f41c01fa351..d57736e739d 100644 --- a/test/meson.build +++ b/test/meson.build @@ -256,7 +256,7 @@ endif ############################################################ -if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family()) +if want_tests != 'false' and conf.get('HAVE_DMI') == 1 udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh') if git.found() and fs.is_dir(project_source_root / '.git')