]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
build-sys: use #if Y instead of #ifdef Y everywhere
[thirdparty/systemd.git] / meson.build
index 0c6293dba42799a8e3b2f4e35d248f1129b96b5f..2b1da8a41b0d8b21da3903e10a61cb1a1cc9f761 100644 (file)
@@ -1,5 +1,5 @@
 project('systemd', 'c',
-        version : '233',
+        version : '235',
         license : 'LGPLv2+',
         default_options: [
                 'c_std=gnu99',
@@ -10,6 +10,9 @@ project('systemd', 'c',
         meson_version : '>= 0.40',
        )
 
+libsystemd_version = '0.19.0'
+libudev_version = '1.6.6'
+
 # We need the same data in three different formats, ugh!
 # Also, for hysterical reasons, we use different variable
 # names, sometimes. Not all variables are included in every
@@ -26,9 +29,17 @@ m4_defines = []
 
 #####################################################################
 
+# Try to install the git pre-commit hook
+git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
+if git_hook.returncode() == 0
+        message(git_hook.stdout().strip())
+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'
@@ -36,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
@@ -73,6 +83,7 @@ polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor
 varlogdir = join_paths(localstatedir, 'log')
 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
 rpmmacrosdir = get_option('rpmmacrosdir')
+modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
 
 # Our own paths
 pkgdatadir = join_paths(datadir, 'systemd')
@@ -230,7 +241,8 @@ if cxx.found()
         add_languages('cpp')
 endif
 
-foreach arg : ['-Wundef',
+foreach arg : ['-Wextra',
+               '-Wundef',
                '-Wlogical-op',
                '-Wmissing-include-dirs',
                '-Wold-style-definition',
@@ -275,7 +287,9 @@ endforeach
 foreach arg : ['unused-parameter',
                'missing-field-initializers',
                'unused-result',
-               'format-signedness']
+               'format-signedness',
+               'error=nonnull', # work-around for gcc 7.1 turning this on on its own
+              ]
         if cc.has_argument('-W' + arg)
                 add_project_arguments('-Wno-' + arg, language : 'c')
         endif
@@ -312,7 +326,6 @@ link_test_c = files('tools/meson-link-test.c')
 foreach arg : ['-Wl,-z,relro',
                '-Wl,-z,now',
                '-pie',
-               '-Wl,-fuse-ld=gold',
               ]
 
         have = run_command(check_compilation_sh,
@@ -363,6 +376,7 @@ conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h
 decl_headers = '''
 #include <uchar.h>
 #include <linux/ethtool.h>
+#include <linux/fib_rules.h>
 '''
 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
 
@@ -370,11 +384,12 @@ foreach decl : ['char16_t',
                 'char32_t',
                 'key_serial_t',
                 'struct ethtool_link_settings',
+                'struct fib_rule_uid_range',
                ]
 
         # 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'],
@@ -398,19 +413,16 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
                 ['IFLA_BR_VLAN_DEFAULT_PVID',        'linux/if_link.h'],
                 ['NDA_IFINDEX',                      'linux/neighbour.h'],
                 ['IFA_FLAGS',                        'linux/if_addr.h'],
+                ['FRA_UID_RANGE',                    'linux/fib_rules.h'],
                 ['LO_FLAGS_PARTSCAN',                'linux/loop.h'],
                ]
         prefix = decl.length() > 2 ? decl[2] : ''
         have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
-        conf.set10('HAVE_DECL_' + decl[0], have)
+        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 : [
@@ -429,19 +441,22 @@ foreach ident : [
                                  #include <keyutils.h>'''],
         ['copy_file_range',   '''#include <sys/syscall.h>
                                  #include <unistd.h>'''],
+        ['bpf',               '''#include <sys/syscall.h>
+                                 #include <unistd.h>'''],
         ['explicit_bzero' ,   '''#include <string.h>'''],
 ]
 
         have = cc.has_function(ident[0], prefix : ident[1])
-        conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
+        conf.set10('HAVE_' + ident[0].to_upper(), have)
 endforeach
 
 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
-        conf.set('USE_SYS_RANDOM_H', true)
-        conf.set10('HAVE_DECL_GETRANDOM', 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('HAVE_DECL_GETRANDOM', have)
+        conf.set10('USE_SYS_RANDOM_H', false)
+        conf.set10('HAVE_GETRANDOM', have)
 endif
 
 #####################################################################
@@ -452,7 +467,6 @@ awk = find_program('awk')
 m4 = find_program('m4')
 stat = find_program('stat')
 git = find_program('git', required : false)
-etags = find_program('etags', required : false)
 
 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
 mkdir_p = 'mkdir -p $DESTDIR/@0@'
@@ -527,17 +541,20 @@ endif
 foreach header : ['linux/btrfs.h',
                   'linux/memfd.h',
                   'linux/vm_sockets.h',
+                  'sys/auxv.h',
                   'valgrind/memcheck.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
 
 ############################################################
 
 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
+conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
+gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
 
 default_hierarchy = get_option('default-hierarchy')
 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
@@ -617,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)
 
 #####################################################################
 
@@ -644,45 +665,45 @@ if not libcap.found()
 endif
 
 libmount = dependency('mount',
-                      version : '>= 2.27')
+                      version : '>= 2.30')
 
 want_seccomp = get_option('seccomp')
 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 != ''
@@ -694,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',
@@ -704,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')
@@ -797,101 +826,143 @@ if want_libidn == 'true' and want_libidn2 == 'true'
         error('libidn and libidn2 cannot be requested simultaneously')
 endif
 
-if want_libidn2 != 'false' and want_libidn != 'true'
-        libidn = dependency('libidn2',
-                            required : want_libidn2 == 'true')
-        # libidn is used for both libidn and libidn2 objects
-        if libidn.found()
-                conf.set('HAVE_LIBIDN2', true)
-                m4_defines += ['-DHAVE_LIBIDN2']
-        endif
+if want_libidn != 'false' and want_libidn2 != 'true'
+        libidn = dependency('libidn',
+                            required : want_libidn == 'true')
+        have = libidn.found()
 else
+        have = false
         libidn = []
 endif
-if not conf.get('HAVE_LIBIDN2', false) and want_libidn != 'false'
-        libidn = dependency('libidn',
-                            required : want_libidn == 'true')
-        if libidn.found()
-                conf.set('HAVE_LIBIDN', true)
-                m4_defines += ['-DHAVE_LIBIDN']
-        endif
+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')
+        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 = 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')
+        have = libxkbcommon.found()
+else
+        have = false
+        libxkbcommon = []
+endif
+conf.set10('HAVE_XKBCOMMON', have)
 
 want_glib = get_option('glib')
 if want_glib != 'false'
@@ -904,52 +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
-
-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())
-else
-        libxkbcommon = []
-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
-
-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
-else
-        libgcrypt = []
-        libgpg_error = []
-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
@@ -959,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
@@ -981,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'],
@@ -1009,23 +1061,25 @@ foreach pair : [['utmp',          'HAVE_UTMP'],
                 ['rfkill',        'ENABLE_RFKILL'],
                 ['ldconfig',      'ENABLE_LDCONFIG'],
                 ['efi',           'ENABLE_EFI'],
-                ['tpm',           'SD_BOOT_LOG_TPM'],
+                ['tpm',           'ENABLE_TPM'],
                 ['ima',           'HAVE_IMA'],
                 ['smack',         'HAVE_SMACK'],
                 ['gshadow',       'ENABLE_GSHADOW'],
                 ['idn',           'ENABLE_IDN'],
+                ['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')
 install_tests = get_option('install-tests')
 tests = []
 
+conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
+
 #####################################################################
 
 if get_option('efi')
@@ -1048,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)
 
 #####################################################################
 
@@ -1077,6 +1134,7 @@ includes = include_directories('src/basic',
                                'src/libsystemd/sd-netlink',
                                'src/libsystemd/sd-network',
                                'src/libsystemd-network',
+                               '.',
                               )
 
 add_project_arguments('-include', 'config.h', language : 'c')
@@ -1105,7 +1163,7 @@ libsystemd = shared_library(
         'systemd',
         libsystemd_internal_sources,
         journal_internal_sources,
-        version : '0.18.0',
+        version : libsystemd_version,
         include_directories : includes,
         link_args : ['-shared',
                      '-Wl,--version-script=' + libsystemd_sym_path],
@@ -1162,11 +1220,11 @@ test_dlopen = executable(
         dependencies : [libdl])
 
 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
-                 ['systemd',    ''               ],
+                 ['systemd',    'ENABLE_NSS_SYSTEMD'],
                  ['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]
 
@@ -1294,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,
@@ -1308,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,
@@ -1326,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',
@@ -1347,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,
@@ -1377,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,
@@ -1410,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',
@@ -1434,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,
@@ -1444,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,
@@ -1476,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,
@@ -1486,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,
@@ -1504,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,
@@ -1542,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,
@@ -1560,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,
@@ -1578,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
@@ -1604,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,
@@ -1622,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,
@@ -1634,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,
@@ -1657,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,
@@ -1706,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,
@@ -1722,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,
@@ -1751,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,
@@ -1777,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,
@@ -1793,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,
@@ -1803,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,
@@ -1813,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,
@@ -2022,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,
@@ -2033,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,
@@ -2045,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',
@@ -2057,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,
@@ -2135,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,
@@ -2167,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,
@@ -2175,6 +2233,7 @@ if conf.get('ENABLE_NETWORKD', false)
                                 libsystemd_network,
                                 libudev_internal,
                                 libshared],
+                   dependencies : [threads],
                    install_rpath : rootlibexecdir,
                    install : true,
                    install_dir : rootlibexecdir)
@@ -2187,18 +2246,17 @@ if conf.get('ENABLE_NETWORKD', false)
                    install_rpath : rootlibexecdir,
                    install : true,
                    install_dir : rootlibexecdir)
-endif
 
-exe = executable('networkctl',
-                 networkctl_sources,
-                 include_directories : includes,
-                 link_with : [libsystemd_network,
+        exe = executable('networkctl',
+                   networkctl_sources,
+                   include_directories : includes,
+                   link_with : [libsystemd_network,
                               libshared],
-                 install_rpath : rootlibexecdir,
-                 install : true,
-                 install_dir : rootbindir)
-public_programs += [exe]
-
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootbindir)
+        public_programs += [exe]
+endif
 ############################################################
 
 foreach tuple : tests
@@ -2217,9 +2275,7 @@ foreach tuple : tests
                 type = ''
         endif
 
-        if condition == '' or conf.get(condition, false)
-                install = install_tests and type == ''
-
+        if condition == '' or conf.get(condition) == 1
                 exe = executable(
                         name,
                         sources,
@@ -2228,8 +2284,8 @@ foreach tuple : tests
                         dependencies : dependencies,
                         c_args : defs,
                         install_rpath : rootlibexecdir,
-                        install : install,
-                        install_dir : testsdir)
+                        install : install_tests,
+                        install_dir : join_paths(testsdir, type))
 
                 if type == 'manual'
                         message('@0@ is a manual test'.format(name))
@@ -2296,6 +2352,8 @@ install_data('xorg/50-systemd-user.sh',
              install_dir : xinitrcdir)
 install_data('system-preset/90-systemd.preset',
              install_dir : systempresetdir)
+install_data('modprobe.d/systemd.conf',
+             install_dir : modprobedir)
 install_data('README',
              'NEWS',
              'CODING_STYLE',
@@ -2322,18 +2380,22 @@ endforeach
 
 ############################################################
 
-if git.found() and etags.found()
+if git.found()
         all_files = run_command(
                 git,
-                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
                  'ls-files',
                  ':/*.[ch]'])
         all_files = files(all_files.stdout().split())
 
-        run_target(
-                'TAGS',
-                input : all_files,
-                command : [etags, '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
+        custom_target(
+                'tags',
+                output : 'tags',
+                command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
+        custom_target(
+                'ctags',
+                output : 'ctags',
+                command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
 endif
 
 if git.found()
@@ -2346,17 +2408,17 @@ endif
 if git.found()
         git_head = run_command(
                 git,
-                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
                  'rev-parse', 'HEAD']).stdout().strip()
         git_head_short = run_command(
                 git,
-                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
                  'rev-parse', '--short=7', 'HEAD']).stdout().strip()
 
         run_target(
                 'git-snapshot',
                 command : ['git', 'archive',
-                           '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
+                           '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
                                                                  git_head_short),
                            '--prefix', 'systemd-@0@/'.format(git_head),
                            'HEAD'])
@@ -2378,6 +2440,7 @@ status = [
         'PAM modules dir:                   @0@'.format(pamlibdir),
         'PAM configuration dir:             @0@'.format(pamconfdir),
         'RPM macros dir:                    @0@'.format(rpmmacrosdir),
+        'modprobe.d dir:                    @0@'.format(modprobedir),
         'D-Bus policy dir:                  @0@'.format(dbuspolicydir),
         'D-Bus session dir:                 @0@'.format(dbussessionservicedir),
         'D-Bus system dir:                  @0@'.format(dbussystemservicedir),
@@ -2396,6 +2459,7 @@ status = [
         'nobody user name:                  @0@'.format(get_option('nobody-user')),
         'nobody group name:                 @0@'.format(get_option('nobody-group')),
         'fallback hostname:                 @0@'.format(get_option('fallback-hostname')),
+        'symbolic gateway hostnames:        @0@'.format(', '.join(gateway_hostnames)),
 
         'default DNSSEC mode:               @0@'.format(default_dnssec),
         'default cgroup hierarchy:          @0@'.format(default_hierarchy),
@@ -2417,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)]
 
@@ -2456,6 +2520,7 @@ foreach tuple : [
         ['idn'],
         ['libidn2'],
         ['libidn'],
+        ['nss-systemd'],
         ['libiptc'],
         ['elfutils'],
         ['binfmt'],
@@ -2487,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'],
@@ -2509,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]]
@@ -2519,6 +2584,9 @@ foreach tuple : [
 endforeach
 
 status += [
+        '',
         'enabled features: @0@'.format(', '.join(found)),
-        'disabled features: @0@'.format(', '.join(missing))]
+        '',
+        'disabled features: @0@'.format(', '.join(missing)),
+        '']
 message('\n         '.join(status))