diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-27 21:13:08 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-05-02 16:29:11 -0400 |
commit | 2c201c2140f9a75f3698e988880f00f8d0492315 (patch) | |
tree | 28f9835b7720692a60dda9b88a598994a03b396c /src | |
parent | 829257d135c496bd5d2770036c449445f77e0abc (diff) |
meson: use booleans for conf.set and drop unecessary conditionals
Using conf.set() with a boolean argument does the right thing:
either #ifdef or #undef. This means that conf.set can be used unconditionally.
Previously I used '1' as the placeholder value, and that needs to be changed to
'true' for consistency (under meson 1 cannot be used in boolean context). All
checks need to be adjusted.
Diffstat (limited to 'src')
-rw-r--r-- | src/boot/efi/meson.build | 2 | ||||
-rw-r--r-- | src/coredump/meson.build | 2 | ||||
-rw-r--r-- | src/hostname/meson.build | 2 | ||||
-rw-r--r-- | src/import/meson.build | 2 | ||||
-rw-r--r-- | src/journal-remote/meson.build | 4 | ||||
-rw-r--r-- | src/journal/meson.build | 6 | ||||
-rw-r--r-- | src/locale/meson.build | 4 | ||||
-rw-r--r-- | src/login/meson.build | 4 | ||||
-rw-r--r-- | src/machine/meson.build | 2 | ||||
-rw-r--r-- | src/network/meson.build | 2 | ||||
-rw-r--r-- | src/resolve/meson.build | 2 | ||||
-rw-r--r-- | src/shared/meson.build | 8 | ||||
-rw-r--r-- | src/timedate/meson.build | 2 | ||||
-rw-r--r-- | src/timesync/meson.build | 2 | ||||
-rw-r--r-- | src/udev/meson.build | 6 | ||||
-rw-r--r-- | src/vconsole/meson.build | 2 |
16 files changed, 26 insertions, 26 deletions
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 6241cb1c19..6d1b38a527 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -28,7 +28,7 @@ stub_sources = ''' stub.c '''.split() -if conf.get('ENABLE_EFI', 0) == 1 and get_option('gnu-efi') != 'false' +if conf.get('ENABLE_EFI', false) and get_option('gnu-efi') != 'false' efi_cc = get_option('efi-cc') efi_ld = get_option('efi-ld') diff --git a/src/coredump/meson.build b/src/coredump/meson.build index ab3be6a7de..8f7d898b62 100644 --- a/src/coredump/meson.build +++ b/src/coredump/meson.build @@ -4,7 +4,7 @@ systemd_coredump_sources = files(''' coredump-vacuum.h '''.split()) -if conf.get('HAVE_ELFUTILS', 0) == 1 +if conf.get('HAVE_ELFUTILS', false) systemd_coredump_sources += files(['stacktrace.c', 'stacktrace.h']) endif diff --git a/src/hostname/meson.build b/src/hostname/meson.build index 7cb5fc135a..d58caa6787 100644 --- a/src/hostname/meson.build +++ b/src/hostname/meson.build @@ -1,4 +1,4 @@ -if conf.get('ENABLE_HOSTNAMED', 0) == 1 +if conf.get('ENABLE_HOSTNAMED', false) install_data('org.freedesktop.hostname1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.hostname1.service', diff --git a/src/import/meson.build b/src/import/meson.build index f0ed92b4c2..3fd58cc2c8 100644 --- a/src/import/meson.build +++ b/src/import/meson.build @@ -48,7 +48,7 @@ systemd_export_sources = files(''' import-compress.h '''.split()) -if conf.get('ENABLE_IMPORTD', 0) == 1 +if conf.get('ENABLE_IMPORTD', false) install_data('org.freedesktop.import1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.import1.service', diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build index 072fa14548..d266b34e65 100644 --- a/src/journal-remote/meson.build +++ b/src/journal-remote/meson.build @@ -21,7 +21,7 @@ systemd_journal_gatewayd_sources = files(''' microhttpd-util.c '''.split()) -if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 +if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false) journal_upload_conf = configure_file( input : 'journal-upload.conf.in', output : 'journal-upload.conf', @@ -30,7 +30,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 install_dir : pkgsysconfdir) endif -if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 +if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false) journal_remote_conf = configure_file( input : 'journal-remote.conf.in', output : 'journal-remote.conf', diff --git a/src/journal/meson.build b/src/journal/meson.build index 37ec559e41..582f83afb9 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -20,7 +20,7 @@ journal_internal_sources = files(''' sd-journal.c '''.split()) -if conf.get('HAVE_GCRYPT', 0) == 1 +if conf.get('HAVE_GCRYPT', false) journal_internal_sources += files(''' journal-authenticate.c journal-authenticate.h @@ -36,7 +36,7 @@ endif audit_type_includes = [config_h, missing_h, 'linux/audit.h'] -if conf.get('HAVE_AUDIT', 0) == 1 +if conf.get('HAVE_AUDIT', false) audit_type_includes += 'libaudit.h' endif @@ -95,7 +95,7 @@ systemd_cat_sources = files('cat.c') journalctl_sources = files('journalctl.c') -if conf.get('HAVE_QRENCODE', 0) == 1 +if conf.get('HAVE_QRENCODE', false) journalctl_sources += files('journal-qrcode.c', 'journal-qrcode.h') endif diff --git a/src/locale/meson.build b/src/locale/meson.build index d03af4c0e2..d7dd113c8d 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -6,7 +6,7 @@ systemd_localed_sources = files(''' localectl_sources = files('localectl.c') -if conf.get('ENABLE_LOCALED', 0) == 1 +if conf.get('ENABLE_LOCALED', false) install_data('org.freedesktop.locale1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.locale1.service', @@ -27,7 +27,7 @@ endif kbd_model_map = join_paths(meson.current_source_dir(), 'kbd-model-map') language_fallback_map = join_paths(meson.current_source_dir(), 'language-fallback-map') -if conf.get('ENABLE_LOCALED', 0) == 1 +if conf.get('ENABLE_LOCALED', false) install_data('kbd-model-map', 'language-fallback-map', install_dir : pkgdatadir) diff --git a/src/login/meson.build b/src/login/meson.build index a518215be8..26bdbec424 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -39,7 +39,7 @@ liblogind_core_sources = files(''' '''.split()) logind_acl_c = files('logind-acl.c') -if conf.get('HAVE_ACL', 0) == 1 +if conf.get('HAVE_ACL', false) liblogind_core_sources += logind_acl_c endif @@ -55,7 +55,7 @@ loginctl_sources = files(''' sysfs-show.c '''.split()) -if conf.get('ENABLE_LOGIND', 0) == 1 +if conf.get('ENABLE_LOGIND', false) logind_conf = configure_file( input : 'logind.conf.in', output : 'logind.conf', diff --git a/src/machine/meson.build b/src/machine/meson.build index 953774fdb6..1a0813323c 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -21,7 +21,7 @@ libmachine_core = static_library( include_directories : includes, dependencies : [threads]) -if conf.get('ENABLE_MACHINED', 0) == 1 +if conf.get('ENABLE_MACHINED', false) install_data('org.freedesktop.machine1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.machine1.service', diff --git a/src/network/meson.build b/src/network/meson.build index 771aa68ec1..ebd4e62eb3 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -75,7 +75,7 @@ networkctl_sources = files('networkctl.c') network_include_dir = include_directories('.') -if conf.get('ENABLE_NETWORKD', 0) == 1 +if conf.get('ENABLE_NETWORKD', false) networkd_gperf_c = custom_target( 'networkd-gperf.c', input : 'networkd-gperf.gperf', diff --git a/src/resolve/meson.build b/src/resolve/meson.build index 347ffaaeca..f3c411ffee 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -123,7 +123,7 @@ systemd_resolve_sources = (basic_dns_sources + systemd_resolve_only_sources + dns_type_headers) -if conf.get('ENABLE_RESOLVED', 0) == 1 +if conf.get('ENABLE_RESOLVED', false) install_data('org.freedesktop.resolve1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.resolve1.service', diff --git a/src/shared/meson.build b/src/shared/meson.build index 0747f76649..49a7d9f30b 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -103,19 +103,19 @@ shared_sources = ''' test_tables_h = files('test-tables.h') shared_sources += [test_tables_h] -if conf.get('HAVE_ACL', 0) == 1 +if conf.get('HAVE_ACL', false) shared_sources += ['acl-util.c'] endif -if conf.get('HAVE_UTMP', 0) == 1 +if conf.get('HAVE_UTMP', false) shared_sources += ['utmp-wtmp.c'] endif -if conf.get('HAVE_SECCOMP', 0) == 1 +if conf.get('HAVE_SECCOMP', false) shared_sources += ['seccomp-util.c'] endif -if conf.get('HAVE_LIBIPTC', 0) == 1 +if conf.get('HAVE_LIBIPTC', false) shared_sources += ['firewall-util.c'] endif diff --git a/src/timedate/meson.build b/src/timedate/meson.build index 2e74245f66..63124d665b 100644 --- a/src/timedate/meson.build +++ b/src/timedate/meson.build @@ -1,4 +1,4 @@ -if conf.get('ENABLE_TIMEDATED', 0) == 1 +if conf.get('ENABLE_TIMEDATED', false) install_data('org.freedesktop.timedate1.conf', install_dir : dbuspolicydir) install_data('org.freedesktop.timedate1.service', diff --git a/src/timesync/meson.build b/src/timesync/meson.build index dece39ea10..ee54c3e449 100644 --- a/src/timesync/meson.build +++ b/src/timesync/meson.build @@ -16,7 +16,7 @@ timesyncd_gperf_c = custom_target( systemd_timesyncd_sources += [timesyncd_gperf_c] -if conf.get('ENABLE_TIMESYNCD', 0) == 1 +if conf.get('ENABLE_TIMESYNCD', false) timesyncd_conf = configure_file( input : 'timesyncd.conf.in', output : 'timesyncd.conf', diff --git a/src/udev/meson.build b/src/udev/meson.build index 495e9d3c54..9692ddc1e9 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -36,15 +36,15 @@ libudev_core_sources = ''' net/ethtool-util.h '''.split() -if conf.get('HAVE_KMOD', 0) == 1 +if conf.get('HAVE_KMOD', false) libudev_core_sources += ['udev-builtin-kmod.c'] endif -if conf.get('HAVE_BLKID', 0) == 1 +if conf.get('HAVE_BLKID', false) libudev_core_sources += ['udev-builtin-blkid.c'] endif -if conf.get('HAVE_ACL', 0) == 1 +if conf.get('HAVE_ACL', false) libudev_core_sources += ['udev-builtin-uaccess.c', logind_acl_c, sd_login_c] diff --git a/src/vconsole/meson.build b/src/vconsole/meson.build index ac382e3daa..1260b53537 100644 --- a/src/vconsole/meson.build +++ b/src/vconsole/meson.build @@ -1,4 +1,4 @@ -if conf.get('ENABLE_VCONSOLE', 0) == 1 +if conf.get('ENABLE_VCONSOLE', false) vconsole_rules = configure_file( input : '90-vconsole.rules.in', output : '90-vconsole.rules', |