]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
build-sys: use #if Y instead of #ifdef Y everywhere
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 3 Oct 2017 08:41:51 +0000 (10:41 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 4 Oct 2017 10:09:29 +0000 (12:09 +0200)
The advantage is that is the name is mispellt, cpp will warn us.

$ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/"
$ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;'
$ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g'
$ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g'
+ manual changes to meson.build

squash! build-sys: use #if Y instead of #ifdef Y everywhere

v2:
- fix incorrect setting of HAVE_LIBIDN2

140 files changed:
docs/sysvinit/meson.build
docs/var-log/meson.build
hwdb/meson.build
man/meson.build
meson.build
network/meson.build
shell-completion/bash/meson.build
shell-completion/zsh/meson.build
src/analyze/analyze.c
src/basic/blkid-util.h
src/basic/btrfs-util.c
src/basic/build.h
src/basic/def.h
src/basic/hashmap.c
src/basic/hashmap.h
src/basic/memfd-util.c
src/basic/missing.h
src/basic/path-util.h
src/basic/process-util.c
src/basic/random-util.c
src/basic/selinux-util.c
src/basic/smack-util.c
src/basic/socket-util.c
src/boot/efi/boot.c
src/boot/efi/measure.c
src/boot/efi/meson.build
src/boot/efi/stub.c
src/core/audit-fd.c
src/core/dbus-execute.c
src/core/dbus.c
src/core/execute.c
src/core/ima-setup.c
src/core/kmod-setup.c
src/core/load-fragment.c
src/core/main.c
src/core/manager.c
src/core/mount-setup.c
src/core/namespace.c
src/core/selinux-access.c
src/core/selinux-access.h
src/core/selinux-setup.c
src/core/smack-setup.c
src/core/umount.c
src/coredump/coredump.c
src/coredump/coredumpctl.c
src/coredump/meson.build
src/delta/delta.c
src/fsck/fsck.c
src/gpt-auto-generator/gpt-auto-generator.c
src/hostname/meson.build
src/import/meson.build
src/journal-remote/journal-gatewayd.c
src/journal-remote/journal-remote.c
src/journal-remote/meson.build
src/journal-remote/microhttpd-util.c
src/journal/audit-type.c
src/journal/compress.c
src/journal/compress.h
src/journal/journal-def.h
src/journal/journal-file.c
src/journal/journal-file.h
src/journal/journal-verify.c
src/journal/journalctl.c
src/journal/journald-context.c
src/journal/journald-native.c
src/journal/journald-server.c
src/journal/journald-stream.c
src/journal/journald-syslog.c
src/journal/journald.c
src/journal/meson.build
src/journal/mmap-cache.c
src/journal/sd-journal.c
src/journal/test-compress-benchmark.c
src/journal/test-compress.c
src/journal/test-journal.c
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-kernel.c
src/libsystemd/sd-bus/test-bus-gvariant.c
src/libsystemd/sd-bus/test-bus-marshal.c
src/libsystemd/sd-hwdb/sd-hwdb.c
src/libsystemd/sd-path/sd-path.c
src/locale/localed.c
src/locale/meson.build
src/login/logind-acl.h
src/login/meson.build
src/machine/meson.build
src/network/meson.build
src/network/networkd-manager.c
src/nspawn/nspawn-mount.c
src/nspawn/nspawn-patch-uid.c
src/nspawn/nspawn-seccomp.c
src/nspawn/nspawn.c
src/quotacheck/quotacheck.c
src/resolve/meson.build
src/resolve/resolved-conf.c
src/resolve/resolved-dns-dnssec.c
src/resolve/resolved-link.c
src/resolve/resolved-manager.c
src/resolve/test-dnssec-complex.c
src/resolve/test-dnssec.c
src/shared/acl-util.h
src/shared/bus-unit-util.c
src/shared/bus-util.c
src/shared/dissect-image.c
src/shared/dns-domain.c
src/shared/dns-domain.h
src/shared/efivars.c
src/shared/efivars.h
src/shared/firewall-util.h
src/shared/gcrypt-util.c
src/shared/gcrypt-util.h
src/shared/install.c
src/shared/journal-util.c
src/shared/meson.build
src/shared/path-lookup.c
src/shared/spawn-polkit-agent.c
src/shared/utmp-wtmp.h
src/systemctl/systemctl.c
src/sysusers/sysusers.c
src/test/test-dns-domain.c
src/test/test-execute.c
src/test/test-nss.c
src/test/test-process-util.c
src/test/test-sigbus.c
src/timedate/meson.build
src/timesync/meson.build
src/tmpfiles/tmpfiles.c
src/udev/meson.build
src/udev/net/link-config.c
src/udev/udev-builtin-blkid.c
src/udev/udev-builtin-btrfs.c
src/udev/udev-builtin.c
src/udev/udev.h
src/update-utmp/update-utmp.c
src/vconsole/meson.build
sysctl.d/meson.build
sysusers.d/meson.build
test/meson.build
tmpfiles.d/meson.build
units/meson.build

index 79d1babf167d89c915a8562e7a24d52a88efef19..115ad39ce2ff900f58973221f48866e24a071a38 100644 (file)
@@ -3,7 +3,7 @@ file = configure_file(
         output : 'README',
         configuration : substs)
 
-if conf.get('HAVE_SYSV_COMPAT', false)
+if conf.get('HAVE_SYSV_COMPAT') == 1
         install_data(file,
                      install_dir : sysvinit_path)
 endif
index d8364e38b970f288f676aae9d9ff41265343d1b9..60acf494ef552b2d7c0bce53ed8f3d3ec39c80eb 100644 (file)
@@ -3,7 +3,7 @@ file = configure_file(
         output : 'README',
         configuration : substs)
 
-if conf.get('HAVE_SYSV_COMPAT', false)
+if conf.get('HAVE_SYSV_COMPAT') == 1
         install_data(file,
                      install_dir : varlogdir)
 endif
index ee206fd509e27c3c5fd10df0ca9a0e7921858745..a5175039cd97173abca6109bdc80e995e9032487 100644 (file)
@@ -18,7 +18,7 @@ hwdb_files = files('''
         70-touchpad.hwdb
 '''.split())
 
-if conf.get('ENABLE_HWDB', false)
+if conf.get('ENABLE_HWDB') == 1
         install_data(hwdb_files,
                      install_dir : udevhwdbdir)
 
index 5b6a21fb9f4c63950232877698f063865546f336..7d28e6ba1ad577adff4799a52a121f9f3a1dc2a9 100644 (file)
@@ -51,7 +51,7 @@ foreach tuple : manpages
 
         mandirn = join_paths(get_option('mandir'), 'man' + section)
 
-        if condition == '' or conf.get(condition, false)
+        if condition == '' or conf.get(condition) == 1
                 p1 = custom_target(
                         man,
                         input : xml,
index 7dcbeccb5737dfda2b659416826e7778fe3fb245..2b1da8a41b0d8b21da3903e10a61cb1a1cc9f761 100644 (file)
@@ -38,8 +38,8 @@ endif
 #####################################################################
 
 rootprefixdir = get_option('rootprefix')
+conf.set10('HAVE_SPLIT_USR', get_option('split-usr'))
 if get_option('split-usr')
-        conf.set('HAVE_SPLIT_USR', true)
         rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
 else
         rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
@@ -47,11 +47,10 @@ endif
 
 sysvinit_path = get_option('sysvinit-path')
 sysvrcnd_path = get_option('sysvrcnd-path')
-if sysvinit_path != '' or sysvrcnd_path != ''
-        conf.set('HAVE_SYSV_COMPAT', true,
-                 description : 'SysV init scripts and rcN.d links are supported')
-        m4_defines += ['-DHAVE_SYSV_COMPAT']
-endif
+have = sysvinit_path != '' or sysvrcnd_path != ''
+conf.set10('HAVE_SYSV_COMPAT', have,
+           description : 'SysV init scripts and rcN.d links are supported')
+m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
 
 # join_paths ignore the preceding arguments if an absolute component is
 # encountered, so this should canonicalize various paths when they are
@@ -390,7 +389,7 @@ foreach decl : ['char16_t',
 
         # We get -1 if the size cannot be determined
         have = cc.sizeof(decl, prefix : decl_headers) > 0
-        conf.set('HAVE_' + decl.underscorify().to_upper(), have)
+        conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
 endforeach
 
 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
@@ -422,12 +421,8 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
         conf.set10('HAVE_' + decl[0], have)
 endforeach
 
-skip = false
 foreach ident : ['secure_getenv', '__secure_getenv']
-        if not skip and cc.has_function(ident)
-                conf.set('HAVE_' + ident.to_upper(), true)
-                skip = true
-        endif
+        conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
 endforeach
 
 foreach ident : [
@@ -456,10 +451,11 @@ foreach ident : [
 endforeach
 
 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
-        conf.set('USE_SYS_RANDOM_H', true)
+        conf.set10('USE_SYS_RANDOM_H', true)
         conf.set10('HAVE_GETRANDOM', true)
 else
         have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
+        conf.set10('USE_SYS_RANDOM_H', false)
         conf.set10('HAVE_GETRANDOM', have)
 endif
 
@@ -550,8 +546,8 @@ foreach header : ['linux/btrfs.h',
                   'valgrind/valgrind.h',
                  ]
 
-        conf.set('HAVE_' + header.underscorify().to_upper(),
-                 cc.has_header(header))
+        conf.set10('HAVE_' + header.underscorify().to_upper(),
+                   cc.has_header(header))
 endforeach
 
 ############################################################
@@ -638,17 +634,21 @@ substs.set('SUSHELL', get_option('debug-shell'))
 substs.set('DEBUGTTY', get_option('debug-tty'))
 
 debug = get_option('debug')
+enable_debug_hashmap = false
+enable_debug_mmap_cache = false
 if debug != ''
         foreach name : debug.split(',')
                 if name == 'hashmap'
-                        conf.set('ENABLE_DEBUG_HASHMAP', true)
+                        enable_debug_hashmap = true
                 elif name == 'mmap-cache'
-                        conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
+                        enable_debug_mmap_cache = true
                 else
                         message('unknown debug option "@0@", ignoring'.format(name))
                 endif
         endforeach
 endif
+conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
+conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
 
 #####################################################################
 
@@ -672,38 +672,38 @@ if want_seccomp != 'false'
         libseccomp = dependency('libseccomp',
                                 version : '>= 2.3.1',
                                 required : want_seccomp == 'true')
-        if libseccomp.found()
-                conf.set('HAVE_SECCOMP', true)
-                m4_defines += ['-DHAVE_SECCOMP']
-        endif
+        have = libseccomp.found()
 else
+        have = false
         libseccomp = []
 endif
+conf.set10('HAVE_SECCOMP', have)
+m4_defines += have ? ['-DHAVE_SECCOMP'] : []
 
 want_selinux = get_option('selinux')
 if want_selinux != 'false'
         libselinux = dependency('libselinux',
                                 version : '>= 2.1.9',
                                 required : want_selinux == 'true')
-        if libselinux.found()
-                conf.set('HAVE_SELINUX', true)
-                m4_defines += ['-DHAVE_SELINUX']
-        endif
+        have = libselinux.found()
 else
+        have = false
         libselinux = []
 endif
+conf.set10('HAVE_SELINUX', have)
+m4_defines += have ? ['-DHAVE_SELINUX'] : []
 
 want_apparmor = get_option('apparmor')
 if want_apparmor != 'false'
         libapparmor = dependency('libapparmor',
                                  required : want_apparmor == 'true')
-        if libapparmor.found()
-                conf.set('HAVE_APPARMOR', true)
-                m4_defines += ['-DHAVE_APPARMOR']
-        endif
+        have = libapparmor.found()
 else
+        have = false
         libapparmor = []
 endif
+conf.set10('HAVE_APPARMOR', have)
+m4_defines += have ? ['-DHAVE_APPARMOR'] : []
 
 smack_run_label = get_option('smack-run-label')
 if smack_run_label != ''
@@ -715,7 +715,6 @@ want_polkit = get_option('polkit')
 install_polkit = false
 install_polkit_pkla = false
 if want_polkit != 'false'
-        conf.set('ENABLE_POLKIT', true)
         install_polkit = true
 
         libpolkit = dependency('polkit-gobject-1',
@@ -725,92 +724,101 @@ if want_polkit != 'false'
                 install_polkit_pkla = true
         endif
 endif
+conf.set10('ENABLE_POLKIT', install_polkit)
 
 want_acl = get_option('acl')
 if want_acl != 'false'
         libacl = cc.find_library('acl', required : want_acl == 'true')
-        if libacl.found()
-                conf.set('HAVE_ACL', true)
-                m4_defines += ['-DHAVE_ACL']
-        endif
+        have = libacl.found()
 else
+        have = false
         libacl = []
 endif
+conf.set10('HAVE_ACL', have)
+m4_defines += have ? ['-DHAVE_ACL'] : []
 
 want_audit = get_option('audit')
 if want_audit != 'false'
         libaudit = dependency('audit', required : want_audit == 'true')
-        conf.set('HAVE_AUDIT', libaudit.found())
+        have = libaudit.found()
 else
+        have = false
         libaudit = []
 endif
+conf.set10('HAVE_AUDIT', have)
 
 want_blkid = get_option('blkid')
 if want_blkid != 'false'
         libblkid = dependency('blkid', required : want_blkid == 'true')
-        conf.set('HAVE_BLKID', libblkid.found())
+        have = libblkid.found()
 else
+        have = false
         libblkid = []
 endif
+conf.set10('HAVE_BLKID', have)
 
 want_kmod = get_option('kmod')
 if want_kmod != 'false'
         libkmod = dependency('libkmod',
                              version : '>= 15',
                              required : want_kmod == 'true')
-        conf.set('HAVE_KMOD', libkmod.found())
+        have = libkmod.found()
 else
+        have = false
         libkmod = []
 endif
+conf.set10('HAVE_KMOD', have)
 
 want_pam = get_option('pam')
 if want_pam != 'false'
         libpam = cc.find_library('pam', required : want_pam == 'true')
         libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
-        if libpam.found() and libpam_misc.found()
-                conf.set('HAVE_PAM', true)
-                m4_defines += ['-DHAVE_PAM']
-        endif
+        have = libpam.found() and libpam_misc.found()
 else
+        have = false
         libpam = []
         libpam_misc = []
 endif
+conf.set10('HAVE_PAM', have)
+m4_defines += have ? ['-DHAVE_PAM'] : []
 
 want_microhttpd = get_option('microhttpd')
 if want_microhttpd != 'false'
         libmicrohttpd = dependency('libmicrohttpd',
                                    version : '>= 0.9.33',
                                    required : want_microhttpd == 'true')
-        if libmicrohttpd.found()
-                conf.set('HAVE_MICROHTTPD', true)
-                m4_defines += ['-DHAVE_MICROHTTPD']
-        endif
+        have = libmicrohttpd.found()
 else
+        have = false
         libmicrohttpd = []
 endif
+conf.set10('HAVE_MICROHTTPD', have)
+m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
 
 want_libcryptsetup = get_option('libcryptsetup')
 if want_libcryptsetup != 'false'
         libcryptsetup = dependency('libcryptsetup',
                                    version : '>= 1.6.0',
                                    required : want_libcryptsetup == 'true')
-        conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
+        have = libcryptsetup.found()
 else
+        have = false
         libcryptsetup = []
 endif
+conf.set10('HAVE_LIBCRYPTSETUP', have)
 
 want_libcurl = get_option('libcurl')
 if want_libcurl != 'false'
         libcurl = dependency('libcurl',
                              version : '>= 7.32.0',
                              required : want_libcurl == 'true')
-        if libcurl.found()
-                conf.set('HAVE_LIBCURL', true)
-                m4_defines += ['-DHAVE_LIBCURL']
-        endif
+        have = libcurl.found()
 else
+        have = false
         libcurl = []
 endif
+conf.set10('HAVE_LIBCURL', have)
+m4_defines += have ? ['-DHAVE_LIBCURL'] : []
 
 want_libidn = get_option('libidn')
 want_libidn2 = get_option('libidn2')
@@ -821,125 +829,140 @@ endif
 if want_libidn != 'false' and want_libidn2 != 'true'
         libidn = dependency('libidn',
                             required : want_libidn == 'true')
-        if libidn.found()
-                conf.set('HAVE_LIBIDN', true)
-                m4_defines += ['-DHAVE_LIBIDN']
-        endif
+        have = libidn.found()
 else
+        have = false
         libidn = []
 endif
-if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
+conf.set10('HAVE_LIBIDN', have)
+m4_defines += have ? ['-DHAVE_LIBIDN'] : []
+if not have and want_libidn2 != 'false'
         # libidn is used for both libidn and libidn2 objects
         libidn = dependency('libidn2',
                             required : want_libidn2 == 'true')
-        if libidn.found()
-                conf.set('HAVE_LIBIDN2', true)
-                m4_defines += ['-DHAVE_LIBIDN2']
-        endif
+        have = libidn.found()
+else
+        have = false
 endif
+conf.set10('HAVE_LIBIDN2', have)
+m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
 
 want_libiptc = get_option('libiptc')
 if want_libiptc != 'false'
         libiptc = dependency('libiptc',
                              required : want_libiptc == 'true')
-        if libiptc.found()
-                conf.set('HAVE_LIBIPTC', true)
-                m4_defines += ['-DHAVE_LIBIPTC']
-        endif
+        have = libiptc.found()
 else
+        have = false
         libiptc = []
 endif
+conf.set10('HAVE_LIBIPTC', have)
+m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
 
 want_qrencode = get_option('qrencode')
 if want_qrencode != 'false'
         libqrencode = dependency('libqrencode',
                                  required : want_qrencode == 'true')
-        conf.set('HAVE_QRENCODE', libqrencode.found())
+        have = libqrencode.found()
 else
+        have = false
         libqrencode = []
 endif
+conf.set10('HAVE_QRENCODE', have)
 
 want_gcrypt = get_option('gcrypt')
 if want_gcrypt != 'false'
         libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
         libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
-
-        have_deps = libgcrypt.found() and libgpg_error.found()
-        conf.set('HAVE_GCRYPT', have_deps)
-        if not have_deps
-                # link to neither of the libs if one is not found
-                libgcrypt = []
-                libgpg_error = []
-        endif
+        have = libgcrypt.found() and libgpg_error.found()
 else
+        have = false
+endif
+if not have
+        # link to neither of the libs if one is not found
         libgcrypt = []
         libgpg_error = []
 endif
+conf.set10('HAVE_GCRYPT', have)
 
 want_gnutls = get_option('gnutls')
 if want_gnutls != 'false'
         libgnutls = dependency('gnutls',
                                version : '>= 3.1.4',
                                required : want_gnutls == 'true')
-        conf.set('HAVE_GNUTLS', libgnutls.found())
+        have = libgnutls.found()
 else
+        have = false
         libgnutls = []
 endif
+conf.set10('HAVE_GNUTLS', have)
 
 want_elfutils = get_option('elfutils')
 if want_elfutils != 'false'
         libdw = dependency('libdw',
                            required : want_elfutils == 'true')
-        conf.set('HAVE_ELFUTILS', libdw.found())
+        have = libdw.found()
 else
+        have = false
         libdw = []
 endif
+conf.set10('HAVE_ELFUTILS', have)
 
 want_zlib = get_option('zlib')
 if want_zlib != 'false'
         libz = dependency('zlib',
                           required : want_zlib == 'true')
-        conf.set('HAVE_ZLIB', libz.found())
+        have = libz.found()
 else
+        have = false
         libz = []
 endif
+conf.set10('HAVE_ZLIB', have)
 
 want_bzip2 = get_option('bzip2')
 if want_bzip2 != 'false'
         libbzip2 = cc.find_library('bz2',
                                    required : want_bzip2 == 'true')
-        conf.set('HAVE_BZIP2', libbzip2.found())
+        have = libbzip2.found()
 else
+        have = false
         libbzip2 = []
 endif
+conf.set10('HAVE_BZIP2', have)
 
 want_xz = get_option('xz')
 if want_xz != 'false'
         libxz = dependency('liblzma',
                            required : want_xz == 'true')
-        conf.set('HAVE_XZ', libxz.found())
+        have = libxz.found()
 else
+        have = false
         libxz = []
 endif
+conf.set10('HAVE_XZ', have)
 
 want_lz4 = get_option('lz4')
 if want_lz4 != 'false'
         liblz4 = dependency('liblz4',
                             required : want_lz4 == 'true')
-        conf.set('HAVE_LZ4', liblz4.found())
+        have = liblz4.found()
 else
+        have = false
         liblz4 = []
 endif
+conf.set10('HAVE_LZ4', have)
 
 want_xkbcommon = get_option('xkbcommon')
 if want_xkbcommon != 'false'
         libxkbcommon = dependency('xkbcommon',
                                   version : '>= 0.3.0',
                                   required : want_xkbcommon == 'true')
-        conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
+        have = libxkbcommon.found()
 else
+        have = false
         libxkbcommon = []
 endif
+conf.set10('HAVE_XKBCOMMON', have)
 
 want_glib = get_option('glib')
 if want_glib != 'false'
@@ -952,25 +975,28 @@ if want_glib != 'false'
         libgio =     dependency('gio-2.0',
                                 required : want_glib == 'true')
         have = libglib.found() and libgobject.found() and libgio.found()
-        conf.set('HAVE_GLIB', have)
 else
+        have = false
         libglib = []
         libgobject = []
         libgio = []
 endif
+conf.set10('HAVE_GLIB', have)
 
 want_dbus = get_option('dbus')
 if want_dbus != 'false'
         libdbus = dependency('dbus-1',
                              version : '>= 1.3.2',
                              required : want_dbus == 'true')
-        conf.set('HAVE_DBUS', libdbus.found())
+        have = libdbus.found()
 else
+        have = false
         libdbus = []
 endif
+conf.set10('HAVE_DBUS', have)
 
 default_dnssec = get_option('default-dnssec')
-if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
+if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
         message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
         default_dnssec = 'no'
 endif
@@ -980,21 +1006,23 @@ substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
 
 want_importd = get_option('importd')
 if want_importd != 'false'
-        have_deps = (conf.get('HAVE_LIBCURL', false) and
-                     conf.get('HAVE_ZLIB', false) and
-                     conf.get('HAVE_BZIP2', false) and
-                     conf.get('HAVE_XZ', false) and
-                     conf.get('HAVE_GCRYPT', false))
-        conf.set('ENABLE_IMPORTD', have_deps)
-        if want_importd == 'true' and not have_deps
+        have = (conf.get('HAVE_LIBCURL') == 1 and
+                conf.get('HAVE_ZLIB') == 1 and
+                conf.get('HAVE_BZIP2') == 1 and
+                conf.get('HAVE_XZ') == 1 and
+                conf.get('HAVE_GCRYPT') == 1)
+        if want_importd == 'true' and not have
                 error('importd support was requested, but dependencies are not available')
         endif
+else
+        have = false
 endif
+conf.set10('ENABLE_IMPORTD', have)
 
 want_remote = get_option('remote')
 if want_remote != 'false'
-        have_deps = [conf.get('HAVE_MICROHTTPD', false),
-                     conf.get('HAVE_LIBCURL', false)]
+        have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
+                     conf.get('HAVE_LIBCURL') == 1]
         # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
         # it's possible to build one without the other. Complain only if
         # support was explictly requested. The auxiliary files like sysusers
@@ -1002,8 +1030,11 @@ if want_remote != 'false'
         if want_remote == 'true' and not (have_deps[0] and have_deps[1])
                 error('remote support was requested, but dependencies are not available')
         endif
-        conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
+        have = have_deps[0] or have_deps[1]
+else
+        have = false
 endif
+conf.set10('ENABLE_REMOTE', have)
 
 foreach pair : [['utmp',          'HAVE_UTMP'],
                 ['hibernate',     'ENABLE_HIBERNATE'],
@@ -1038,10 +1069,9 @@ foreach pair : [['utmp',          'HAVE_UTMP'],
                 ['nss-systemd',   'ENABLE_NSS_SYSTEMD'],
                ]
 
-        if get_option(pair[0])
-                conf.set(pair[1], true)
-                m4_defines += ['-D' + pair[1]]
-        endif
+        have = get_option(pair[0])
+        conf.set10(pair[1], have)
+        m4_defines += have ? ['-D' + pair[1]] : []
 endforeach
 
 want_tests = get_option('tests')
@@ -1072,11 +1102,14 @@ if get_option('efi')
                 gnu_efi_arch = ''
         endif
 
-        conf.set('ENABLE_EFI', true)
+        have = true
         conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
 
         conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
+else
+        have = false
 endif
+conf.set10('ENABLE_EFI', have)
 
 #####################################################################
 
@@ -1191,7 +1224,7 @@ foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
                  ['mymachines', 'ENABLE_MACHINED'],
                  ['resolve',    'ENABLE_RESOLVED']]
 
-        condition = tuple[1] == '' or conf.get(tuple[1], false)
+        condition = tuple[1] == '' or conf.get(tuple[1]) == 1
         if condition
                 module = tuple[0]
 
@@ -1319,7 +1352,7 @@ executable('systemd-fstab-generator',
            install : true,
            install_dir : systemgeneratordir)
 
-if conf.get('ENABLE_ENVIRONMENT_D', false)
+if conf.get('ENABLE_ENVIRONMENT_D') == 1
         executable('30-systemd-environment-d-generator',
                    'src/environment-d-generator/environment-d-generator.c',
                    include_directories : includes,
@@ -1333,7 +1366,7 @@ if conf.get('ENABLE_ENVIRONMENT_D', false)
                                  join_paths(environmentdir, '99-environment.conf'))
 endif
 
-if conf.get('ENABLE_HIBERNATE', false)
+if conf.get('ENABLE_HIBERNATE') == 1
         executable('systemd-hibernate-resume-generator',
                    'src/hibernate-resume/hibernate-resume-generator.c',
                    include_directories : includes,
@@ -1351,7 +1384,7 @@ if conf.get('ENABLE_HIBERNATE', false)
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('HAVE_BLKID', false)
+if conf.get('HAVE_BLKID') == 1
         executable('systemd-gpt-auto-generator',
                    'src/gpt-auto-generator/gpt-auto-generator.c',
                    'src/basic/blkid-util.h',
@@ -1372,7 +1405,7 @@ if conf.get('HAVE_BLKID', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_RESOLVED', false)
+if conf.get('ENABLE_RESOLVED') == 1
         executable('systemd-resolved',
                    systemd_resolved_sources,
                    gcrypt_util_sources,
@@ -1402,7 +1435,7 @@ if conf.get('ENABLE_RESOLVED', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_LOGIND', false)
+if conf.get('ENABLE_LOGIND') == 1
         executable('systemd-logind',
                    systemd_logind_sources,
                    include_directories : includes,
@@ -1435,7 +1468,7 @@ if conf.get('ENABLE_LOGIND', false)
                          install_dir : rootbindir)
         public_programs += [exe]
 
-        if conf.get('HAVE_PAM', false)
+        if conf.get('HAVE_PAM') == 1
                 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
                 pam_systemd = shared_library(
                         'pam_systemd',
@@ -1459,7 +1492,7 @@ if conf.get('ENABLE_LOGIND', false)
         endif
 endif
 
-if conf.get('HAVE_PAM', false)
+if conf.get('HAVE_PAM') == 1
         executable('systemd-user-sessions',
                    'src/user-sessions/user-sessions.c',
                    include_directories : includes,
@@ -1469,7 +1502,7 @@ if conf.get('HAVE_PAM', false)
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
+if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
         exe = executable('bootctl',
                          'src/boot/bootctl.c',
                          include_directories : includes,
@@ -1501,7 +1534,7 @@ exe = executable('systemctl', 'src/systemctl/systemctl.c',
                  install_dir : rootbindir)
 public_programs += [exe]
 
-if conf.get('ENABLE_BACKLIGHT', false)
+if conf.get('ENABLE_BACKLIGHT') == 1
         executable('systemd-backlight',
                    'src/backlight/backlight.c',
                    include_directories : includes,
@@ -1511,7 +1544,7 @@ if conf.get('ENABLE_BACKLIGHT', false)
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_RFKILL', false)
+if conf.get('ENABLE_RFKILL') == 1
         executable('systemd-rfkill',
                    'src/rfkill/rfkill.c',
                    include_directories : includes,
@@ -1529,7 +1562,7 @@ executable('systemd-system-update-generator',
            install : true,
            install_dir : systemgeneratordir)
 
-if conf.get('HAVE_LIBCRYPTSETUP', false)
+if conf.get('HAVE_LIBCRYPTSETUP') == 1
         executable('systemd-cryptsetup',
                    'src/cryptsetup/cryptsetup.c',
                    include_directories : includes,
@@ -1567,7 +1600,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', false)
                    install_dir : systemgeneratordir)
 endif
 
-if conf.get('HAVE_SYSV_COMPAT', false)
+if conf.get('HAVE_SYSV_COMPAT') == 1
         executable('systemd-sysv-generator',
                    'src/sysv-generator/sysv-generator.c',
                    include_directories : includes,
@@ -1585,7 +1618,7 @@ if conf.get('HAVE_SYSV_COMPAT', false)
                    install_dir : systemgeneratordir)
 endif
 
-if conf.get('ENABLE_HOSTNAMED', false)
+if conf.get('ENABLE_HOSTNAMED') == 1
         executable('systemd-hostnamed',
                    'src/hostname/hostnamed.c',
                    include_directories : includes,
@@ -1603,8 +1636,8 @@ if conf.get('ENABLE_HOSTNAMED', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_LOCALED', false)
-        if conf.get('HAVE_XKBCOMMON', false)
+if conf.get('ENABLE_LOCALED') == 1
+        if conf.get('HAVE_XKBCOMMON') == 1
                 # logind will load libxkbcommon.so dynamically on its own
                 deps = [libdl]
         else
@@ -1629,7 +1662,7 @@ if conf.get('ENABLE_LOCALED', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_TIMEDATED', false)
+if conf.get('ENABLE_TIMEDATED') == 1
         executable('systemd-timedated',
                    'src/timedate/timedated.c',
                    include_directories : includes,
@@ -1647,7 +1680,7 @@ if conf.get('ENABLE_TIMEDATED', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_TIMESYNCD', false)
+if conf.get('ENABLE_TIMESYNCD') == 1
         executable('systemd-timesyncd',
                    systemd_timesyncd_sources,
                    include_directories : includes,
@@ -1659,7 +1692,7 @@ if conf.get('ENABLE_TIMESYNCD', false)
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_MACHINED', false)
+if conf.get('ENABLE_MACHINED') == 1
         executable('systemd-machined',
                    systemd_machined_sources,
                    include_directories : includes,
@@ -1682,7 +1715,7 @@ if conf.get('ENABLE_MACHINED', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_IMPORTD', false)
+if conf.get('ENABLE_IMPORTD') == 1
         executable('systemd-importd',
                    systemd_importd_sources,
                    include_directories : includes,
@@ -1731,7 +1764,7 @@ if conf.get('ENABLE_IMPORTD', false)
         public_programs += [systemd_pull, systemd_import, systemd_export]
 endif
 
-if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
+if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
         exe = executable('systemd-journal-upload',
                          systemd_journal_upload_sources,
                          include_directories : includes,
@@ -1747,7 +1780,7 @@ if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
+if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
         s_j_remote = executable('systemd-journal-remote',
                                 systemd_journal_remote_sources,
                                 include_directories : includes,
@@ -1776,7 +1809,7 @@ if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
         public_programs += [s_j_remote, s_j_gatewayd]
 endif
 
-if conf.get('ENABLE_COREDUMP', false)
+if conf.get('ENABLE_COREDUMP') == 1
         executable('systemd-coredump',
                    systemd_coredump_sources,
                    include_directories : includes,
@@ -1802,7 +1835,7 @@ if conf.get('ENABLE_COREDUMP', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_BINFMT', false)
+if conf.get('ENABLE_BINFMT') == 1
         exe = executable('systemd-binfmt',
                          'src/binfmt/binfmt.c',
                          include_directories : includes,
@@ -1818,7 +1851,7 @@ if conf.get('ENABLE_BINFMT', false)
                                  mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
 endif
 
-if conf.get('ENABLE_VCONSOLE', false)
+if conf.get('ENABLE_VCONSOLE') == 1
         executable('systemd-vconsole-setup',
                    'src/vconsole/vconsole-setup.c',
                    include_directories : includes,
@@ -1828,7 +1861,7 @@ if conf.get('ENABLE_VCONSOLE', false)
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_RANDOMSEED', false)
+if conf.get('ENABLE_RANDOMSEED') == 1
         executable('systemd-random-seed',
                    'src/random-seed/random-seed.c',
                    include_directories : includes,
@@ -1838,7 +1871,7 @@ if conf.get('ENABLE_RANDOMSEED', false)
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_FIRSTBOOT', false)
+if conf.get('ENABLE_FIRSTBOOT') == 1
         executable('systemd-firstboot',
                    'src/firstboot/firstboot.c',
                    include_directories : includes,
@@ -2047,7 +2080,7 @@ exe = executable('busctl',
                  install : true)
 public_programs += [exe]
 
-if conf.get('ENABLE_SYSUSERS', false)
+if conf.get('ENABLE_SYSUSERS') == 1
         exe = executable('systemd-sysusers',
                          'src/sysusers/sysusers.c',
                          include_directories : includes,
@@ -2058,7 +2091,7 @@ if conf.get('ENABLE_SYSUSERS', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_TMPFILES', false)
+if conf.get('ENABLE_TMPFILES') == 1
         exe = executable('systemd-tmpfiles',
                          'src/tmpfiles/tmpfiles.c',
                          include_directories : includes,
@@ -2070,7 +2103,7 @@ if conf.get('ENABLE_TMPFILES', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_HWDB', false)
+if conf.get('ENABLE_HWDB') == 1
         exe = executable('systemd-hwdb',
                          'src/hwdb/hwdb.c',
                          'src/libsystemd/sd-hwdb/hwdb-internal.h',
@@ -2082,7 +2115,7 @@ if conf.get('ENABLE_HWDB', false)
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_QUOTACHECK', false)
+if conf.get('ENABLE_QUOTACHECK') == 1
         executable('systemd-quotacheck',
                    'src/quotacheck/quotacheck.c',
                    include_directories : includes,
@@ -2160,7 +2193,7 @@ executable('systemd-update-utmp',
            install : true,
            install_dir : rootlibexecdir)
 
-if conf.get('HAVE_KMOD', false)
+if conf.get('HAVE_KMOD') == 1
         executable('systemd-modules-load',
                    'src/modules-load/modules-load.c',
                    include_directories : includes,
@@ -2192,7 +2225,7 @@ exe = executable('systemd-nspawn',
                  install : true)
 public_programs += [exe]
 
-if conf.get('ENABLE_NETWORKD', false)
+if conf.get('ENABLE_NETWORKD') == 1
         executable('systemd-networkd',
                    systemd_networkd_sources,
                    include_directories : includes,
@@ -2242,7 +2275,7 @@ foreach tuple : tests
                 type = ''
         endif
 
-        if condition == '' or conf.get(condition, false)
+        if condition == '' or conf.get(condition) == 1
                 exe = executable(
                         name,
                         sources,
@@ -2448,7 +2481,7 @@ status += [
 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
 # LDFLAGS:  ${OUR_LDFLAGS} ${LDFLAGS}
 
-if conf.get('ENABLE_EFI', false)
+if conf.get('ENABLE_EFI') == 1
         status += [
                 'efi arch:                          @0@'.format(efi_arch)]
 
@@ -2519,13 +2552,13 @@ foreach tuple : [
         ['blkid'],
         ['dbus'],
         ['glib'],
-        ['nss-myhostname',   conf.get('HAVE_MYHOSTNAME', false)],
+        ['nss-myhostname',   conf.get('HAVE_MYHOSTNAME') == 1],
         ['hwdb'],
         ['tpm'],
         ['man pages',        want_man],
         ['html pages',       want_html],
         ['man page indices', want_man and have_lxml],
-        ['split /usr',       conf.get('HAVE_SPLIT_USR', false)],
+        ['split /usr',       conf.get('HAVE_SPLIT_USR') == 1],
         ['SysV compat'],
         ['utmp'],
         ['ldconfig'],
@@ -2541,7 +2574,7 @@ foreach tuple : [
         if cond == ''
                 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
                 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
-                cond = conf.get(ident1, false) or conf.get(ident2, false)
+                cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
         endif
         if cond
                 found += [tuple[0]]
index e9f9bbae4270b669ed33e59ddb561c2436e65615..4c33e45a166b414f625c72e88ddee286492b2175 100644 (file)
@@ -1,4 +1,4 @@
-if conf.get('ENABLE_NETWORKD', false)
+if conf.get('ENABLE_NETWORKD') == 1
         install_data('80-container-host0.network',
                      '80-container-ve.network',
                      '80-container-vz.network',
index 93996618457703d32fbf382db9a0b4afdc940382..1b25e2667503e66995430d1d8e91ff8080561cf0 100644 (file)
@@ -42,7 +42,7 @@ if bashcompletiondir != 'no'
                 ]
 
         foreach item : items
-                if item[1] == '' or conf.get(item[1], false)
+                if item[1] == '' or conf.get(item[1]) == 1
                         install_data(item[0],
                                      install_dir : bashcompletiondir)
                 endif
index 34408ce90daedf5cb827b2e0032e8f54cc06675e..a3a821e0b119779f56acf333a8cc007c30f861bc 100644 (file)
@@ -39,7 +39,7 @@ if zshcompletiondir != 'no'
                 ]
 
         foreach item : items
-                if item[1] == '' or conf.get(item[1], false)
+                if item[1] == '' or conf.get(item[1]) == 1
                         install_data(item[0],
                                      install_dir : zshcompletiondir)
                 endif
index 0e0fb08922c06909d5efe424b7c1ee62f46ea77d..9fcc20dba3dc4100749a2cdcb9df40e8350e4d31 100644 (file)
@@ -36,7 +36,7 @@
 #include "log.h"
 #include "pager.h"
 #include "parse-util.h"
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
 #include "special.h"
@@ -1337,7 +1337,7 @@ static int get_log_target(sd_bus *bus, char **args) {
         return 0;
 }
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 static void dump_syscall_filter(const SyscallFilterSet *set) {
         const char *syscall;
 
index 1b9cace0407257d05aca29b3faf686642c125cdc..53340ec6f363816c5c16e28d93e9f6fc1c9b8cf9 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
 #include <blkid.h>
 #endif
 
 #include "util.h"
 
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
 DEFINE_TRIVIAL_CLEANUP_FUNC(blkid_probe, blkid_free_probe);
 #define _cleanup_blkid_free_probe_ _cleanup_(blkid_free_probep)
 #endif
index 55054993125fd8dafe27743798684d7f8e88ed7e..c2061addd17c5061b1ba748f7d0e36d9ed868d78 100644 (file)
@@ -32,7 +32,7 @@
 #include <sys/sysmacros.h>
 #include <unistd.h>
 
-#ifdef HAVE_LINUX_BTRFS_H
+#if HAVE_LINUX_BTRFS_H
 #include <linux/btrfs.h>
 #endif
 
index 3223915da617be3855f891c2168bc91fef4ae97a..8ca8f706cbc9c5dcc9d9d9d1282b7f47e0e58405 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_PAM
+#if HAVE_PAM
 #define _PAM_FEATURE_ "+PAM"
 #else
 #define _PAM_FEATURE_ "-PAM"
 #endif
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
 #define _AUDIT_FEATURE_ "+AUDIT"
 #else
 #define _AUDIT_FEATURE_ "-AUDIT"
 #endif
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #define _SELINUX_FEATURE_ "+SELINUX"
 #else
 #define _SELINUX_FEATURE_ "-SELINUX"
 #endif
 
-#ifdef HAVE_APPARMOR
+#if HAVE_APPARMOR
 #define _APPARMOR_FEATURE_ "+APPARMOR"
 #else
 #define _APPARMOR_FEATURE_ "-APPARMOR"
 #endif
 
-#ifdef HAVE_IMA
+#if HAVE_IMA
 #define _IMA_FEATURE_ "+IMA"
 #else
 #define _IMA_FEATURE_ "-IMA"
 #endif
 
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
 #define _SMACK_FEATURE_ "+SMACK"
 #else
 #define _SMACK_FEATURE_ "-SMACK"
 #endif
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
 #define _SYSVINIT_FEATURE_ "+SYSVINIT"
 #else
 #define _SYSVINIT_FEATURE_ "-SYSVINIT"
 #endif
 
-#ifdef HAVE_UTMP
+#if HAVE_UTMP
 #define _UTMP_FEATURE_ "+UTMP"
 #else
 #define _UTMP_FEATURE_ "-UTMP"
 #endif
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
 #define _LIBCRYPTSETUP_FEATURE_ "+LIBCRYPTSETUP"
 #else
 #define _LIBCRYPTSETUP_FEATURE_ "-LIBCRYPTSETUP"
 #endif
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 #define _GCRYPT_FEATURE_ "+GCRYPT"
 #else
 #define _GCRYPT_FEATURE_ "-GCRYPT"
 #endif
 
-#ifdef HAVE_GNUTLS
+#if HAVE_GNUTLS
 #define _GNUTLS_FEATURE_ "+GNUTLS"
 #else
 #define _GNUTLS_FEATURE_ "-GNUTLS"
 #endif
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
 #define _ACL_FEATURE_ "+ACL"
 #else
 #define _ACL_FEATURE_ "-ACL"
 #endif
 
-#ifdef HAVE_XZ
+#if HAVE_XZ
 #define _XZ_FEATURE_ "+XZ"
 #else
 #define _XZ_FEATURE_ "-XZ"
 #endif
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
 #define _LZ4_FEATURE_ "+LZ4"
 #else
 #define _LZ4_FEATURE_ "-LZ4"
 #endif
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #define _SECCOMP_FEATURE_ "+SECCOMP"
 #else
 #define _SECCOMP_FEATURE_ "-SECCOMP"
 #endif
 
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
 #define _BLKID_FEATURE_ "+BLKID"
 #else
 #define _BLKID_FEATURE_ "-BLKID"
 #endif
 
-#ifdef HAVE_ELFUTILS
+#if HAVE_ELFUTILS
 #define _ELFUTILS_FEATURE_ "+ELFUTILS"
 #else
 #define _ELFUTILS_FEATURE_ "-ELFUTILS"
 #endif
 
-#ifdef HAVE_KMOD
+#if HAVE_KMOD
 #define _KMOD_FEATURE_ "+KMOD"
 #else
 #define _KMOD_FEATURE_ "-KMOD"
 #endif
 
-#ifdef HAVE_LIBIDN2
+#if HAVE_LIBIDN2
 #define _IDN2_FEATURE_ "+IDN2"
 #else
 #define _IDN2_FEATURE_ "-IDN2"
 #endif
 
-#ifdef HAVE_LIBIDN
+#if HAVE_LIBIDN
 #define _IDN_FEATURE_ "+IDN"
 #else
 #define _IDN_FEATURE_ "-IDN"
index d3f5381e1baa1e43eb145b2312863db296c05610..c04e58b57a9cebba05f552315207298058429e69 100644 (file)
@@ -43,7 +43,7 @@
 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
 #define SIGNALS_IGNORE SIGPIPE
 
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
 #define KBD_KEYMAP_DIRS                         \
         "/usr/share/keymaps/\0"                 \
         "/usr/share/kbd/keymaps/\0"             \
@@ -68,7 +68,7 @@
 #define NOTIFY_FD_MAX 768
 #define NOTIFY_BUFFER_MAX PIPE_BUF
 
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
 #  define _CONF_PATHS_SPLIT_USR(n) "/lib/" n "\0"
 #else
 #  define _CONF_PATHS_SPLIT_USR(n)
index 6ef1b0ba3583678e8df63ed7ff75227854749313..289c2ad2c354f340704aee7538d108661d377c3c 100644 (file)
@@ -34,7 +34,7 @@
 #include "strv.h"
 #include "util.h"
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
 #include <pthread.h>
 #include "list.h"
 #endif
@@ -142,7 +142,7 @@ typedef uint8_t dib_raw_t;
 
 #define DIB_FREE UINT_MAX
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
 struct hashmap_debug_info {
         LIST_FIELDS(struct hashmap_debug_info, debug_list);
         unsigned max_entries;  /* high watermark of n_entries */
@@ -499,7 +499,7 @@ static void base_remove_entry(HashmapBase *h, unsigned idx) {
         dibs = dib_raw_ptr(h);
         assert(dibs[idx] != DIB_RAW_FREE);
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         h->debug.rem_count++;
         h->debug.last_rem_idx = idx;
 #endif
@@ -578,7 +578,7 @@ static unsigned hashmap_iterate_in_insertion_order(OrderedHashmap *h, Iterator *
                 assert(e->p.b.key == i->next_key);
         }
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         i->prev_idx = idx;
 #endif
 
@@ -635,7 +635,7 @@ static unsigned hashmap_iterate_in_internal_order(HashmapBase *h, Iterator *i) {
         }
 
         idx = i->idx;
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         i->prev_idx = idx;
 #endif
 
@@ -658,7 +658,7 @@ static unsigned hashmap_iterate_entry(HashmapBase *h, Iterator *i) {
                 return IDX_NIL;
         }
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         if (i->idx == IDX_FIRST) {
                 i->put_count = h->debug.put_count;
                 i->rem_count = h->debug.rem_count;
@@ -750,7 +750,7 @@ static struct HashmapBase *hashmap_base_new(const struct hash_ops *hash_ops, enu
                 shared_hash_key_initialized= true;
         }
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         h->debug.func = func;
         h->debug.file = file;
         h->debug.line = line;
@@ -807,7 +807,7 @@ static void hashmap_free_no_clear(HashmapBase *h) {
         assert(!h->has_indirect);
         assert(!h->n_direct_entries);
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         assert_se(pthread_mutex_lock(&hashmap_debug_list_mutex) == 0);
         LIST_REMOVE(debug_list, hashmap_debug_list, &h->debug);
         assert_se(pthread_mutex_unlock(&hashmap_debug_list_mutex) == 0);
@@ -919,7 +919,7 @@ static bool hashmap_put_robin_hood(HashmapBase *h, unsigned idx,
         dib_raw_t raw_dib, *dibs;
         unsigned dib, distance;
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         h->debug.put_count++;
 #endif
 
@@ -1012,7 +1012,7 @@ static int hashmap_base_put_boldly(HashmapBase *h, unsigned idx,
         assert_se(hashmap_put_robin_hood(h, idx, swap) == false);
 
         n_entries_inc(h);
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         h->debug.max_entries = MAX(h->debug.max_entries, n_entries(h));
 #endif
 
@@ -1240,7 +1240,7 @@ int hashmap_replace(Hashmap *h, const void *key, void *value) {
         idx = bucket_scan(h, hash, key);
         if (idx != IDX_NIL) {
                 e = plain_bucket_at(h, idx);
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
                 /* Although the key is equal, the key pointer may have changed,
                  * and this would break our assumption for iterating. So count
                  * this operation as incompatible with iteration. */
index 6d1ae48b213b76fbe4da1b4c01fc5ebb3d8e13e9..c1089652d3230cd0b144eb8856dd6294fe410d86 100644 (file)
@@ -58,7 +58,7 @@ typedef struct Set Set;                       /* Stores just keys */
 typedef struct {
         unsigned idx;         /* index of an entry to be iterated next */
         const void *next_key; /* expected value of that entry's key pointer */
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
         unsigned put_count;   /* hashmap's put_count recorded at start of iteration */
         unsigned rem_count;   /* hashmap's rem_count in previous iteration */
         unsigned prev_idx;    /* idx in previous iteration */
@@ -89,7 +89,7 @@ typedef struct {
                 (Hashmap*)(h), \
                 (void)0)
 
-#ifdef ENABLE_DEBUG_HASHMAP
+#if ENABLE_DEBUG_HASHMAP
 # define HASHMAP_DEBUG_PARAMS , const char *func, const char *file, int line
 # define HASHMAP_DEBUG_SRC_ARGS   , __func__, __FILE__, __LINE__
 # define HASHMAP_DEBUG_PASS_ARGS   , func, file, line
index 8c8cc78ebf9bcac2b15cbaffe86a34e4bd400376..8f4f0e3a24803bc63361c50f9dafc4e2cae1ff96 100644 (file)
@@ -21,7 +21,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#ifdef HAVE_LINUX_MEMFD_H
+#if HAVE_LINUX_MEMFD_H
 #include <linux/memfd.h>
 #endif
 #include <stdio.h>
index 2523b28fa15ee37249776d6c9b3941c835347954..352d2b024bc305913db28c560fc16de76133a4f9 100644 (file)
@@ -40,7 +40,7 @@
 #include <uchar.h>
 #include <unistd.h>
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
 #include <libaudit.h>
 #endif
 
 #include <asm/sgidefs.h>
 #endif
 
-#ifdef HAVE_LINUX_BTRFS_H
+#if HAVE_LINUX_BTRFS_H
 #include <linux/btrfs.h>
 #endif
 
-#ifdef HAVE_LINUX_VM_SOCKETS_H
+#if HAVE_LINUX_VM_SOCKETS_H
 #include <linux/vm_sockets.h>
 #else
 #define VMADDR_CID_ANY -1U
@@ -204,7 +204,7 @@ struct sockaddr_vm {
 #define BTRFS_QGROUP_LEVEL_SHIFT 48
 #endif
 
-#ifndef HAVE_LINUX_BTRFS_H
+#if ! HAVE_LINUX_BTRFS_H
 struct btrfs_ioctl_vol_args {
         int64_t fd;
         char name[BTRFS_PATH_NAME_MAX + 1];
@@ -546,8 +546,8 @@ struct btrfs_ioctl_quota_ctl_args {
 #define MAX_HANDLE_SZ 128
 #endif
 
-#ifndef HAVE_SECURE_GETENV
-#  ifdef HAVE___SECURE_GETENV
+#if ! HAVE_SECURE_GETENV
+#  if HAVE___SECURE_GETENV
 #    define secure_getenv __secure_getenv
 #  else
 #    error "neither secure_getenv nor __secure_getenv are available"
@@ -1108,7 +1108,7 @@ struct input_mask {
 #define KEY_ALS_TOGGLE 0x230
 #endif
 
-#ifndef HAVE_KEY_SERIAL_T
+#if ! HAVE_KEY_SERIAL_T
 typedef int32_t key_serial_t;
 #endif
 
@@ -1204,11 +1204,11 @@ typedef int32_t key_serial_t;
 #ifndef IF_OPER_UP
 #define IF_OPER_UP 6
 
-#ifndef HAVE_CHAR32_T
+#if ! HAVE_CHAR32_T
 #define char32_t uint32_t
 #endif
 
-#ifndef HAVE_CHAR16_T
+#if ! HAVE_CHAR16_T
 #define char16_t uint16_t
 #endif
 
@@ -1220,7 +1220,7 @@ typedef int32_t key_serial_t;
 #define IFA_F_MCAUTOJOIN 0x400
 #endif
 
-#ifndef HAVE_STRUCT_ETHTOOL_LINK_SETTINGS
+#if ! HAVE_STRUCT_ETHTOOL_LINK_SETTINGS
 
 #define ETHTOOL_GLINKSETTINGS   0x0000004c /* Get ethtool_link_settings */
 #define ETHTOOL_SLINKSETTINGS   0x0000004d /* Set ethtool_link_settings */
@@ -1247,7 +1247,7 @@ struct ethtool_link_settings {
 
 #endif
 
-#ifndef HAVE_STRUCT_FIB_RULE_UID_RANGE
+#if ! HAVE_STRUCT_FIB_RULE_UID_RANGE
 
 struct fib_rule_uid_range {
         __u32 start;
index ea00955818661be74f0d35492787b7a1d9089f7f..546246595c2f0e053cb4142af98896ab4fce71ab 100644 (file)
@@ -30,7 +30,7 @@
 #define DEFAULT_PATH_NORMAL "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
 #define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":/sbin:/bin"
 
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
 #  define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR
 #else
 #  define DEFAULT_PATH DEFAULT_PATH_NORMAL
index ab661a8f1632c322965345508a4ce3023b2228c0..8e94f969c38714c2633c117322deb2b7091a8f65 100644 (file)
@@ -34,7 +34,7 @@
 #include <sys/wait.h>
 #include <syslog.h>
 #include <unistd.h>
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
 #include <valgrind/valgrind.h>
 #endif
 
@@ -945,7 +945,7 @@ int opinionated_personality(unsigned long *ret) {
 }
 
 void valgrind_summary_hack(void) {
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
         if (getpid_cached() == 1 && RUNNING_ON_VALGRIND) {
                 pid_t pid;
                 pid = raw_clone(SIGCHLD);
index 42f484d68794201ef97b13bb905db40f55c7e00a..146c8f55ed14dafc781000818e812ac5f703b9b8 100644 (file)
 #include <linux/random.h>
 #include <stdint.h>
 
-#ifdef HAVE_SYS_AUXV_H
+#if HAVE_SYS_AUXV_H
 #  include <sys/auxv.h>
 #endif
 
-#ifdef USE_SYS_RANDOM_H
+#if USE_SYS_RANDOM_H
 #  include <sys/random.h>
 #else
 #  include <linux/random.h>
@@ -100,14 +100,14 @@ int acquire_random_bytes(void *p, size_t n, bool high_quality_required) {
 void initialize_srand(void) {
         static bool srand_called = false;
         unsigned x;
-#ifdef HAVE_SYS_AUXV_H
+#if HAVE_SYS_AUXV_H
         void *auxv;
 #endif
 
         if (srand_called)
                 return;
 
-#ifdef HAVE_SYS_AUXV_H
+#if HAVE_SYS_AUXV_H
         /* The kernel provides us with 16 bytes of entropy in auxv, so let's
          * try to make use of that to seed the pseudo-random generator. It's
          * better than nothing... */
index 139e6e21e3e5f4012658cd2080db6b5df1732bbc..93bcdb216095b03b21ce36b9f8cd50cf68ad880d 100644 (file)
@@ -26,7 +26,7 @@
 #include <sys/un.h>
 #include <syslog.h>
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #include <selinux/context.h>
 #include <selinux/label.h>
 #include <selinux/selinux.h>
@@ -40,7 +40,7 @@
 #include "time-util.h"
 #include "util.h"
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 DEFINE_TRIVIAL_CLEANUP_FUNC(char*, freecon);
 DEFINE_TRIVIAL_CLEANUP_FUNC(context_t, context_free);
 
@@ -54,7 +54,7 @@ static struct selabel_handle *label_hnd = NULL;
 #endif
 
 bool mac_selinux_use(void) {
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (cached_use < 0)
                 cached_use = is_selinux_enabled() > 0;
 
@@ -65,7 +65,7 @@ bool mac_selinux_use(void) {
 }
 
 void mac_selinux_retest(void) {
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         cached_use = -1;
 #endif
 }
@@ -73,7 +73,7 @@ void mac_selinux_retest(void) {
 int mac_selinux_init(void) {
         int r = 0;
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         usec_t before_timestamp, after_timestamp;
         struct mallinfo before_mallinfo, after_mallinfo;
 
@@ -110,7 +110,7 @@ int mac_selinux_init(void) {
 
 void mac_selinux_finish(void) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (!label_hnd)
                 return;
 
@@ -121,7 +121,7 @@ void mac_selinux_finish(void) {
 
 int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         struct stat st;
         int r;
 
@@ -169,7 +169,7 @@ int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
 
 int mac_selinux_apply(const char *path, const char *label) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (!mac_selinux_use())
                 return 0;
 
@@ -188,7 +188,7 @@ int mac_selinux_apply(const char *path, const char *label) {
 int mac_selinux_get_create_label_from_exe(const char *exe, char **label) {
         int r = -EOPNOTSUPP;
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         _cleanup_freecon_ char *mycon = NULL, *fcon = NULL;
         security_class_t sclass;
 
@@ -220,7 +220,7 @@ int mac_selinux_get_our_label(char **label) {
 
         assert(label);
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (!mac_selinux_use())
                 return -EOPNOTSUPP;
 
@@ -235,7 +235,7 @@ int mac_selinux_get_our_label(char **label) {
 int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label) {
         int r = -EOPNOTSUPP;
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         _cleanup_freecon_ char *mycon = NULL, *peercon = NULL, *fcon = NULL;
         _cleanup_context_free_ context_t pcon = NULL, bcon = NULL;
         security_class_t sclass;
@@ -296,7 +296,7 @@ int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *
 
 char* mac_selinux_free(char *label) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (!label)
                 return NULL;
 
@@ -312,7 +312,7 @@ char* mac_selinux_free(char *label) {
 
 int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         _cleanup_freecon_ char *filecon = NULL;
         int r;
 
@@ -355,7 +355,7 @@ int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
 
 void mac_selinux_create_file_clear(void) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         PROTECT_ERRNO;
 
         if (!mac_selinux_use())
@@ -367,7 +367,7 @@ void mac_selinux_create_file_clear(void) {
 
 int mac_selinux_create_socket_prepare(const char *label) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (!mac_selinux_use())
                 return 0;
 
@@ -386,7 +386,7 @@ int mac_selinux_create_socket_prepare(const char *label) {
 
 void mac_selinux_create_socket_clear(void) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         PROTECT_ERRNO;
 
         if (!mac_selinux_use())
@@ -400,7 +400,7 @@ int mac_selinux_bind(int fd, const struct sockaddr *addr, socklen_t addrlen) {
 
         /* Binds a socket and label its file system object according to the SELinux policy */
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         _cleanup_freecon_ char *fcon = NULL;
         const struct sockaddr_un *un;
         bool context_changed = false;
index 3a3df987df11592938b6f0c32ced6a4d69b9127c..e80327c2001c137085c87b2df1402d09054aed3e 100644 (file)
@@ -35,7 +35,7 @@
 #include "string-table.h"
 #include "xattr-util.h"
 
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
 bool mac_smack_use(void) {
         static int cached_use = -1;
 
index e8d39674cc50fdca99a1b777b420429a50849db9..6af027e02d3618bf929c374ef3a305685986a4c7 100644 (file)
@@ -48,7 +48,7 @@
 #include "utf8.h"
 #include "util.h"
 
-#ifdef ENABLE_IDN
+#if ENABLE_IDN
 #  define IDN_FLAGS (NI_IDN|NI_IDN_USE_STD3_ASCII_RULES)
 #else
 #  define IDN_FLAGS 0
index 21898837e0e4c849a4bde9ac8b631b47065c2927..12176f1fe0c5911e4c56e64e8f7fbeeda646be72 100644 (file)
@@ -1650,7 +1650,7 @@ static EFI_STATUS image_start(EFI_HANDLE parent_image, const Config *config, con
                 loaded_image->LoadOptions = options;
                 loaded_image->LoadOptionsSize = (StrLen(loaded_image->LoadOptions)+1) * sizeof(CHAR16);
 
-#ifdef ENABLE_TPM
+#if ENABLE_TPM
                 /* Try to log any options to the TPM, especially to catch manually edited options */
                 err = tpm_log_event(SD_TPM_PCR,
                                     (EFI_PHYSICAL_ADDRESS) loaded_image->LoadOptions,
index 8627c0907703a1df0f0d499cdbe0a7a38d82a40c..324d1c8b9e0c8853ab263abec873a73952dd85f4 100644 (file)
@@ -11,7 +11,7 @@
  *
  */
 
-#ifdef ENABLE_TPM
+#if ENABLE_TPM
 
 #include <efi.h>
 #include <efilib.h>
index b111aad8521aee19cdf551144084e593fcf30102..eb0be02977c21d3a99266ce4bc98560346109fc9 100644 (file)
@@ -30,7 +30,7 @@ stub_sources = '''
         stub.c
 '''.split()
 
-if conf.get('ENABLE_EFI', false) and get_option('gnu-efi') != 'false'
+if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
         efi_cc = get_option('efi-cc')
         efi_ld = get_option('efi-ld')
 
@@ -64,7 +64,7 @@ if have_gnu_efi
         efi_conf = configuration_data()
         efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
         efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
-        efi_conf.set('ENABLE_TPM', get_option('tpm'))
+        efi_conf.set10('ENABLE_TPM', get_option('tpm'))
         efi_conf.set('SD_TPM_PCR', get_option('tpm-pcrindex'))
 
         efi_config_h = configure_file(
index 7d03370cbd26806ea78f8bd6bc2bbe23ca2021ae..e85ebf2c3f286832367a9ca82b2e60ff86b74c6a 100644 (file)
@@ -87,7 +87,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
                         line[i] = options[i];
                 cmdline = line;
 
-#ifdef ENABLE_TPM
+#if ENABLE_TPM
                 /* Try to log any options to the TPM, especially manually edited options */
                 err = tpm_log_event(SD_TPM_PCR,
                                     (EFI_PHYSICAL_ADDRESS) loaded_image->LoadOptions,
index bc421a434305b524c18f3244eddc5dcbe039303d..6207f8185e739fd768325f48ef6ed5d54487077c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "audit-fd.h"
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
 
 #include <libaudit.h>
 #include <stdbool.h>
index 1a388f559218623ac64fa323254b6308293ab7b0..e0aa9fdd825fdb2c4cbf7ecbc748713dd69a19ff 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <sys/prctl.h>
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include <seccomp.h>
 #endif
 
@@ -42,7 +42,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "rlimit-util.h"
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
 #include "securebits-util.h"
@@ -376,7 +376,7 @@ static int property_get_syscall_filter(
         _cleanup_strv_free_ char **l = NULL;
         int r;
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         Iterator i;
         void *id;
 #endif
@@ -393,7 +393,7 @@ static int property_get_syscall_filter(
         if (r < 0)
                 return r;
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         SET_FOREACH(id, c->syscall_filter, i) {
                 char *name;
 
@@ -429,7 +429,7 @@ static int property_get_syscall_archs(
         _cleanup_strv_free_ char **l = NULL;
         int r;
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         Iterator i;
         void *id;
 #endif
@@ -438,7 +438,7 @@ static int property_get_syscall_archs(
         assert(reply);
         assert(c);
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         SET_FOREACH(id, c->syscall_archs, i) {
                 const char *name;
 
@@ -1185,7 +1185,7 @@ int bus_exec_context_set_transient_property(
 
                 return 1;
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 
         } else if (streq(name, "SystemCallFilter")) {
                 int whitelist;
index 6d3f71419242172f0e94018f6b7aa2dc5a81332e..210b344cd3d7153ef584cc7a376a8b7f479daf7d 100644 (file)
@@ -211,7 +211,7 @@ failed:
         return 0;
 }
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 static int mac_selinux_filter(sd_bus_message *message, void *userdata, sd_bus_error *error) {
         Manager *m = userdata;
         const char *verb, *path;
@@ -535,7 +535,7 @@ static int bus_setup_api_vtables(Manager *m, sd_bus *bus) {
         assert(m);
         assert(bus);
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         r = sd_bus_add_filter(bus, NULL, mac_selinux_filter, m);
         if (r < 0)
                 return log_error_errno(r, "Failed to add SELinux access filter: %m");
index e1c2a57cc62842a7589d71875af5b6e8789fdacd..2271a2876a2e19a46506731a2cdd85b8a57d485d 100644 (file)
 #include <unistd.h>
 #include <utmpx.h>
 
-#ifdef HAVE_PAM
+#if HAVE_PAM
 #include <security/pam_appl.h>
 #endif
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include <seccomp.h>
 #endif
 
-#ifdef HAVE_APPARMOR
+#if HAVE_APPARMOR
 #include <sys/apparmor.h>
 #endif
 
@@ -57,7 +57,7 @@
 
 #include "af-list.h"
 #include "alloc-util.h"
-#ifdef HAVE_APPARMOR
+#if HAVE_APPARMOR
 #include "apparmor-util.h"
 #endif
 #include "async.h"
@@ -88,7 +88,7 @@
 #include "process-util.h"
 #include "rlimit-util.h"
 #include "rm-rf.h"
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
 #include "securebits.h"
@@ -1019,7 +1019,7 @@ static int enforce_user(const ExecContext *context, uid_t uid) {
         return 0;
 }
 
-#ifdef HAVE_PAM
+#if HAVE_PAM
 
 static int null_conv(
                 int num_msg,
@@ -1043,7 +1043,7 @@ static int setup_pam(
                 char ***env,
                 int fds[], unsigned n_fds) {
 
-#ifdef HAVE_PAM
+#if HAVE_PAM
 
         static const struct pam_conv conv = {
                 .conv = null_conv,
@@ -1318,7 +1318,7 @@ static bool context_has_no_new_privileges(const ExecContext *c) {
                 c->lock_personality;
 }
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 
 static bool skip_seccomp_unavailable(const Unit* u, const char* msg) {
 
@@ -2688,13 +2688,13 @@ static int exec_child(
                 needs_setuid,           /* Do we need to do the actual setresuid()/setresgid() calls? */
                 needs_mount_namespace,  /* Do we need to set up a mount namespace for this kernel? */
                 needs_ambient_hack;     /* Do we need to apply the ambient capabilities hack? */
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         bool use_selinux = false;
 #endif
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
         bool use_smack = false;
 #endif
-#ifdef HAVE_APPARMOR
+#if HAVE_APPARMOR
         bool use_apparmor = false;
 #endif
         uid_t uid = UID_INVALID;
@@ -3048,13 +3048,13 @@ static int exec_child(
                  * present. The actual MAC context application will happen later, as late as possible, to avoid
                  * impacting our own code paths. */
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
                 use_selinux = mac_selinux_use();
 #endif
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
                 use_smack = mac_smack_use();
 #endif
-#ifdef HAVE_APPARMOR
+#if HAVE_APPARMOR
                 use_apparmor = mac_apparmor_use();
 #endif
         }
@@ -3101,7 +3101,7 @@ static int exec_child(
         }
 
         if (needs_sandboxing) {
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
                 if (use_selinux && params->selinux_context_net && socket_fd >= 0) {
                         r = mac_selinux_get_child_mls_label(socket_fd, command->path, context->selinux_context, &mac_selinux_context_net);
                         if (r < 0) {
@@ -3223,7 +3223,7 @@ static int exec_child(
                  * syscalls that are subject to seccomp filtering, hence should probably be applied before the syscalls
                  * are restricted. */
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
                 if (use_selinux) {
                         char *exec_context = mac_selinux_context_net ?: context->selinux_context;
 
@@ -3237,7 +3237,7 @@ static int exec_child(
                 }
 #endif
 
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
                 if (use_smack) {
                         r = setup_smack(context, command);
                         if (r < 0) {
@@ -3247,7 +3247,7 @@ static int exec_child(
                 }
 #endif
 
-#ifdef HAVE_APPARMOR
+#if HAVE_APPARMOR
                 if (use_apparmor && context->apparmor_profile) {
                         r = aa_change_onexec(context->apparmor_profile);
                         if (r < 0 && !context->apparmor_profile_ignore) {
@@ -3271,7 +3271,7 @@ static int exec_child(
                                 return log_unit_error_errno(unit, errno, "Failed to disable new privileges: %m");
                         }
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
                 r = apply_address_families(unit, context);
                 if (r < 0) {
                         *exit_status = EXIT_ADDRESS_FAMILIES;
@@ -4118,7 +4118,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
                 prefix, yes_no(c->lock_personality));
 
         if (c->syscall_filter) {
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
                 Iterator j;
                 void *id;
                 bool first = true;
@@ -4131,7 +4131,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
                 if (!c->syscall_whitelist)
                         fputc('~', f);
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
                 SET_FOREACH(id, c->syscall_filter, j) {
                         _cleanup_free_ char *name = NULL;
 
@@ -4149,7 +4149,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
         }
 
         if (c->syscall_archs) {
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
                 Iterator j;
                 void *id;
 #endif
@@ -4158,7 +4158,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
                         "%sSystemCallArchitectures:",
                         prefix);
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
                 SET_FOREACH(id, c->syscall_archs, j)
                         fprintf(f, " %s", strna(seccomp_arch_to_string(PTR_TO_UINT32(id) - 1)));
 #endif
index 7b5c98a57c93a2a8d5abf92e5dd0a0cac48e5485..1aaae9f49ea6b9ed05c5e88965a50fcd8cf83ad4 100644 (file)
@@ -33,7 +33,7 @@
 #define IMA_POLICY_PATH "/etc/ima/ima-policy"
 
 int ima_setup(void) {
-#ifdef HAVE_IMA
+#if HAVE_IMA
         _cleanup_fclose_ FILE *input = NULL;
         _cleanup_close_ int imafd = -1;
         unsigned lineno = 0;
index 30b42fffe5bdbf01abcb655aeb7c7bdd168ef094..066b959770e20611dac5b06b43b884bf83026dce 100644 (file)
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef HAVE_KMOD
+#if HAVE_KMOD
 #include <libkmod.h>
 #endif
 
@@ -33,7 +33,7 @@
 #include "macro.h"
 #include "string-util.h"
 
-#ifdef HAVE_KMOD
+#if HAVE_KMOD
 static void systemd_kmod_log(
                 void *data,
                 int priority,
@@ -85,7 +85,7 @@ static bool has_virtio_rng(void) {
 #endif
 
 int kmod_setup(void) {
-#ifdef HAVE_KMOD
+#if HAVE_KMOD
 
         static const struct {
                 const char *module;
@@ -103,7 +103,7 @@ int kmod_setup(void) {
                 /* this should never be a module */
                 { "unix",      "/proc/net/unix",            true,   true,    NULL      },
 
-#ifdef HAVE_LIBIPTC
+#if HAVE_LIBIPTC
                 /* netfilter is needed by networkd, nspawn among others, and cannot be autoloaded */
                 { "ip_tables", "/proc/net/ip_tables_names", false,  false,   NULL      },
 #endif
index 2c3783a9f0d1a6fa82894c8e0e180f9ba76ebc48..04170695c5dfb839d13962e7483266cbae1ec293 100644 (file)
@@ -22,7 +22,7 @@
 #include <fcntl.h>
 #include <linux/fs.h>
 #include <linux/oom.h>
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include <seccomp.h>
 #endif
 #include <sched.h>
@@ -54,7 +54,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "rlimit-util.h"
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
 #include "securebits.h"
@@ -1246,7 +1246,7 @@ int config_parse_limit(
         return 0;
 }
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
 int config_parse_sysv_priority(const char *unit,
                                const char *filename,
                                unsigned line,
@@ -2643,7 +2643,7 @@ int config_parse_documentation(const char *unit,
         return r;
 }
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 
 static int syscall_filter_parse_one(
                 const char *unit,
@@ -4504,7 +4504,7 @@ void unit_dump_config_items(FILE *f) {
                 const ConfigParserCallback callback;
                 const char *rvalue;
         } table[] = {
-#if !defined(HAVE_SYSV_COMPAT) || !defined(HAVE_SECCOMP) || !defined(HAVE_PAM) || !defined(HAVE_SELINUX) || !defined(HAVE_SMACK) || !defined(HAVE_APPARMOR)
+#if !HAVE_SYSV_COMPAT || !HAVE_SECCOMP || !HAVE_PAM || !HAVE_SELINUX || !HAVE_SMACK || !HAVE_APPARMOR
                 { config_parse_warn_compat,           "NOTSUPPORTED" },
 #endif
                 { config_parse_int,                   "INTEGER" },
@@ -4537,7 +4537,7 @@ void unit_dump_config_items(FILE *f) {
                 { config_parse_exec,                  "PATH [ARGUMENT [...]]" },
                 { config_parse_service_type,          "SERVICETYPE" },
                 { config_parse_service_restart,       "SERVICERESTART" },
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
                 { config_parse_sysv_priority,         "SYSVPRIORITY" },
 #endif
                 { config_parse_kill_mode,             "KILLMODE" },
@@ -4567,7 +4567,7 @@ void unit_dump_config_items(FILE *f) {
                 { config_parse_set_status,            "STATUS" },
                 { config_parse_service_sockets,       "SOCKETS" },
                 { config_parse_environ,               "ENVIRON" },
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
                 { config_parse_syscall_filter,        "SYSCALLS" },
                 { config_parse_syscall_archs,         "ARCHS" },
                 { config_parse_syscall_errno,         "ERRNO" },
@@ -4587,7 +4587,7 @@ void unit_dump_config_items(FILE *f) {
                 { config_parse_blockio_device_weight, "DEVICEWEIGHT" },
                 { config_parse_long,                  "LONG" },
                 { config_parse_socket_service,        "SERVICE" },
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
                 { config_parse_exec_selinux_context,  "LABEL" },
 #endif
                 { config_parse_job_mode,              "MODE" },
index 2dfd48005b75012e3a63ca09e59741bfe929093c..60863d2eed14e9d1ae1840716f79428f02169170 100644 (file)
 #include <sys/reboot.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include <seccomp.h>
 #endif
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
 #include <valgrind/valgrind.h>
 #endif
 
@@ -74,7 +74,7 @@
 #include "process-util.h"
 #include "raw-clone.h"
 #include "rlimit-util.h"
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
 #include "selinux-setup.h"
@@ -717,7 +717,7 @@ static int parse_config_file(void) {
                 { "Manager", "RuntimeWatchdogSec",        config_parse_sec,              0, &arg_runtime_watchdog                  },
                 { "Manager", "ShutdownWatchdogSec",       config_parse_sec,              0, &arg_shutdown_watchdog                 },
                 { "Manager", "CapabilityBoundingSet",     config_parse_capability_set,   0, &arg_capability_bounding_set           },
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
                 { "Manager", "SystemCallArchitectures",   config_parse_syscall_archs,    0, &arg_syscall_archs                     },
 #endif
                 { "Manager", "TimerSlackNSec",            config_parse_nsec,             0, &arg_timer_slack_nsec                  },
@@ -1264,7 +1264,7 @@ oom:
 }
 
 static int enforce_syscall_archs(Set *archs) {
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         int r;
 
         if (!is_seccomp_available())
@@ -1411,7 +1411,7 @@ int main(int argc, char *argv[]) {
         struct rlimit saved_rlimit_nofile = RLIMIT_MAKE_CONST(0), saved_rlimit_memlock = RLIMIT_MAKE_CONST((rlim_t) -1);
         const char *error_message = NULL;
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
         if (getpid_cached() != 1 && strstr(program_invocation_short_name, "init")) {
                 /* This is compatibility support for SysV, where
                  * calling init as a user is identical to telinit. */
@@ -2172,7 +2172,7 @@ finish:
         arg_serialization = safe_fclose(arg_serialization);
         fds = fdset_free(fds);
 
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
         /* If we are PID 1 and running under valgrind, then let's exit
          * here explicitly. valgrind will only generate nice output on
          * exit(), not on exec(), hence let's do the former not the
index 5c127e08484394ad58d8dd34225fbfdca96c36a6..a0d3c85ff18cbbcfa750329a62295c30ac4da4b6 100644 (file)
@@ -30,7 +30,7 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
 #include <libaudit.h>
 #endif
 
@@ -620,7 +620,7 @@ int manager_new(UnitFileScope scope, unsigned test_run_flags, Manager **_m) {
         m->default_timeout_stop_usec = DEFAULT_TIMEOUT_USEC;
         m->default_restart_usec = DEFAULT_RESTART_USEC;
 
-#ifdef ENABLE_EFI
+#if ENABLE_EFI
         if (MANAGER_IS_SYSTEM(m) && detect_container() <= 0)
                 boot_timestamps(&m->userspace_timestamp, &m->firmware_timestamp, &m->loader_timestamp);
 #endif
@@ -2457,7 +2457,7 @@ int manager_get_job_from_dbus_path(Manager *m, const char *s, Job **_j) {
 
 void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success) {
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         _cleanup_free_ char *p = NULL;
         const char *msg;
         int audit_fd, r;
index b343bb7e099eeec02a881217dddad522d87a8659..676c82dcc9a159d3059a59147d093dc49ac98354 100644 (file)
@@ -64,7 +64,7 @@ typedef struct MountPoint {
  * fourth (securityfs) is needed by IMA to load a custom policy. The
  * other ones we can delay until SELinux and IMA are loaded. When
  * SMACK is enabled we need smackfs, too, so it's a fifth one. */
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
 #define N_EARLY_MOUNT 5
 #else
 #define N_EARLY_MOUNT 4
@@ -79,7 +79,7 @@ static const MountPoint mount_table[] = {
           NULL,          MNT_FATAL|MNT_IN_CONTAINER },
         { "securityfs",  "/sys/kernel/security",      "securityfs", NULL,                      MS_NOSUID|MS_NOEXEC|MS_NODEV,
           NULL,          MNT_NONE                   },
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
         { "smackfs",     "/sys/fs/smackfs",           "smackfs",    "smackfsdef=*",            MS_NOSUID|MS_NOEXEC|MS_NODEV,
           mac_smack_use, MNT_FATAL                  },
         { "tmpfs",       "/dev/shm",                  "tmpfs",      "mode=1777,smackfsroot=*", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
@@ -89,7 +89,7 @@ static const MountPoint mount_table[] = {
           NULL,          MNT_FATAL|MNT_IN_CONTAINER },
         { "devpts",      "/dev/pts",                  "devpts",     "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,
           NULL,          MNT_IN_CONTAINER           },
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
         { "tmpfs",       "/run",                      "tmpfs",      "mode=755,smackfsroot=*",  MS_NOSUID|MS_NODEV|MS_STRICTATIME,
           mac_smack_use, MNT_FATAL                  },
 #endif
@@ -111,7 +111,7 @@ static const MountPoint mount_table[] = {
           cg_is_legacy_wanted, MNT_FATAL|MNT_IN_CONTAINER },
         { "pstore",      "/sys/fs/pstore",            "pstore",     NULL,                      MS_NOSUID|MS_NOEXEC|MS_NODEV,
           NULL,          MNT_NONE                   },
-#ifdef ENABLE_EFI
+#if ENABLE_EFI
         { "efivarfs",    "/sys/firmware/efi/efivars", "efivarfs",   NULL,                      MS_NOSUID|MS_NOEXEC|MS_NODEV,
           is_efi_boot,   MNT_NONE                   },
 #endif
@@ -336,7 +336,7 @@ int mount_cgroup_controllers(char ***join_controllers) {
         return 0;
 }
 
-#if defined(HAVE_SELINUX) || defined(HAVE_SMACK)
+#if HAVE_SELINUX || HAVE_SMACK
 static int nftw_cb(
                 const char *fpath,
                 const struct stat *sb,
@@ -367,7 +367,7 @@ int mount_setup(bool loaded_policy) {
         if (r < 0)
                 return r;
 
-#if defined(HAVE_SELINUX) || defined(HAVE_SMACK)
+#if HAVE_SELINUX || HAVE_SMACK
         /* Nodes in devtmpfs and /run need to be manually updated for
          * the appropriate labels, after mounting. The other virtual
          * API file systems like /sys and /proc do not need that, they
index 932fbe5c54c23f87fe40f296657ae0b0cf737c9d..6d74b8da674e9a3f01af6b95791efc4d56d9a0b5 100644 (file)
@@ -107,7 +107,7 @@ static const MountEntry protect_kernel_tunables_table[] = {
 
 /* ProtectKernelModules= option */
 static const MountEntry protect_kernel_modules_table[] = {
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
         { "/lib/modules",        INACCESSIBLE, true  },
 #endif
         { "/usr/lib/modules",    INACCESSIBLE, true  },
index 0f8a2d68e29e6de27a4559e915a27ea98cb4e06d..2db418940157cb05d735c39c617120b4ba3093d4 100644 (file)
 
 #include "selinux-access.h"
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 
 #include <errno.h>
 #include <selinux/avc.h>
 #include <selinux/selinux.h>
 #include <stdio.h>
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
 #include <libaudit.h>
 #endif
 
@@ -112,7 +112,7 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) {
         va_list ap;
         const char *fmt2;
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         int fd;
 
         fd = get_audit_fd();
index f46370d0204fea5da006adecea391993f2de67e1..1f6a518a61bf3c4c89e1d651365c373871698b0a 100644 (file)
@@ -26,7 +26,7 @@
 
 int mac_selinux_generic_access_check(sd_bus_message *message, const char *path, const char *permission, sd_bus_error *error);
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 
 #define mac_selinux_access_check(message, permission, error) \
         mac_selinux_generic_access_check((message), NULL, (permission), (error))
index 527aa8add0f0a3124de6dacd279b087181767019..60361a563850d747e486db137e24064f66c5bfb4 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
 
@@ -32,7 +32,7 @@
 #include "string-util.h"
 #include "util.h"
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 _printf_(2,3)
 static int null_log(int type, const char *fmt, ...) {
         return 0;
@@ -41,7 +41,7 @@ static int null_log(int type, const char *fmt, ...) {
 
 int mac_selinux_setup(bool *loaded_policy) {
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         int enforce = 0;
         usec_t before_load, after_load;
         char *con;
index 9f253643351f24d10898ee0fda5de5e6b5375930..be32c434235bc58e4a0a3163d8aa0912a8fefbd9 100644 (file)
@@ -36,7 +36,7 @@
 #include "string-util.h"
 #include "util.h"
 
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
 
 static int write_access2_rules(const char* srcdir) {
         _cleanup_close_ int load2_fd = -1, change_fd = -1;
@@ -316,7 +316,7 @@ static int write_onlycap_list(void) {
 
 int mac_smack_setup(bool *loaded_policy) {
 
-#ifdef HAVE_SMACK
+#if HAVE_SMACK
 
         int r;
 
index 7e9ea2038816cdd3b71ba6964e86ea95ea5d1862..813d2571392965382347b3d534a5f5c08574de95 100644 (file)
@@ -375,7 +375,7 @@ static int delete_dm(dev_t devnum) {
 
 static bool nonunmountable_path(const char *path) {
         return path_equal(path, "/")
-#ifndef HAVE_SPLIT_USR
+#if ! HAVE_SPLIT_USR
                 || path_equal(path, "/usr")
 #endif
                 || path_startswith(path, "/run/initramfs");
index 96a4d400f89677779d7fd3fac16cf294e2191eaf..300d6479039d77197a13269eed8bea215b35f581 100644 (file)
@@ -23,7 +23,7 @@
 #include <sys/xattr.h>
 #include <unistd.h>
 
-#ifdef HAVE_ELFUTILS
+#if HAVE_ELFUTILS
 #include <dwarf.h>
 #include <elfutils/libdwfl.h>
 #endif
@@ -156,7 +156,7 @@ static inline uint64_t storage_size_max(void) {
 
 static int fix_acl(int fd, uid_t uid) {
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
         _cleanup_(acl_freep) acl_t acl = NULL;
         acl_entry_t entry;
         acl_permset_t permset;
@@ -393,7 +393,7 @@ static int save_external_coredump(
                 goto fail;
         }
 
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
         /* If we will remove the coredump anyway, do not compress. */
         if (arg_compress && !maybe_remove_external_coredump(NULL, st.st_size)) {
 
@@ -765,7 +765,7 @@ static int submit_coredump(
         if (r < 0)
                 return log_error_errno(r, "Failed to drop privileges: %m");
 
-#ifdef HAVE_ELFUTILS
+#if HAVE_ELFUTILS
         /* Try to get a strack trace if we can */
         if (coredump_size <= arg_process_size_max) {
                 _cleanup_free_ char *stacktrace = NULL;
index 114a13fc78c870029ac28c2c80417c72be6421f1..0380df10d1be5206c2f0fa3867402ef736764a7b 100644 (file)
@@ -799,7 +799,7 @@ static int save_core(sd_journal *j, FILE *file, char **path, bool *unlink_temp)
         }
 
         if (filename) {
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
                 _cleanup_close_ int fdf;
 
                 fdf = open(filename, O_RDONLY | O_CLOEXEC);
index 8f7d898b6244902b0a1c9bccab4884a1d735d9d7..25a040904675b283438724ee06eba17585d4e93d 100644 (file)
@@ -4,7 +4,7 @@ systemd_coredump_sources = files('''
         coredump-vacuum.h
 '''.split())
 
-if conf.get('HAVE_ELFUTILS', false)
+if conf.get('HAVE_ELFUTILS') == 1
         systemd_coredump_sources += files(['stacktrace.c',
                                            'stacktrace.h'])
 endif
index b0689ffff77f38663043a0f654f00373126a5a02..605bea57bbe6dbc524e5e3f5feefe4aecc37448d 100644 (file)
@@ -49,7 +49,7 @@ static const char prefixes[] =
         "/usr/local/share\0"
         "/usr/lib\0"
         "/usr/share\0"
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
         "/lib\0"
 #endif
         ;
@@ -392,7 +392,7 @@ static int enumerate_dir(
 }
 
 static int should_skip_prefix(const char* p) {
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
         int r;
         _cleanup_free_ char *target = NULL;
 
index 434321f806aaf733ea675085dfe5f7ebf50d1deb..cd39161f10f0a99f868a60d8a10eb970e2e699b9 100644 (file)
@@ -131,7 +131,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
                 }
         }
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
         else if (streq(key, "fastboot") && !value) {
                 log_warning("Please pass 'fsck.mode=skip' rather than 'fastboot' on the kernel command line.");
                 arg_skip = true;
@@ -147,7 +147,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
 
 static void test_files(void) {
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
         if (access("/fastboot", F_OK) >= 0) {
                 log_error("Please pass 'fsck.mode=skip' on the kernel command line rather than creating /fastboot on the root file system.");
                 arg_skip = true;
index bf28af0a6f9863b77f8995c5e785b1fed8222c69..ae0a8da63a9c033f35d7b4e16b0706b6e574ece0 100644 (file)
@@ -323,7 +323,7 @@ static int add_swap(const char *path) {
         return generator_add_symlink(arg_dest, SPECIAL_SWAP_TARGET, "wants", name);
 }
 
-#ifdef ENABLE_EFI
+#if ENABLE_EFI
 static int add_automount(
                 const char *id,
                 const char *what,
@@ -612,7 +612,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
         return 0;
 }
 
-#ifdef ENABLE_EFI
+#if ENABLE_EFI
 static int add_root_cryptsetup(void) {
 
         /* If a device /dev/gpt-auto-root-luks appears, then make it pull in systemd-cryptsetup-root.service, which
@@ -624,7 +624,7 @@ static int add_root_cryptsetup(void) {
 
 static int add_root_mount(void) {
 
-#ifdef ENABLE_EFI
+#if ENABLE_EFI
         int r;
 
         if (!is_efi_boot()) {
index d58caa678775b937641f36491bcf72663eb522e3..834300ae6e1ffe9aef11b3391d51fde772a43b60 100644 (file)
@@ -1,4 +1,4 @@
-if conf.get('ENABLE_HOSTNAMED', false)
+if conf.get('ENABLE_HOSTNAMED') == 1
         install_data('org.freedesktop.hostname1.conf',
                      install_dir : dbuspolicydir)
         install_data('org.freedesktop.hostname1.service',
index 3fd58cc2c8f537910702fd7e49ac99cd90d85240..e3a0da65d2117afb0835fb850253a5ce4d92d3f7 100644 (file)
@@ -48,7 +48,7 @@ systemd_export_sources = files('''
         import-compress.h
 '''.split())
 
-if conf.get('ENABLE_IMPORTD', false)
+if conf.get('ENABLE_IMPORTD') == 1
         install_data('org.freedesktop.import1.conf',
                      install_dir : dbuspolicydir)
         install_data('org.freedesktop.import1.service',
index 63261bfa6c5c4b222cc779740f96511448604bbf..a0f1f3e926b3b83c6b0065108e1df32c80156d49 100644 (file)
@@ -946,7 +946,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_TRUST:
-#ifdef HAVE_GNUTLS
+#if HAVE_GNUTLS
                         if (arg_trust_pem) {
                                 log_error("CA certificate file specified twice");
                                 return -EINVAL;
index 64b1105901aed2f405a949a1dc77abc8616b8445..9f51137645bde05dbabf9e8d0303f6be397941c6 100644 (file)
@@ -1384,7 +1384,7 @@ static int parse_argv(int argc, char *argv[]) {
                         if (streq(optarg, "all"))
                                 arg_trust_all = true;
                         else {
-#ifdef HAVE_GNUTLS
+#if HAVE_GNUTLS
                                 arg_trust = strdup(optarg);
                                 if (!arg_trust)
                                         return log_oom();
@@ -1442,7 +1442,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_GNUTLS_LOG: {
-#ifdef HAVE_GNUTLS
+#if HAVE_GNUTLS
                         const char* p = optarg;
                         for (;;) {
                                 _cleanup_free_ char *word = NULL;
index d266b34e659ebad6eafe4ff635506ee545e8f445..ed963d79307270c1959524bc8de8c843be9e5a87 100644 (file)
@@ -21,7 +21,7 @@ systemd_journal_gatewayd_sources = files('''
         microhttpd-util.c
 '''.split())
 
-if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
+if conf.get('ENABLE_REMOTE') ==1 and conf.get('HAVE_LIBCURL') == 1
         journal_upload_conf = configure_file(
                 input : 'journal-upload.conf.in',
                 output : 'journal-upload.conf',
@@ -30,7 +30,7 @@ if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
                      install_dir : pkgsysconfdir)
 endif
 
-if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
+if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
         journal_remote_conf = configure_file(
                 input : 'journal-remote.conf.in',
                 output : 'journal-remote.conf',
index f5d2d7967acf5f1f1c0f1ed393ea022ebda86e26..75c14ec9967913c2691bb97721d6c4160cb37b18 100644 (file)
@@ -22,7 +22,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#ifdef HAVE_GNUTLS
+#if HAVE_GNUTLS
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 #endif
@@ -115,7 +115,7 @@ int mhd_respondf(struct MHD_Connection *connection,
         return mhd_respond_internal(connection, code, m, r, MHD_RESPMEM_MUST_FREE);
 }
 
-#ifdef HAVE_GNUTLS
+#if HAVE_GNUTLS
 
 static struct {
         const char *const names[4];
index 71e8790ca82004b873eec9f0cad4b59629f0e27d..373d3455aeb457ec8b59f71a7ac3d4d11877a6be 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <stdio.h>
 #include <linux/audit.h>
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
 #  include <libaudit.h>
 #endif
 
index 818a720ba888ef85c2193629889eb1ee6fa461a2..3124d1210eaba4bd917aa3e9143ef3197b8a3987 100644 (file)
 #include <sys/mman.h>
 #include <unistd.h>
 
-#ifdef HAVE_XZ
+#if HAVE_XZ
 #include <lzma.h>
 #endif
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
 #include <lz4.h>
 #include <lz4frame.h>
 #endif
@@ -43,7 +43,7 @@
 #include "string-util.h"
 #include "util.h"
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
 DEFINE_TRIVIAL_CLEANUP_FUNC(LZ4F_compressionContext_t, LZ4F_freeCompressionContext);
 DEFINE_TRIVIAL_CLEANUP_FUNC(LZ4F_decompressionContext_t, LZ4F_freeDecompressionContext);
 #endif
@@ -59,7 +59,7 @@ DEFINE_STRING_TABLE_LOOKUP(object_compressed, int);
 
 int compress_blob_xz(const void *src, uint64_t src_size,
                      void *dst, size_t dst_alloc_size, size_t *dst_size) {
-#ifdef HAVE_XZ
+#if HAVE_XZ
         static const lzma_options_lzma opt = {
                 1u << 20u, NULL, 0, LZMA_LC_DEFAULT, LZMA_LP_DEFAULT,
                 LZMA_PB_DEFAULT, LZMA_MODE_FAST, 128, LZMA_MF_HC3, 4
@@ -97,7 +97,7 @@ int compress_blob_xz(const void *src, uint64_t src_size,
 
 int compress_blob_lz4(const void *src, uint64_t src_size,
                       void *dst, size_t dst_alloc_size, size_t *dst_size) {
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
         int r;
 
         assert(src);
@@ -133,7 +133,7 @@ int compress_blob_lz4(const void *src, uint64_t src_size,
 int decompress_blob_xz(const void *src, uint64_t src_size,
                        void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max) {
 
-#ifdef HAVE_XZ
+#if HAVE_XZ
         _cleanup_(lzma_end) lzma_stream s = LZMA_STREAM_INIT;
         lzma_ret ret;
         size_t space;
@@ -193,7 +193,7 @@ int decompress_blob_xz(const void *src, uint64_t src_size,
 int decompress_blob_lz4(const void *src, uint64_t src_size,
                         void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max) {
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
         char* out;
         int r, size; /* LZ4 uses int for size */
 
@@ -249,7 +249,7 @@ int decompress_startswith_xz(const void *src, uint64_t src_size,
                              const void *prefix, size_t prefix_len,
                              uint8_t extra) {
 
-#ifdef HAVE_XZ
+#if HAVE_XZ
         _cleanup_(lzma_end) lzma_stream s = LZMA_STREAM_INIT;
         lzma_ret ret;
 
@@ -307,7 +307,7 @@ int decompress_startswith_lz4(const void *src, uint64_t src_size,
                               void **buffer, size_t *buffer_size,
                               const void *prefix, size_t prefix_len,
                               uint8_t extra) {
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
         /* Checks whether the decompressed blob starts with the
          * mentioned prefix. The byte extra needs to follow the
          * prefix */
@@ -372,7 +372,7 @@ int decompress_startswith(int compression,
 }
 
 int compress_stream_xz(int fdf, int fdt, uint64_t max_bytes) {
-#ifdef HAVE_XZ
+#if HAVE_XZ
         _cleanup_(lzma_end) lzma_stream s = LZMA_STREAM_INIT;
         lzma_ret ret;
         uint8_t buf[BUFSIZ], out[BUFSIZ];
@@ -449,7 +449,7 @@ int compress_stream_xz(int fdf, int fdt, uint64_t max_bytes) {
 
 int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes) {
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
         LZ4F_errorCode_t c;
         _cleanup_(LZ4F_freeCompressionContextp) LZ4F_compressionContext_t ctx = NULL;
         _cleanup_free_ char *buf = NULL;
@@ -542,7 +542,7 @@ int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes) {
 
 int decompress_stream_xz(int fdf, int fdt, uint64_t max_bytes) {
 
-#ifdef HAVE_XZ
+#if HAVE_XZ
         _cleanup_(lzma_end) lzma_stream s = LZMA_STREAM_INIT;
         lzma_ret ret;
 
@@ -616,7 +616,7 @@ int decompress_stream_xz(int fdf, int fdt, uint64_t max_bytes) {
 }
 
 int decompress_stream_lz4(int in, int out, uint64_t max_bytes) {
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
         size_t c;
         _cleanup_(LZ4F_freeDecompressionContextp) LZ4F_decompressionContext_t ctx = NULL;
         _cleanup_free_ char *buf = NULL;
index c138099d9a84dee4f15f1777a925e2266054fab1..fb71662a993c377dd37b12aba4273f20d81baa4d 100644 (file)
@@ -34,7 +34,7 @@ int compress_blob_lz4(const void *src, uint64_t src_size,
 static inline int compress_blob(const void *src, uint64_t src_size,
                                 void *dst, size_t dst_alloc_size, size_t *dst_size) {
         int r;
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
         r = compress_blob_lz4(src, src_size, dst, dst_alloc_size, dst_size);
         if (r == 0)
                 return OBJECT_COMPRESSED_LZ4;
@@ -74,7 +74,7 @@ int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes);
 int decompress_stream_xz(int fdf, int fdt, uint64_t max_size);
 int decompress_stream_lz4(int fdf, int fdt, uint64_t max_size);
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
 #  define compress_stream compress_stream_lz4
 #  define COMPRESSED_EXT ".lz4"
 #else
index 67edb4396000bb1a847d06d6d56bb555bdeabb04..1bd5de4c4308d8158c7c0087c258bef2a137c03d 100644 (file)
@@ -162,11 +162,11 @@ enum {
 
 #define HEADER_INCOMPATIBLE_ANY (HEADER_INCOMPATIBLE_COMPRESSED_XZ|HEADER_INCOMPATIBLE_COMPRESSED_LZ4)
 
-#if defined(HAVE_XZ) && defined(HAVE_LZ4)
+#if HAVE_XZ && HAVE_LZ4
 #  define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_ANY
-#elif defined(HAVE_XZ)
+#elif HAVE_XZ
 #  define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_COMPRESSED_XZ
-#elif defined(HAVE_LZ4)
+#elif HAVE_LZ4
 #  define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_COMPRESSED_LZ4
 #else
 #  define HEADER_INCOMPATIBLE_SUPPORTED 0
@@ -177,7 +177,7 @@ enum {
 };
 
 #define HEADER_COMPATIBLE_ANY HEADER_COMPATIBLE_SEALED
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 #  define HEADER_COMPATIBLE_SUPPORTED HEADER_COMPATIBLE_SEALED
 #else
 #  define HEADER_COMPATIBLE_SUPPORTED 0
index ec66f4d5a4f8cf2ed6c2cc18d608491649c010c6..3027801ab139e60adc663dd85be65c4da21bdfc9 100644 (file)
@@ -331,7 +331,7 @@ bool journal_file_is_offlining(JournalFile *f) {
 JournalFile* journal_file_close(JournalFile *f) {
         assert(f);
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         /* Write the final tag */
         if (f->seal && f->writable) {
                 int r;
@@ -378,11 +378,11 @@ JournalFile* journal_file_close(JournalFile *f) {
 
         ordered_hashmap_free_free(f->chain_cache);
 
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
         free(f->compress_buffer);
 #endif
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         if (f->fss_file)
                 munmap(f->fss_file, PAGE_ALIGN(f->fss_file_size));
         else
@@ -1401,7 +1401,7 @@ int journal_file_find_data_object_with_hash(
                         goto next;
 
                 if (o->object.flags & OBJECT_COMPRESSION_MASK) {
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
                         uint64_t l;
                         size_t rsize = 0;
 
@@ -1513,7 +1513,7 @@ static int journal_file_append_field(
         if (r < 0)
                 return r;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         r = journal_file_hmac_put_object(f, OBJECT_FIELD, o, p);
         if (r < 0)
                 return r;
@@ -1565,7 +1565,7 @@ static int journal_file_append_data(
 
         o->data.hash = htole64(hash);
 
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
         if (JOURNAL_FILE_COMPRESS(f) && size >= COMPRESSION_SIZE_THRESHOLD) {
                 size_t rsize = 0;
 
@@ -1590,7 +1590,7 @@ static int journal_file_append_data(
         if (r < 0)
                 return r;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         r = journal_file_hmac_put_object(f, OBJECT_DATA, o, p);
         if (r < 0)
                 return r;
@@ -1704,7 +1704,7 @@ static int link_entry_into_array(JournalFile *f,
         if (r < 0)
                 return r;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         r = journal_file_hmac_put_object(f, OBJECT_ENTRY_ARRAY, o, q);
         if (r < 0)
                 return r;
@@ -1854,7 +1854,7 @@ static int journal_file_append_entry_internal(
         o->entry.xor_hash = htole64(xor_hash);
         o->entry.boot_id = f->header->boot_id;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         r = journal_file_hmac_put_object(f, OBJECT_ENTRY, o, np);
         if (r < 0)
                 return r;
@@ -1990,7 +1990,7 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st
                 ts = &_ts;
         }
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         r = journal_file_maybe_append_tag(f, ts->realtime);
         if (r < 0)
                 return r;
@@ -3259,12 +3259,12 @@ int journal_file_open(
         f->flags = flags;
         f->prot = prot_from_flags(flags);
         f->writable = (flags & O_ACCMODE) != O_RDONLY;
-#if defined(HAVE_LZ4)
+#if HAVE_LZ4
         f->compress_lz4 = compress;
-#elif defined(HAVE_XZ)
+#elif HAVE_XZ
         f->compress_xz = compress;
 #endif
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         f->seal = seal;
 #endif
 
@@ -3335,7 +3335,7 @@ int journal_file_open(
 
                 fd_setcrtime(f->fd, 0);
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                 /* Try to load the FSPRG state, and if we can't, then
                  * just don't do sealing */
                 if (f->seal) {
@@ -3376,7 +3376,7 @@ int journal_file_open(
                         goto fail;
         }
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         if (!newly_created && f->writable) {
                 r = journal_file_fss_load(f);
                 if (r < 0)
@@ -3396,7 +3396,7 @@ int journal_file_open(
                         goto fail;
         }
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         r = journal_file_hmac_setup(f);
         if (r < 0)
                 goto fail;
@@ -3411,7 +3411,7 @@ int journal_file_open(
                 if (r < 0)
                         goto fail;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                 r = journal_file_append_first_tag(f);
                 if (r < 0)
                         goto fail;
@@ -3622,7 +3622,7 @@ int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
                         return -E2BIG;
 
                 if (o->object.flags & OBJECT_COMPRESSION_MASK) {
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
                         size_t rsize = 0;
 
                         r = decompress_blob(o->object.flags & OBJECT_COMPRESSION_MASK,
index df457c9a81de1370f957a5b79cdf62513e79c619..008dba604bbc4b24114cc78eb28369205a53a3b8 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <inttypes.h>
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 #include <gcrypt.h>
 #endif
 
@@ -121,12 +121,12 @@ typedef struct JournalFile {
         pthread_t offline_thread;
         volatile OfflineState offline_state;
 
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
         void *compress_buffer;
         size_t compress_buffer_size;
 #endif
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         gcry_md_hd_t hmac;
         bool hmac_running;
 
index 0904b758c84bb2f99795315cc9bc406cd12bbfa6..e756f51d0f260cad158caa4dea821a6881459382 100644 (file)
@@ -834,13 +834,13 @@ int journal_file_verify(
         bool found_last = false;
         const char *tmp_dir = NULL;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         uint64_t last_tag = 0;
 #endif
         assert(f);
 
         if (key) {
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                 r = journal_file_parse_verification_key(f, key);
                 if (r < 0) {
                         log_error("Failed to parse seed.");
@@ -1103,7 +1103,7 @@ int journal_file_verify(
                                 goto fail;
                         }
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                         if (f->seal) {
                                 uint64_t q, rt;
 
index 3dcfb0e97a9fa9437fee4dfc66e4a64ecbd2d8bc..61814a0cbba700e033718ac76879dd004428e353 100644 (file)
@@ -105,7 +105,7 @@ static char **arg_file = NULL;
 static bool arg_file_stdin = false;
 static int arg_priorities = 0xFF;
 static char *arg_verify_key = NULL;
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 static usec_t arg_interval = DEFAULT_FSS_INTERVAL_USEC;
 static bool arg_force = false;
 #endif
@@ -313,7 +313,7 @@ static void help(void) {
                "  -D --directory=PATH      Show journal files from directory\n"
                "     --file=PATH           Show journal file\n"
                "     --root=ROOT           Operate on files below a root directory\n"
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                "     --interval=TIME       Time interval for changing the FSS sealing key\n"
                "     --verify-key=KEY      Specify FSS verification key\n"
                "     --force               Override of the FSS key pair with --setup-keys\n"
@@ -336,7 +336,7 @@ static void help(void) {
                "     --dump-catalog        Show entries in the message catalog\n"
                "     --update-catalog      Update the message catalog database\n"
                "     --new-id128           Generate a new 128-bit ID\n"
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                "     --setup-keys          Generate a new FSS key pair\n"
 #endif
                , program_invocation_short_name);
@@ -669,7 +669,7 @@ static int parse_argv(int argc, char *argv[]) {
                         arg_action = ACTION_VACUUM;
                         break;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                 case ARG_FORCE:
                         arg_force = true;
                         break;
@@ -1561,7 +1561,7 @@ static int add_syslog_identifier(sd_journal *j) {
 }
 
 static int setup_keys(void) {
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         size_t mpk_size, seed_size, state_size, i;
         uint8_t *mpk, *seed, *state;
         int fd = -1, r;
@@ -1727,7 +1727,7 @@ static int setup_keys(void) {
                 } else
                         fprintf(stderr, "\nThe keys have been generated for host " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(machine));
 
-#ifdef HAVE_QRENCODE
+#if HAVE_QRENCODE
                 /* If this is not an UTF-8 system don't print any QR codes */
                 if (is_locale_utf8()) {
                         fputs("\nTo transfer the verification key to your phone please scan the QR code below:\n\n", stderr);
@@ -1769,7 +1769,7 @@ static int verify(sd_journal *j) {
                 int k;
                 usec_t first = 0, validated = 0, last = 0;
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                 if (!arg_verify_key && JOURNAL_HEADER_SEALED(f->header))
                         log_notice("Journal file %s has sealing enabled but verification key has not been passed using --verify-key=.", f->path);
 #endif
index 10e9615f235e66469476a972fa3e546ceaefaf74..eaa7f2544f4c04b52b685fcc7c34105a9cd9d510 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
 
@@ -227,7 +227,7 @@ static int client_context_read_label(
                 free_and_replace(c->label, l);
                 c->label_size = label_size;
         }
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         else {
                 char *con;
 
index 554f91460d45f0597cb4bfb3682cd5ede236e343..e359bcf71492df9f4d8634cc3a10774f12182f39 100644 (file)
@@ -521,7 +521,7 @@ int server_open_native_socket(Server*s) {
         if (r < 0)
                 return log_error_errno(errno, "SO_PASSCRED failed: %m");
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (mac_selinux_use()) {
                 r = setsockopt(s->native_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one));
                 if (r < 0)
index de643c91494c305cbb6ba9248f86aa422dfbdfe3..db6ca37d798e530962926c0688190f06d97ad7d9 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
 #include <sys/ioctl.h>
@@ -240,12 +240,12 @@ void server_space_usage_message(Server *s, JournalStorage *storage) {
 }
 
 static void server_add_acls(JournalFile *f, uid_t uid) {
-#ifdef HAVE_ACL
+#if HAVE_ACL
         int r;
 #endif
         assert(f);
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
         if (uid <= SYSTEM_UID_MAX)
                 return;
 
@@ -1868,7 +1868,7 @@ int server_init(Server *s) {
 }
 
 void server_maybe_append_tags(Server *s) {
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         JournalFile *f;
         Iterator i;
         usec_t n;
index d0b95ea02ccbc2ee60eec884e8133cd76ba36b1e..54dd096e455aeffa4912140493ae4a2fd5776a43 100644 (file)
@@ -20,7 +20,7 @@
 #include <stddef.h>
 #include <unistd.h>
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
 
index 7d040de893976255478a9bbae7b6ddde47c1ce83..1fde0271a653d982f07a420aa3b611bcbc2e44c0 100644 (file)
@@ -414,7 +414,7 @@ int server_open_syslog_socket(Server *s) {
         if (r < 0)
                 return log_error_errno(errno, "SO_PASSCRED failed: %m");
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (mac_selinux_use()) {
                 r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one));
                 if (r < 0)
index 4dee764fddffbff673eede1825b6988a203677de..318e067563130c0eeaf690db51a64beaa5730716 100644 (file)
@@ -91,7 +91,7 @@ int main(int argc, char *argv[]) {
                         t = server.oldest_file_usec + server.max_retention_usec - n;
                 }
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
                 if (server.system_journal) {
                         usec_t u;
 
index b95efc2041195106687cfaa9ea59a5891d5733d5..da42fd89d286b5fc865c9d91d7b794af535dde14 100644 (file)
@@ -20,7 +20,7 @@ journal_internal_sources = files('''
         sd-journal.c
 '''.split())
 
-if conf.get('HAVE_GCRYPT', false)
+if conf.get('HAVE_GCRYPT') == 1
         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', false)
+if conf.get('HAVE_AUDIT') == 1
         audit_type_includes += 'libaudit.h'
 endif
 
@@ -97,7 +97,7 @@ systemd_cat_sources = files('cat.c')
 
 journalctl_sources = files('journalctl.c')
 
-if conf.get('HAVE_QRENCODE', false)
+if conf.get('HAVE_QRENCODE') == 1
         journalctl_sources += files('journal-qrcode.c',
                                     'journal-qrcode.h')
 endif
index 6e60d24dcf34a41476f56d5804b73e06bae542ef..ac7252093b8b846e10d9bd26944f37cbac9a1800 100644 (file)
@@ -84,7 +84,7 @@ struct MMapCache {
 
 #define WINDOWS_MIN 64
 
-#ifdef ENABLE_DEBUG_MMAP_CACHE
+#if ENABLE_DEBUG_MMAP_CACHE
 /* Tiny windows increase mmap activity and the chance of exposing unsafe use. */
 # define WINDOW_SIZE (page_size())
 #else
@@ -225,7 +225,7 @@ static void context_detach_window(Context *c) {
 
         if (!w->contexts && !w->keep_always) {
                 /* Not used anymore? */
-#ifdef ENABLE_DEBUG_MMAP_CACHE
+#if ENABLE_DEBUG_MMAP_CACHE
                 /* Unmap unused windows immediately to expose use-after-unmap
                  * by SIGSEGV. */
                 window_free(w);
index fb7269e510093a0e2a4be7edd1f1ebdc75f74a01..40805eb2b8d8d170206c89269425a6dfd8bba131 100644 (file)
@@ -2152,7 +2152,7 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
 
                 compression = o->object.flags & OBJECT_COMPRESSION_MASK;
                 if (compression) {
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
                         r = decompress_startswith(compression,
                                                   o->data.payload, l,
                                                   &f->compress_buffer, &f->compress_buffer_size,
@@ -2216,7 +2216,7 @@ static int return_data(sd_journal *j, JournalFile *f, Object *o, const void **da
 
         compression = o->object.flags & OBJECT_COMPRESSION_MASK;
         if (compression) {
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
                 size_t rsize;
                 int r;
 
index 7bddd178c4259f1e74d14598431a9b183484570c..be5a6655a8e06dae83c2cb6957fa560e5d5446b9 100644 (file)
@@ -31,7 +31,7 @@ typedef int (compress_t)(const void *src, uint64_t src_size, void *dst,
 typedef int (decompress_t)(const void *src, uint64_t src_size,
                            void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max);
 
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
 
 static usec_t arg_duration;
 static size_t arg_start;
@@ -157,7 +157,7 @@ static void test_compress_decompress(const char* label, const char* type,
 #endif
 
 int main(int argc, char *argv[]) {
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
         const char *i;
         int r;
 
@@ -183,10 +183,10 @@ int main(int argc, char *argv[]) {
                 arg_start = getpid_cached();
 
         NULSTR_FOREACH(i, "zeros\0simple\0random\0") {
-#ifdef HAVE_XZ
+#if HAVE_XZ
                 test_compress_decompress("XZ", i, compress_blob_xz, decompress_blob_xz);
 #endif
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
                 test_compress_decompress("LZ4", i, compress_blob_lz4, decompress_blob_lz4);
 #endif
         }
index 92108a84b3f13af2ed084b934b5b34927c73afe5..6948e8ccbe2860f54427e2bf57f920a1b6ad43a7 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
 #include <lz4.h>
 #endif
 
 #include "random-util.h"
 #include "util.h"
 
-#ifdef HAVE_XZ
+#if HAVE_XZ
 # define XZ_OK 0
 #else
 # define XZ_OK -EPROTONOSUPPORT
 #endif
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
 # define LZ4_OK 0
 #else
 # define LZ4_OK -EPROTONOSUPPORT
@@ -54,7 +54,7 @@ typedef int (decompress_sw_t)(const void *src, uint64_t src_size,
 typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes);
 typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size);
 
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
 static void test_compress_decompress(int compression,
                                      compress_blob_t compress,
                                      decompress_blob_t decompress,
@@ -206,7 +206,7 @@ static void test_compress_stream(int compression,
 }
 #endif
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
 static void test_lz4_decompress_partial(void) {
         char buf[20000];
         size_t buf_size = sizeof(buf), compressed;
@@ -249,7 +249,7 @@ static void test_lz4_decompress_partial(void) {
 #endif
 
 int main(int argc, char *argv[]) {
-#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+#if HAVE_XZ || HAVE_LZ4
         const char text[] =
                 "text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
                 "foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
@@ -268,7 +268,7 @@ int main(int argc, char *argv[]) {
 
         random_bytes(data + 7, sizeof(data) - 7);
 
-#ifdef HAVE_XZ
+#if HAVE_XZ
         test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz,
                                  text, sizeof(text), false);
         test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz,
@@ -290,7 +290,7 @@ int main(int argc, char *argv[]) {
         log_info("/* XZ test skipped */");
 #endif
 
-#ifdef HAVE_LZ4
+#if HAVE_LZ4
         test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4,
                                  text, sizeof(text), false);
         test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4,
index 2543d64b5bf1b1f3a1117d973fd9c600e2c45a21..df685e90b6285cbd14e660c074666e5c14ddd636 100644 (file)
@@ -58,7 +58,7 @@ static void test_non_empty(void) {
         iovec.iov_len = strlen(test);
         assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0);
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         journal_file_append_tag(f);
 #endif
         journal_file_dump(f);
index 3c770a6e2e4f7d539bd4ccf36f243816afd27056..fcd4d27e07e244b10cb24369b5d2affcb4b46af5 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_VALGRIND_MEMCHECK_H
+#if HAVE_VALGRIND_MEMCHECK_H
 #include <valgrind/memcheck.h>
 #endif
 
index 9b1dad9cfc4fbfdf958cc8842c404d4c809d80cd..5a3c4d6f506ad6949ffc3b2f99e53531eee1562b 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_VALGRIND_MEMCHECK_H
+#if HAVE_VALGRIND_MEMCHECK_H
 #include <valgrind/memcheck.h>
 #endif
 
index e8301f95560224dc854daeb30db461e184f3b692..94fa9645957184d90597fd2f12cdcc51b37bc476 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_GLIB
+#if HAVE_GLIB
 #include <glib.h>
 #endif
 
@@ -155,7 +155,7 @@ static void test_marshal(void) {
 
         assert_se(bus_message_seal(m, 4711, 0) >= 0);
 
-#ifdef HAVE_GLIB
+#if HAVE_GLIB
         {
                 GVariant *v;
                 char *t;
@@ -184,7 +184,7 @@ static void test_marshal(void) {
 
         assert_se(bus_message_get_blob(m, &blob, &sz) >= 0);
 
-#ifdef HAVE_GLIB
+#if HAVE_GLIB
         {
                 GVariant *v;
                 char *t;
index e60c30b1b4059298ad603e264495bfb1dc3b9657..221dbd35cc2d0facacd744f1d3492e9b4a2a7c37 100644 (file)
 #include <math.h>
 #include <stdlib.h>
 
-#ifdef HAVE_GLIB
+#if HAVE_GLIB
 #include <gio/gio.h>
 #endif
 
-#ifdef HAVE_DBUS
+#if HAVE_DBUS
 #include <dbus/dbus.h>
 #endif
 
@@ -215,7 +215,7 @@ int main(int argc, char *argv[]) {
         log_info("message size = %zu, contents =\n%s", sz, h);
         free(h);
 
-#ifdef HAVE_GLIB
+#if HAVE_GLIB
         {
                 GDBusMessage *g;
                 char *p;
@@ -232,7 +232,7 @@ int main(int argc, char *argv[]) {
         }
 #endif
 
-#ifdef HAVE_DBUS
+#if HAVE_DBUS
         {
                 DBusMessage *w;
                 DBusError error;
index c155c701623471ad933273668512b4da7159b7fe..f8246eaa70661505572e13fc0a48f92d63e79fbe 100644 (file)
@@ -317,7 +317,7 @@ static const char hwdb_bin_paths[] =
         "/etc/systemd/hwdb/hwdb.bin\0"
         "/etc/udev/hwdb.bin\0"
         "/usr/lib/systemd/hwdb/hwdb.bin\0"
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
         "/lib/systemd/hwdb/hwdb.bin\0"
 #endif
         UDEVLIBEXECDIR "/hwdb.bin\0";
index 6e41dac1ade4af980e5988464f7074a02296d53b..6570d013922f39f503e6821971739c54ab7f0f2b 100644 (file)
@@ -493,7 +493,7 @@ static int get_search(uint64_t type, char ***list) {
                                                "/usr/local/bin",
                                                "/usr/sbin",
                                                "/usr/bin",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
                                                "/sbin",
                                                "/bin",
 #endif
@@ -507,7 +507,7 @@ static int get_search(uint64_t type, char ***list) {
                                                false,
                                                "/usr/local/lib",
                                                "/usr/lib",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
                                                "/lib",
 #endif
                                                NULL);
@@ -519,7 +519,7 @@ static int get_search(uint64_t type, char ***list) {
                                                "LD_LIBRARY_PATH",
                                                true,
                                                LIBDIR,
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
                                                ROOTLIBDIR,
 #endif
                                                NULL);
index b4798d674c76119b0f2cfe3fa38d7e8dd24ce570..3c0c167dcfa5dfac76e96f5a445d1773f19e3f2e 100644 (file)
@@ -22,7 +22,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef HAVE_XKBCOMMON
+#if HAVE_XKBCOMMON
 #include <xkbcommon/xkbcommon.h>
 #include <dlfcn.h>
 #endif
@@ -429,7 +429,7 @@ static int method_set_vc_keyboard(sd_bus_message *m, void *userdata, sd_bus_erro
         return sd_bus_reply_method_return(m, NULL);
 }
 
-#ifdef HAVE_XKBCOMMON
+#if HAVE_XKBCOMMON
 
 _printf_(3, 0)
 static void log_xkb(struct xkb_context *ctx, enum xkb_log_level lvl, const char *format, va_list args) {
index d7dd113c8d0519f7db7e1c6ea7feb748b509a4fb..e9de6089f319bbc0fd25f5b8deba0dd2c5d1775c 100644 (file)
@@ -6,7 +6,7 @@ systemd_localed_sources = files('''
 
 localectl_sources = files('localectl.c')
 
-if conf.get('ENABLE_LOCALED', false)
+if conf.get('ENABLE_LOCALED') == 1
         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', false)
+if conf.get('ENABLE_LOCALED') == 1
         install_data('kbd-model-map',
                      'language-fallback-map',
                      install_dir : pkgdatadir)
index 1286c6a3cd7b84990cf46ab045a2e058548b8c21..606005a6f1ba0d4c2fefd72c11c032d2c2aabbfb 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "libudev.h"
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
 
 int devnode_acl(const char *path,
                 bool flush,
index 26bdbec42412071a396f3838642b5609c2027c4b..d0723f134f4348ce691c41b7285e841e943aa87f 100644 (file)
@@ -39,7 +39,7 @@ liblogind_core_sources = files('''
 '''.split())
 
 logind_acl_c = files('logind-acl.c')
-if conf.get('HAVE_ACL', false)
+if conf.get('HAVE_ACL') == 1
         liblogind_core_sources += logind_acl_c
 endif
 
@@ -55,7 +55,7 @@ loginctl_sources = files('''
         sysfs-show.c
 '''.split())
 
-if conf.get('ENABLE_LOGIND', false)
+if conf.get('ENABLE_LOGIND') == 1
         logind_conf = configure_file(
                 input : 'logind.conf.in',
                 output : 'logind.conf',
index 1a0813323c13208c839ad62a35de1964ce5219c3..693503da539fd4fb819c15ec31f72b2891e2951a 100644 (file)
@@ -21,7 +21,7 @@ libmachine_core = static_library(
         include_directories : includes,
         dependencies : [threads])
 
-if conf.get('ENABLE_MACHINED', false)
+if conf.get('ENABLE_MACHINED') == 1
         install_data('org.freedesktop.machine1.conf',
                      install_dir : dbuspolicydir)
         install_data('org.freedesktop.machine1.service',
index 83a837d6c9c640510170477f11f16c2aa645afaf..38c2220e8b5d9efb4886591ae2706ac6eca02520 100644 (file)
@@ -81,7 +81,7 @@ networkctl_sources = files('networkctl.c')
 
 network_include_dir = include_directories('.')
 
-if conf.get('ENABLE_NETWORKD', false)
+if conf.get('ENABLE_NETWORKD') == 1
         networkd_gperf_c = custom_target(
                 'networkd-gperf.c',
                 input : 'networkd-gperf.gperf',
index 1e82c87d367168304cc1e1568c1fb32eef6938f3..71445d5dda0aa80641db91d13bc20264fa2c457a 100644 (file)
@@ -48,7 +48,7 @@ const char* const network_dirs[] = {
         "/etc/systemd/network",
         "/run/systemd/network",
         "/usr/lib/systemd/network",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
         "/lib/systemd/network",
 #endif
         NULL};
index e80c944e9fe8aa47d00195e7d06a963067bb40c3..531f29cb7b5e062e6e3c425e74ac804678ea375c 100644 (file)
@@ -374,7 +374,7 @@ static int tmpfs_patch_options(
                 options = buf;
         }
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (selinux_apifs_context) {
                 char *t;
 
@@ -557,7 +557,7 @@ int mount_all(const char *dest,
                 { "tmpfs",               "/dev",                "tmpfs", "mode=755",  MS_NOSUID|MS_STRICTATIME,                                  MOUNT_FATAL },
                 { "tmpfs",               "/dev/shm",            "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME,                         MOUNT_FATAL },
                 { "tmpfs",               "/run",                "tmpfs", "mode=755",  MS_NOSUID|MS_NODEV|MS_STRICTATIME,                         MOUNT_FATAL },
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
                 { "/sys/fs/selinux",     "/sys/fs/selinux",     NULL,     NULL,       MS_BIND,                                                   0 },  /* Bind mount first */
                 { NULL,                  "/sys/fs/selinux",     NULL,     NULL,       MS_BIND|MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT, 0 },  /* Then, make it r/o */
 #endif
index f861db879a780cc72acbec7275086a078a21c5f8..063fdb1053eacefb8e0fcf8b4c20e72260dda507 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <fcntl.h>
 #include <linux/magic.h>
-#ifdef HAVE_ACL
+#if HAVE_ACL
 #include <sys/acl.h>
 #endif
 #include <sys/stat.h>
@@ -37,7 +37,7 @@
 #include "strv.h"
 #include "user-util.h"
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
 
 static int get_acl(int fd, const char *name, acl_type_t type, acl_t *ret) {
         char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
index 38c2b12e9522250300982a59f7a9d3a2ebc5765f..196766dc98451fe78c74115228cd67dc7abe88f4 100644 (file)
 #include <sys/capability.h>
 #include <sys/types.h>
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include <seccomp.h>
 #endif
 
 #include "alloc-util.h"
 #include "log.h"
 #include "nspawn-seccomp.h"
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
 #include "string-util.h"
 #include "strv.h"
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 
 static int seccomp_add_default_syscall_filter(
                 scmp_filter_ctx ctx,
index 82fd0bd5f4a5aec940af7cb199e13cef09f16a88..4e3803be822168984b6523167e424e1919c1dd0f 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
 #include <blkid.h>
 #endif
 #include <errno.h>
@@ -26,7 +26,7 @@
 #include <linux/loop.h>
 #include <pwd.h>
 #include <sched.h>
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
 #include <signal.h>
@@ -1234,7 +1234,7 @@ static int verify_arguments(void) {
                 return -EINVAL;
         }
 
-#ifndef HAVE_LIBIPTC
+#if ! HAVE_LIBIPTC
         if (arg_expose_ports) {
                 log_error("--port= is not supported, compiled without libiptc support.");
                 return -EOPNOTSUPP;
@@ -1547,7 +1547,7 @@ static int setup_pts(const char *dest) {
         const char *p;
         int r;
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (arg_selinux_apifs_context)
                 (void) asprintf(&options,
                                 "newinstance,ptmxmode=0666,mode=620,gid=" GID_FMT ",context=\"%s\"",
@@ -2332,7 +2332,7 @@ static int inner_child(
                         return log_error_errno(r, "personality() failed: %m");
         }
 
-#ifdef HAVE_SELINUX
+#if HAVE_SELINUX
         if (arg_selinux_context)
                 if (setexeccon(arg_selinux_context) < 0)
                         return log_error_errno(errno, "setexeccon(\"%s\") failed: %m", arg_selinux_context);
index a42fce377e37e65474cf265928944468dd8f7df3..1339564edb42d48d36aaff35d66da2dcecdfc5f5 100644 (file)
@@ -49,7 +49,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
                         log_warning("Invalid quotacheck.mode= parameter '%s'. Ignoring.", value);
         }
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
         else if (streq(key, "forcequotacheck") && !value) {
                 log_warning("Please use 'quotacheck.mode=force' rather than 'forcequotacheck' on the kernel command line.");
                 arg_force = true;
@@ -61,7 +61,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
 
 static void test_files(void) {
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
         if (access("/forcequotacheck", F_OK) >= 0) {
                 log_error("Please pass 'quotacheck.mode=force' on the kernel command line rather than creating /forcequotacheck on the root file system.");
                 arg_force = true;
index fe228784fac047e3528bbfa325834b9efd9caa20..935214d6a517d92f7620005e5ea106e84585790c 100644 (file)
@@ -123,7 +123,7 @@ systemd_resolve_sources = (basic_dns_sources +
                            systemd_resolve_only_sources +
                            dns_type_headers)
 
-if conf.get('ENABLE_RESOLVED', false)
+if conf.get('ENABLE_RESOLVED') == 1
         install_data('org.freedesktop.resolve1.conf',
                      install_dir : dbuspolicydir)
         install_data('org.freedesktop.resolve1.service',
index 75636e0e5647816d53d8841fd7f16eaecf61fa44..3cf4261ff0a85294587d48c42a2702205c961c09 100644 (file)
@@ -246,7 +246,7 @@ int manager_parse_config_file(Manager *m) {
                         return r;
         }
 
-#ifndef HAVE_GCRYPT
+#if ! HAVE_GCRYPT
         if (m->dnssec_mode != DNSSEC_NO) {
                 log_warning("DNSSEC option cannot be enabled or set to allow-downgrade when systemd-resolved is built without gcrypt support. Turning off DNSSEC support.");
                 m->dnssec_mode = DNSSEC_NO;
index eddab58a818d32444c9624d8d1c7354d88b2fe49..4f398d8119e07940d5dc96f1a83ded2739d50a60 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 #include <gcrypt.h>
 #endif
 
@@ -125,7 +125,7 @@ int dnssec_canonicalize(const char *n, char *buffer, size_t buffer_max) {
         return (int) c;
 }
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 
 static int rr_compare(const void *a, const void *b) {
         DnsResourceRecord **x = (DnsResourceRecord**) a, **y = (DnsResourceRecord**) b;
index 95795e4d242201b78eb3b1aa9be9dca047600291..21fd8465e6d6b50194e4f83a8bfe240e0ce095be 100644 (file)
@@ -313,7 +313,7 @@ void link_set_dnssec_mode(Link *l, DnssecMode mode) {
 
         assert(l);
 
-#ifndef HAVE_GCRYPT
+#if ! HAVE_GCRYPT
         if (IN_SET(mode, DNSSEC_YES, DNSSEC_ALLOW_DOWNGRADE))
                 log_warning("DNSSEC option for the link cannot be enabled or set to allow-downgrade when systemd-resolved is built without gcrypt support. Turning off DNSSEC support.");
         return;
index b6620875eae334001b392be1bcfa42049d54e782..c8961f20a7061b1ddadc55db99f69534053b4feb 100644 (file)
@@ -21,7 +21,7 @@
 #include <poll.h>
 #include <sys/ioctl.h>
 
-#ifdef HAVE_LIBIDN2
+#if HAVE_LIBIDN2
 #include <idn2.h>
 #endif
 
@@ -328,9 +328,9 @@ static int manager_network_monitor_listen(Manager *m) {
 
 static int determine_hostname(char **full_hostname, char **llmnr_hostname, char **mdns_hostname) {
         _cleanup_free_ char *h = NULL, *n = NULL;
-#if defined(HAVE_LIBIDN2)
+#if HAVE_LIBIDN2
         _cleanup_free_ char *utf8 = NULL;
-#elif defined(HAVE_LIBIDN)
+#elif HAVE_LIBIDN
         int k;
 #endif
         char label[DNS_LABEL_MAX];
@@ -356,7 +356,7 @@ static int determine_hostname(char **full_hostname, char **llmnr_hostname, char
                 return -EINVAL;
         }
 
-#if defined(HAVE_LIBIDN2)
+#if HAVE_LIBIDN2
         r = idn2_to_unicode_8z8z(label, &utf8, 0);
         if (r != IDN2_OK)
                 return log_error("Failed to undo IDNA: %s", idn2_strerror(r));
@@ -364,7 +364,7 @@ static int determine_hostname(char **full_hostname, char **llmnr_hostname, char
 
         r = strlen(utf8);
         decoded = utf8;
-#elif defined(HAVE_LIBIDN)
+#elif HAVE_LIBIDN
         k = dns_label_undo_idna(label, r, label, sizeof label);
         if (k < 0)
                 return log_error_errno(k, "Failed to undo IDNA: %m");
index 090b2fac23bb4dad6551c5a3622b9a597f880821..25ec6f4352ad3ad756a9579e8dc3be21fe6b6556 100644 (file)
@@ -218,7 +218,7 @@ int main(int argc, char* argv[]) {
         test_hostname_lookup(bus, "poettering.de", AF_INET, NULL);
         test_hostname_lookup(bus, "poettering.de", AF_INET6, NULL);
 
-#if defined(HAVE_LIBIDN2) || defined(HAVE_LIBIDN)
+#if HAVE_LIBIDN2 || HAVE_LIBIDN
         /* Unsigned A with IDNA conversion necessary */
         test_hostname_lookup(bus, "pöttering.de", AF_UNSPEC, NULL);
         test_hostname_lookup(bus, "pöttering.de", AF_INET, NULL);
index b3018e82395a2eb865075f00778a3d375055259f..8cb4b503938a9e22cf28e2de1ce0bbab2a45fd21 100644 (file)
@@ -47,7 +47,7 @@ static void test_dnssec_canonicalize(void) {
         test_dnssec_canonicalize_one("FOO..bar.", NULL, -EINVAL);
 }
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 
 static void test_dnssec_verify_dns_key(void) {
 
@@ -332,7 +332,7 @@ int main(int argc, char*argv[]) {
 
         test_dnssec_canonicalize();
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         test_dnssec_verify_dns_key();
         test_dnssec_verify_rrset();
         test_dnssec_verify_rrset2();
index 396e9e067ee6c997ff1b0cb9328a8b5b0e19439a..a0e31d8e29bc85c2b0dea48636d52adf9a97a02b 100644 (file)
@@ -19,7 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
 
 #include <acl/libacl.h>
 #include <stdbool.h>
index a08f17d8210d3b7734589e54bb29b36ba52428b9..e191f8c93efb31eddd422df529bf56845dd8326e 100644 (file)
@@ -598,7 +598,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
 
                 r = sd_bus_message_append(m, "v", "i", (int32_t) n);
 
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 
         } else if (streq(field, "SystemCallFilter")) {
                 int whitelist;
index a9a763c1cabecca5a7b74125a56cef3d12ad8ca9..7609d9c52262a0804a58b89e807de45d1dcacf86 100644 (file)
@@ -255,7 +255,7 @@ int bus_test_polkit(
                 return r;
         else if (r > 0)
                 return 1;
-#ifdef ENABLE_POLKIT
+#if ENABLE_POLKIT
         else {
                 _cleanup_(sd_bus_message_unrefp) sd_bus_message *request = NULL;
                 _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
@@ -334,7 +334,7 @@ int bus_test_polkit(
         return -EACCES;
 }
 
-#ifdef ENABLE_POLKIT
+#if ENABLE_POLKIT
 
 typedef struct AsyncPolkitQuery {
         sd_bus_message *request, *reply;
@@ -398,7 +398,7 @@ int bus_verify_polkit_async(
                 Hashmap **registry,
                 sd_bus_error *error) {
 
-#ifdef ENABLE_POLKIT
+#if ENABLE_POLKIT
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *pk = NULL;
         AsyncPolkitQuery *q;
         const char *sender, **k, **v;
@@ -416,7 +416,7 @@ int bus_verify_polkit_async(
         if (r != 0)
                 return r;
 
-#ifdef ENABLE_POLKIT
+#if ENABLE_POLKIT
         q = hashmap_get(*registry, call);
         if (q) {
                 int authorized, challenge;
@@ -463,7 +463,7 @@ int bus_verify_polkit_async(
         else if (r > 0)
                 return 1;
 
-#ifdef ENABLE_POLKIT
+#if ENABLE_POLKIT
         if (sd_bus_get_current_message(call->bus) != call)
                 return -EINVAL;
 
@@ -552,7 +552,7 @@ int bus_verify_polkit_async(
 }
 
 void bus_verify_polkit_async_registry_free(Hashmap *registry) {
-#ifdef ENABLE_POLKIT
+#if ENABLE_POLKIT
         AsyncPolkitQuery *q;
 
         while ((q = hashmap_steal_first(registry)))
index 243a46f2e3c7d4bbbe3cbcfc116db4c43d5b4485..dd8650e1a8b9bb96910232927bf601daf0e7e831 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
 #include <libcryptsetup.h>
 #endif
 #include <sys/mount.h>
@@ -43,7 +43,7 @@
 #include "xattr-util.h"
 
 _unused_ static int probe_filesystem(const char *node, char **ret_fstype) {
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
         _cleanup_blkid_free_probe_ blkid_probe b = NULL;
         const char *fstype;
         int r;
@@ -87,7 +87,7 @@ not_found:
 
 int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret) {
 
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
         sd_id128_t root_uuid = SD_ID128_NULL, verity_uuid = SD_ID128_NULL;
         _cleanup_udev_enumerate_unref_ struct udev_enumerate *e = NULL;
         bool is_gpt, is_mbr, generic_rw, multiple_generic = false;
@@ -737,7 +737,7 @@ int dissected_image_mount(DissectedImage *m, const char *where, DissectImageFlag
         return 0;
 }
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
 typedef struct DecryptedPartition {
         struct crypt_device *device;
         char *name;
@@ -752,7 +752,7 @@ struct DecryptedImage {
 #endif
 
 DecryptedImage* decrypted_image_unref(DecryptedImage* d) {
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
         size_t i;
         int r;
 
@@ -778,7 +778,7 @@ DecryptedImage* decrypted_image_unref(DecryptedImage* d) {
         return NULL;
 }
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
 
 static int make_dm_name_and_node(const void *original_node, const char *suffix, char **ret_name, char **ret_node) {
         _cleanup_free_ char *name = NULL, *node = NULL;
@@ -952,7 +952,7 @@ int dissected_image_decrypt(
                 DecryptedImage **ret) {
 
         _cleanup_(decrypted_image_unrefp) DecryptedImage *d = NULL;
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
         unsigned i;
         int r;
 #endif
@@ -976,7 +976,7 @@ int dissected_image_decrypt(
                 return 0;
         }
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
         if (m->encrypted && !passphrase)
                 return -ENOKEY;
 
@@ -1058,7 +1058,7 @@ int dissected_image_decrypt_interactively(
         }
 }
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
 static int deferred_remove(DecryptedPartition *p) {
 
         struct dm_ioctl dm = {
@@ -1092,7 +1092,7 @@ static int deferred_remove(DecryptedPartition *p) {
 
 int decrypted_image_relinquish(DecryptedImage *d) {
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
         size_t i;
         int r;
 #endif
@@ -1102,7 +1102,7 @@ int decrypted_image_relinquish(DecryptedImage *d) {
         /* Turns on automatic removal after the last use ended for all DM devices of this image, and sets a boolean so
          * that we don't clean it up ourselves either anymore */
 
-#ifdef HAVE_LIBCRYPTSETUP
+#if HAVE_LIBCRYPTSETUP
         for (i = 0; i < d->n_decrypted; i++) {
                 DecryptedPartition *p = d->decrypted + i;
 
index 139d286af8d3b2a8a31aea74e9b2df1fc5ca8af3..9804907304b48f9bfec6ad47c21b5f0bd9c0e92d 100644 (file)
@@ -17,9 +17,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
  ***/
 
-#if defined(HAVE_LIBIDN2)
+#if HAVE_LIBIDN2
 #  include <idn2.h>
-#elif defined(HAVE_LIBIDN)
+#elif HAVE_LIBIDN
 #  include <idna.h>
 #  include <stringprep.h>
 #endif
@@ -301,7 +301,7 @@ int dns_label_escape_new(const char *p, size_t l, char **ret) {
         return r;
 }
 
-#ifdef HAVE_LIBIDN
+#if HAVE_LIBIDN
 int dns_label_apply_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max) {
         _cleanup_free_ uint32_t *input = NULL;
         size_t input_size, l;
@@ -1272,7 +1272,7 @@ int dns_name_common_suffix(const char *a, const char *b, const char **ret) {
 int dns_name_apply_idna(const char *name, char **ret) {
         /* Return negative on error, 0 if not implemented, positive on success. */
 
-#if defined(HAVE_LIBIDN2)
+#if HAVE_LIBIDN2
         int r;
         _cleanup_free_ char *t = NULL;
 
@@ -1312,7 +1312,7 @@ int dns_name_apply_idna(const char *name, char **ret) {
         if (IN_SET(r, IDN2_TOO_BIG_DOMAIN, IDN2_TOO_BIG_LABEL))
                 return -ENOSPC;
         return -EINVAL;
-#elif defined(HAVE_LIBIDN)
+#elif HAVE_LIBIDN
         _cleanup_free_ char *buf = NULL;
         size_t n = 0, allocated = 0;
         bool first = true;
index fca025def01a785c4dae8c7cd7641c7ad2d894aa..a44d9d48d478307e49d43002f4e7c085d615abea 100644 (file)
@@ -51,7 +51,7 @@ static inline int dns_name_parent(const char **name) {
         return dns_label_unescape(name, NULL, DNS_LABEL_MAX);
 }
 
-#if defined(HAVE_LIBIDN)
+#if HAVE_LIBIDN
 int dns_label_apply_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max);
 int dns_label_undo_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max);
 #endif
index 2503346610eaf94329f13161a485a331522b1b97..a3850bede2785b973b90c40bfdf56da775063247 100644 (file)
@@ -42,7 +42,7 @@
 #include "util.h"
 #include "virt.h"
 
-#ifdef ENABLE_EFI
+#if ENABLE_EFI
 
 #define LOAD_OPTION_ACTIVE            0x00000001
 #define MEDIA_DEVICE_PATH                   0x04
index b61d14c4ec161d6c7510ee20b054bd0f267b6116..72bace0d07a7b4af1000afea5e8d077a7644f7e3 100644 (file)
@@ -33,7 +33,7 @@
 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
 #define EFI_VARIABLE_RUNTIME_ACCESS     0x0000000000000004
 
-#ifdef ENABLE_EFI
+#if ENABLE_EFI
 
 bool is_efi_boot(void);
 bool is_efi_secure_boot(void);
index c39b34cf8f83c77fa3dbf3facc581e114490928f..5915266b4bf7e8ee64a3c74bc7e8edef9fa7bfd3 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "in-addr-util.h"
 
-#ifdef HAVE_LIBIPTC
+#if HAVE_LIBIPTC
 
 int fw_add_masquerade(
                 bool add,
index 39b544b6f0919d00b604548295d476ca45a47e5b..e10a38dcfc0321b2a99847e8de3965af5845ad1a 100644 (file)
@@ -19,7 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 #include <gcrypt.h>
 
 #include "gcrypt-util.h"
index 1da12a32be28b2d627bd7aacb67f31247372d26e..f08ed6052cce84012d3524497bcc93d83b6da7af 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
 #include <gcrypt.h>
 
 void initialize_libgcrypt(bool secmem);
@@ -31,7 +31,7 @@ int string_hashsum(const char *s, size_t len, int md_algorithm, char **out);
 #endif
 
 static inline int string_hashsum_sha224(const char *s, size_t len, char **out) {
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         return string_hashsum(s, len, GCRY_MD_SHA224, out);
 #else
         return -EOPNOTSUPP;
@@ -39,7 +39,7 @@ static inline int string_hashsum_sha224(const char *s, size_t len, char **out) {
 }
 
 static inline int string_hashsum_sha256(const char *s, size_t len, char **out) {
-#ifdef HAVE_GCRYPT
+#if HAVE_GCRYPT
         return string_hashsum(s, len, GCRY_MD_SHA256, out);
 #else
         return -EOPNOTSUPP;
index 0a8628c26ade3fe08fed7d2dcfe8205595be4724..7598bf6a23c15e2bbbc2490852aaa40c23463044 100644 (file)
@@ -286,7 +286,7 @@ static int path_is_vendor(const LookupPaths *p, const char *path) {
         if (path_startswith(rpath, "/usr"))
                 return true;
 
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
         if (path_startswith(rpath, "/lib"))
                 return true;
 #endif
@@ -2739,7 +2739,7 @@ static int read_presets(UnitFileScope scope, const char *root_dir, Presets *pres
                                     "/etc/systemd/system-preset",
                                     "/usr/local/lib/systemd/system-preset",
                                     "/usr/lib/systemd/system-preset",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
                                     "/lib/systemd/system-preset",
 #endif
                                     NULL);
index 8479221a44749398c0f4d52be3eb16b8a74e3ef3..fff3dfc9d1364847c41a52ea913db8f4c84857ea 100644 (file)
@@ -28,7 +28,7 @@
 #include "user-util.h"
 
 static int access_check_var_log_journal(sd_journal *j) {
-#ifdef HAVE_ACL
+#if HAVE_ACL
         _cleanup_strv_free_ char **g = NULL;
         const char* dir;
 #endif
@@ -48,7 +48,7 @@ static int access_check_var_log_journal(sd_journal *j) {
         if (r > 0)
                 return 0;
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
         if (laccess("/run/log/journal", F_OK) >= 0)
                 dir = "/run/log/journal";
         else
index ce84d007d1651aa3b3743d0e7621e97a0375e1a5..bb9720a94a97217947335f821a397d8fee578e3b 100644 (file)
@@ -104,19 +104,19 @@ shared_sources = '''
 test_tables_h = files('test-tables.h')
 shared_sources += [test_tables_h]
 
-if conf.get('HAVE_ACL', false)
+if conf.get('HAVE_ACL') == 1
         shared_sources += ['acl-util.c']
 endif
 
-if conf.get('HAVE_UTMP', false)
+if conf.get('HAVE_UTMP') == 1
         shared_sources += ['utmp-wtmp.c']
 endif
 
-if conf.get('HAVE_SECCOMP', false)
+if conf.get('HAVE_SECCOMP') == 1
         shared_sources += ['seccomp-util.c']
 endif
 
-if conf.get('HAVE_LIBIPTC', false)
+if conf.get('HAVE_LIBIPTC') == 1
         shared_sources += ['firewall-util.c']
 endif
 
index bf10acda94480671f1f54b81c90698ca3d1b9cd7..68c392e1c0edcc5f9fe1109620e49b1da84cd223 100644 (file)
@@ -576,7 +576,7 @@ int lookup_paths_init(
                                         "/usr/local/lib/systemd/system",
                                         SYSTEM_DATA_UNIT_PATH,
                                         "/usr/lib/systemd/system",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
                                         "/lib/systemd/system",
 #endif
                                         STRV_IFNOTNULL(generator_late),
index 7dae4d14fe22648a64fcfb3f3ef2fdd84cc0b135..9a401476629f1c7dea791cf1862e0fa28f0e1de2 100644 (file)
@@ -33,7 +33,7 @@
 #include "time-util.h"
 #include "util.h"
 
-#ifdef ENABLE_POLKIT
+#if ENABLE_POLKIT
 static pid_t agent_pid = 0;
 
 int polkit_agent_open(void) {
index 438e270a26b48e215fec54843a46e675fb08d0f1..8da594100aa293851e120c8e68b2ba9d48c6f2ce 100644 (file)
@@ -25,7 +25,7 @@
 #include "time-util.h"
 #include "util.h"
 
-#ifdef HAVE_UTMP
+#if HAVE_UTMP
 int utmp_get_runlevel(int *runlevel, int *previous);
 
 int utmp_put_shutdown(void);
index 897fc48b9895e06242fc01378aa645f2daf93c2a..17ea5c3a32e8a896c24d34cce52b909dbf4ba658 100644 (file)
@@ -3219,7 +3219,7 @@ static int start_unit(int argc, char *argv[], void *userdata) {
         return r;
 }
 
-#ifdef ENABLE_LOGIND
+#if ENABLE_LOGIND
 static int logind_set_wall_message(void) {
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         sd_bus *bus;
@@ -3255,7 +3255,7 @@ static int logind_set_wall_message(void) {
 /* Ask systemd-logind, which might grant access to unprivileged users
  * through PolicyKit */
 static int logind_reboot(enum action a) {
-#ifdef ENABLE_LOGIND
+#if ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *method, *description;
         sd_bus *bus;
@@ -3318,7 +3318,7 @@ static int logind_reboot(enum action a) {
 }
 
 static int logind_check_inhibitors(enum action a) {
-#ifdef ENABLE_LOGIND
+#if ENABLE_LOGIND
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
         _cleanup_strv_free_ char **sessions = NULL;
         const char *what, *who, *why, *mode;
@@ -3439,7 +3439,7 @@ static int logind_check_inhibitors(enum action a) {
 }
 
 static int logind_prepare_firmware_setup(void) {
-#ifdef ENABLE_LOGIND
+#if ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         sd_bus *bus;
         int r;
@@ -5903,7 +5903,7 @@ static int import_environment(int argc, char *argv[], void *userdata) {
 static int enable_sysv_units(const char *verb, char **args) {
         int r = 0;
 
-#if defined(HAVE_SYSV_COMPAT)
+#if HAVE_SYSV_COMPAT
         _cleanup_lookup_paths_free_ LookupPaths paths = {};
         unsigned f = 0;
 
@@ -8211,7 +8211,7 @@ static int parse_argv(int argc, char *argv[]) {
         return systemctl_parse_argv(argc, argv);
 }
 
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
 _pure_ static int action_to_runlevel(void) {
 
         static const char table[_ACTION_MAX] = {
@@ -8232,7 +8232,7 @@ _pure_ static int action_to_runlevel(void) {
 #endif
 
 static int talk_initctl(void) {
-#ifdef HAVE_SYSV_COMPAT
+#if HAVE_SYSV_COMPAT
         struct init_request request = {
                 .magic = INIT_MAGIC,
                 .sleeptime  = 0,
@@ -8426,7 +8426,7 @@ static int halt_now(enum action a) {
 
 static int logind_schedule_shutdown(void) {
 
-#ifdef ENABLE_LOGIND
+#if ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         char date[FORMAT_TIMESTAMP_MAX];
         const char *action;
@@ -8555,7 +8555,7 @@ static int runlevel_main(void) {
 }
 
 static int logind_cancel_shutdown(void) {
-#ifdef ENABLE_LOGIND
+#if ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         sd_bus *bus;
         int r;
index e9e6dae10c7293920e765341eb23d5a3977ef16a..6f0e83d51e85487b715e80279334380fd7dab2f1 100644 (file)
@@ -299,7 +299,7 @@ static int putgrent_with_members(const struct group *gr, FILE *group) {
         return 0;
 }
 
-#ifdef ENABLE_GSHADOW
+#if ENABLE_GSHADOW
 static int putsgent_with_members(const struct sgrp *sg, FILE *gshadow) {
         char **a;
 
@@ -636,7 +636,7 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char **
 }
 
 static int write_temporary_gshadow(const char * gshadow_path, FILE **tmpfile, char **tmpfile_path) {
-#ifdef ENABLE_GSHADOW
+#if ENABLE_GSHADOW
         _cleanup_fclose_ FILE *original = NULL, *gshadow = NULL;
         _cleanup_(unlink_and_freep) char *gshadow_tmp = NULL;
         bool group_changed = false;
index 93b758ec7aafc95655242164a0158e9563e42cf0..75bc5e4a73fde15724ba731dd9dc3b1998c8d956 100644 (file)
@@ -624,7 +624,7 @@ static void test_dns_name_apply_idna_one(const char *s, int expected, const char
 }
 
 static void test_dns_name_apply_idna(void) {
-#if defined HAVE_LIBIDN2 || defined HAVE_LIBIDN
+#if HAVE_LIBIDN2 || HAVE_LIBIDN
         const int ret = 1;
 #else
         const int ret = 0;
@@ -638,7 +638,7 @@ static void test_dns_name_apply_idna(void) {
          * labels. If registrars follow IDNA2008 we'll just be performing a
          * useless lookup.
          */
-#if defined HAVE_LIBIDN
+#if HAVE_LIBIDN
         const int ret2 = 1;
 #else
         const int ret2 = 0;
index 68166cf749b9d08538f458473b1eed6168b0c3d8..6786d561977227e224d20b0fb66a834f18f00c03 100644 (file)
@@ -30,7 +30,7 @@
 #include "mkdir.h"
 #include "path-util.h"
 #include "rm-rf.h"
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
 #include "stat-util.h"
@@ -243,7 +243,7 @@ static void test_exec_inaccessiblepaths_proc(Manager *m) {
 }
 
 static void test_exec_systemcallfilter(Manager *m) {
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         if (!is_seccomp_available())
                 return;
         test(m, "exec-systemcallfilter-not-failing.service", 0, CLD_EXITED);
@@ -255,14 +255,14 @@ static void test_exec_systemcallfilter(Manager *m) {
 }
 
 static void test_exec_systemcallerrornumber(Manager *m) {
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         if (is_seccomp_available())
                 test(m, "exec-systemcallerrornumber.service", 1, CLD_EXITED);
 #endif
 }
 
 static void test_exec_restrict_namespaces(Manager *m) {
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         if (!is_seccomp_available())
                 return;
 
@@ -274,7 +274,7 @@ static void test_exec_restrict_namespaces(Manager *m) {
 }
 
 static void test_exec_systemcall_system_mode_with_user(Manager *m) {
-#ifdef HAVE_SECCOMP
+#if HAVE_SECCOMP
         if (!is_seccomp_available())
                 return;
         if (getpwnam("nobody"))
index 44570caa6c09c93455d26f78e3972baca7b4474d..0fc30718d5ab887141fa4a3a4b06665f9c539a36 100644 (file)
@@ -450,13 +450,13 @@ static int parse_argv(int argc, char **argv,
                 modules = strv_new(argv[1], NULL);
         else
                 modules = strv_new(
-#ifdef HAVE_MYHOSTNAME
+#if HAVE_MYHOSTNAME
                                 "myhostname",
 #endif
-#ifdef HAVE_RESOLVED
+#if HAVE_RESOLVED
                                 "resolve",
 #endif
-#ifdef HAVE_MACHINED
+#if HAVE_MACHINED
                                 "mymachines",
 #endif
                                 "dns",
index e7c9766c44fcdef4928aed82e363be27ae3e1fa7..0f0e2cbcb9f4fd507b30abff6e91f153cfc45c31 100644 (file)
@@ -26,7 +26,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
 #include <valgrind/valgrind.h>
 #endif
 
@@ -168,7 +168,7 @@ static void test_get_process_cmdline_harder(void) {
         if (geteuid() != 0)
                 return;
 
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
         /* valgrind patches open(/proc//cmdline)
          * so, test_get_process_cmdline_harder fails always
          * See https://github.com/systemd/systemd/pull/3555#issuecomment-226564908 */
@@ -367,7 +367,7 @@ static void test_rename_process_now(const char *p, int ret) {
         if (r < 0)
                 return;
 
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
         /* see above, valgrind is weird, we can't verify what we are doing here */
         if (RUNNING_ON_VALGRIND)
                 return;
index 7a4a8a6636cd3fd84614a1c3123e119856ca62e2..bcc08b226c8ff2516ce16d29f10b63efc650ba99 100644 (file)
@@ -22,7 +22,7 @@
 #include "fd-util.h"
 #include "sigbus.h"
 #include "util.h"
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
 #include <valgrind/valgrind.h>
 #endif
 
@@ -32,7 +32,7 @@ int main(int argc, char *argv[]) {
         void *addr = NULL;
         uint8_t *p;
 
-#ifdef HAVE_VALGRIND_VALGRIND_H
+#if HAVE_VALGRIND_VALGRIND_H
         if (RUNNING_ON_VALGRIND)
                 return EXIT_TEST_SKIP;
 #endif
index 63124d665bbdb6aaa1004c301812c2475337b4d0..ce92a6be692ba7ff9d45d972e4bc67a18934e1b8 100644 (file)
@@ -1,4 +1,4 @@
-if conf.get('ENABLE_TIMEDATED', false)
+if conf.get('ENABLE_TIMEDATED') == 1
         install_data('org.freedesktop.timedate1.conf',
                      install_dir : dbuspolicydir)
         install_data('org.freedesktop.timedate1.service',
index 4391afa93ac6f85ed8ab18234696ceb95811e680..690af9552c3c2fd472e6dd207b9c7dd3d362d0b2 100644 (file)
@@ -16,7 +16,7 @@ timesyncd_gperf_c = custom_target(
 
 systemd_timesyncd_sources += [timesyncd_gperf_c]
 
-if conf.get('ENABLE_TIMESYNCD', false)
+if conf.get('ENABLE_TIMESYNCD') == 1
         timesyncd_conf = configure_file(
                 input : 'timesyncd.conf.in',
                 output : 'timesyncd.conf',
index 3f5c1e62ee66f631382c4abe1eb2bdfd9d4a0a06..a3df548002a3f28b9762b2a92f674fb9d04c9437 100644 (file)
@@ -116,7 +116,7 @@ typedef struct Item {
         char *path;
         char *argument;
         char **xattrs;
-#ifdef HAVE_ACL
+#if HAVE_ACL
         acl_t acl_access;
         acl_t acl_default;
 #endif
@@ -744,7 +744,7 @@ static int path_set_xattrs(Item *i, const char *path) {
 }
 
 static int parse_acls_from_arg(Item *item) {
-#ifdef HAVE_ACL
+#if HAVE_ACL
         int r;
 
         assert(item);
@@ -762,7 +762,7 @@ static int parse_acls_from_arg(Item *item) {
         return 0;
 }
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
 static int path_set_acl(const char *path, const char *pretty, acl_type_t type, acl_t acl, bool modify) {
         _cleanup_(acl_free_charpp) char *t = NULL;
         _cleanup_(acl_freep) acl_t dup = NULL;
@@ -810,7 +810,7 @@ static int path_set_acl(const char *path, const char *pretty, acl_type_t type, a
 
 static int path_set_acls(Item *item, const char *path) {
         int r = 0;
-#ifdef HAVE_ACL
+#if HAVE_ACL
         char fn[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
         _cleanup_close_ int fd = -1;
         struct stat st;
@@ -1698,7 +1698,7 @@ static void item_free_contents(Item *i) {
         free(i->argument);
         strv_free(i->xattrs);
 
-#ifdef HAVE_ACL
+#if HAVE_ACL
         acl_free(i->acl_access);
         acl_free(i->acl_default);
 #endif
index eeb341f8d16b4794717c347e69703e2950b8aec2..dd24b7e9f7842cd3cb928997bdc5d12fc6e833df 100644 (file)
@@ -36,15 +36,15 @@ libudev_core_sources = '''
         net/ethtool-util.h
 '''.split()
 
-if conf.get('HAVE_KMOD', false)
+if conf.get('HAVE_KMOD') == 1
         libudev_core_sources += ['udev-builtin-kmod.c']
 endif
 
-if conf.get('HAVE_BLKID', false)
+if conf.get('HAVE_BLKID') == 1
         libudev_core_sources += ['udev-builtin-blkid.c']
 endif
 
-if conf.get('HAVE_ACL', false)
+if conf.get('HAVE_ACL') == 1
         libudev_core_sources += ['udev-builtin-uaccess.c',
                                 logind_acl_c,
                                  sd_login_c]
index 6ece1250f25ce3092a7572e86c4f4decd1d9e1e2..a5f3b1a1b0f163dbec86170f5c138c201d639787 100644 (file)
@@ -58,7 +58,7 @@ static const char* const link_dirs[] = {
         "/etc/systemd/network",
         "/run/systemd/network",
         "/usr/lib/systemd/network",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
         "/lib/systemd/network",
 #endif
         NULL};
index 11d7085153fdea9b983f495d36777ff83bc99482..4487e826932c855379f8630e85d0a8edd8dc9ba6 100644 (file)
@@ -107,7 +107,7 @@ static void print_property(struct udev_device *dev, bool test, const char *name,
 
 static int find_gpt_root(struct udev_device *dev, blkid_probe pr, bool test) {
 
-#if defined(GPT_ROOT_NATIVE) && defined(ENABLE_EFI)
+#if defined(GPT_ROOT_NATIVE) && ENABLE_EFI
 
         _cleanup_free_ char *root_id = NULL;
         bool found_esp = false;
index cfaa4638044cf707248428d327f5b545edc5a067..4d59cc82a8beebf99659471280945b092e5fdaf6 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 
-#ifdef HAVE_LINUX_BTRFS_H
+#if HAVE_LINUX_BTRFS_H
 #include <linux/btrfs.h>
 #endif
 
index e6b36f124fdff21cf1e7285caf322016c42dd0b7..e4dccd0b099907b5fd0b8f2a74722355e2e324d9 100644 (file)
 static bool initialized;
 
 static const struct udev_builtin *builtins[] = {
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
         [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
 #endif
         [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
         [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
         [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
         [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
-#ifdef HAVE_KMOD
+#if HAVE_KMOD
         [UDEV_BUILTIN_KMOD] = &udev_builtin_kmod,
 #endif
         [UDEV_BUILTIN_NET_ID] = &udev_builtin_net_id,
         [UDEV_BUILTIN_NET_LINK] = &udev_builtin_net_setup_link,
         [UDEV_BUILTIN_PATH_ID] = &udev_builtin_path_id,
         [UDEV_BUILTIN_USB_ID] = &udev_builtin_usb_id,
-#ifdef HAVE_ACL
+#if HAVE_ACL
         [UDEV_BUILTIN_UACCESS] = &udev_builtin_uaccess,
 #endif
 };
index c0cb7eae84e74e09231d7b1b049c586e794a319e..2204db5a95b641e70ca9367ad59ce35022f7bf77 100644 (file)
@@ -146,21 +146,21 @@ int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg);
 
 /* built-in commands */
 enum udev_builtin_cmd {
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
         UDEV_BUILTIN_BLKID,
 #endif
         UDEV_BUILTIN_BTRFS,
         UDEV_BUILTIN_HWDB,
         UDEV_BUILTIN_INPUT_ID,
         UDEV_BUILTIN_KEYBOARD,
-#ifdef HAVE_KMOD
+#if HAVE_KMOD
         UDEV_BUILTIN_KMOD,
 #endif
         UDEV_BUILTIN_NET_ID,
         UDEV_BUILTIN_NET_LINK,
         UDEV_BUILTIN_PATH_ID,
         UDEV_BUILTIN_USB_ID,
-#ifdef HAVE_ACL
+#if HAVE_ACL
         UDEV_BUILTIN_UACCESS,
 #endif
         UDEV_BUILTIN_MAX
@@ -174,14 +174,14 @@ struct udev_builtin {
         bool (*validate)(struct udev *udev);
         bool run_once;
 };
-#ifdef HAVE_BLKID
+#if HAVE_BLKID
 extern const struct udev_builtin udev_builtin_blkid;
 #endif
 extern const struct udev_builtin udev_builtin_btrfs;
 extern const struct udev_builtin udev_builtin_hwdb;
 extern const struct udev_builtin udev_builtin_input_id;
 extern const struct udev_builtin udev_builtin_keyboard;
-#ifdef HAVE_KMOD
+#if HAVE_KMOD
 extern const struct udev_builtin udev_builtin_kmod;
 #endif
 extern const struct udev_builtin udev_builtin_net_id;
index f68d60a134a0c13c0069d47b14afa8a09f39e1d1..29facfded05fc8f5df5421352dcd974519cb99e3 100644 (file)
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
 #include <libaudit.h>
 #endif
 
@@ -42,7 +42,7 @@
 
 typedef struct Context {
         sd_bus *bus;
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         int audit_fd;
 #endif
 } Context;
@@ -125,7 +125,7 @@ static int on_reboot(Context *c) {
         /* We finished start-up, so let's write the utmp
          * record and send the audit msg */
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         if (c->audit_fd >= 0)
                 if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
                     errno != EPERM) {
@@ -154,7 +154,7 @@ static int on_shutdown(Context *c) {
         /* We started shut-down, so let's write the utmp
          * record and send the audit msg */
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         if (c->audit_fd >= 0)
                 if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
                     errno != EPERM) {
@@ -198,7 +198,7 @@ static int on_runlevel(Context *c) {
         if (previous == runlevel)
                 return 0;
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         if (c->audit_fd >= 0) {
                 _cleanup_free_ char *s = NULL;
 
@@ -223,7 +223,7 @@ static int on_runlevel(Context *c) {
 
 int main(int argc, char *argv[]) {
         Context c = {
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
                 .audit_fd = -1
 #endif
         };
@@ -245,7 +245,7 @@ int main(int argc, char *argv[]) {
 
         umask(0022);
 
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         /* If the kernel lacks netlink or audit support,
          * don't worry about it. */
         c.audit_fd = audit_open();
@@ -275,7 +275,7 @@ int main(int argc, char *argv[]) {
         log_debug("systemd-update-utmp stopped as pid "PID_FMT, getpid_cached());
 
 finish:
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
         if (c.audit_fd >= 0)
                 audit_close(c.audit_fd);
 #endif
index 1260b5353789d461cdd3c03898ddc31faf3f1ba7..120057cec1b6d7d5062fed54934e75c6c87285ee 100644 (file)
@@ -1,4 +1,4 @@
-if conf.get('ENABLE_VCONSOLE', false)
+if conf.get('ENABLE_VCONSOLE') == 1
         vconsole_rules = configure_file(
                 input : '90-vconsole.rules.in',
                 output : '90-vconsole.rules',
index 1b6707df7747436bfa00c03a0af808b58e49fe88..121874c7d2792ef1db738fda366fe2aa11eae2dc 100644 (file)
@@ -4,7 +4,7 @@ install_data(
 
 in_files = []
 
-if conf.get('ENABLE_COREDUMP', false)
+if conf.get('ENABLE_COREDUMP') == 1
         in_files += ['50-coredump.conf']
 endif
 
index b7c02cf8828614e8f39f29902acde925ab24da56..2f3f3ebd998b58f6206921dc388686f1e9111b33 100644 (file)
@@ -1,6 +1,6 @@
 in_files = ['basic.conf']
 
-enable_sysusers = conf.get('ENABLE_SYSUSERS', false)
+enable_sysusers = conf.get('ENABLE_SYSUSERS') == 1
 
 foreach file : in_files
         gen = configure_file(
@@ -15,7 +15,7 @@ endforeach
 
 m4_files = ['systemd.conf']
 
-if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
+if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
         m4_files += ['systemd-remote.conf']
 endif
 
index 991d3fcc925be4f8f69a66b10ad544cb59a7106d..236dbb04c35da60549ddb718b51c43faa9855583 100644 (file)
@@ -133,7 +133,7 @@ test_data_files = '''
         journal-data/journal-2.txt
 '''.split()
 
-if conf.get('ENABLE_RESOLVED', false)
+if conf.get('ENABLE_RESOLVED') == 1
         test_data_files += '''
                 test-resolve/_openpgpkey.fedoraproject.org.pkts
                 test-resolve/fedoraproject.org.pkts
index 7d21c64708a698659895f420bed0d6bf68f1baf5..9a594a289a4817231aa4a454b7f48594f954c0cf 100644 (file)
@@ -1,4 +1,4 @@
-enable_tmpfiles = conf.get('ENABLE_TMPFILES', false)
+enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1
 
 tmpfiles = [['home.conf',            ''],
             ['journal-nocow.conf',   ''],
@@ -12,7 +12,7 @@ tmpfiles = [['home.conf',            ''],
 foreach pair : tmpfiles
         if not enable_tmpfiles
                 # do nothing
-        elif pair[1] == '' or conf.get(pair[1], false)
+        elif pair[1] == '' or conf.get(pair[1]) == 1
                 install_data(pair[0], install_dir : tmpfilesdir)
         else
                 message('Not installing tmpfiles.d/@0@ because @1@ is @2@'
@@ -28,7 +28,7 @@ m4_files = [['etc.conf',             ''],
 foreach pair : m4_files
         if not enable_tmpfiles
                 # do nothing
-        elif pair[1] == '' or conf.get(pair[1], false)
+        elif pair[1] == '' or conf.get(pair[1]) == 1
                 custom_target(
                         'tmpfiles.d_' + pair[0],
                          input : pair[0] + '.m4',
index 2024d0bfa1a261fe50035633ce7ce403d4ab0698..f8ffe3fc45bd26f1e2d426618a7f3a60692b26ea 100644 (file)
@@ -244,8 +244,8 @@ foreach tuple : in_units
 
         # we do this here because install_data does not accept custom_target output
         conds = tuple[1].split(' ')
-        install = ((conds.get(0, '') == '' or conf.get(conds[0], false)) and
-                   (conds.get(1, '') == '' or conf.get(conds[1], false)))
+        install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
+                   (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
 
         gen1 = configure_file(
                 input : file + '.in',
@@ -273,8 +273,8 @@ foreach tuple : m4_units
 
         # we do this here because install_data does not accept custom_target output
         conds = tuple[1].split(' ')
-        install = ((conds.get(0, '') == '' or conf.get(conds[0], false)) and
-                   (conds.get(1, '') == '' or conf.get(conds[1], false)))
+        install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
+                   (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
 
         custom_target(
                 file,
@@ -297,8 +297,8 @@ foreach tuple : units
         input = tuple.get(3, file)
 
         conds = tuple[1].split(' ')
-        install = ((conds.get(0, '') == '' or conf.get(conds[0], false)) and
-                   (conds.get(1, '') == '' or conf.get(conds[1], false)))
+        install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
+                   (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
 
         if install
                 install_data(input,
@@ -321,7 +321,7 @@ meson.add_install_script(meson_make_symlink,
 meson.add_install_script(meson_make_symlink,
                          join_paths(dbussystemservicedir, 'org.freedesktop.systemd1.service'),
                          join_paths(dbussessionservicedir, 'org.freedesktop.systemd1.service'))
-if conf.get('HAVE_SYSV_COMPAT', false)
+if conf.get('HAVE_SYSV_COMPAT') == 1
         foreach i : [1, 2, 3, 4, 5]
                 meson.add_install_script(
                         'sh', '-c',