]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
Merge pull request #6058 from keszybz/chrooted-test-fixes
[thirdparty/systemd.git] / meson.build
index 949f63611bd032193b41bc5214fd0f055ff244be..f932d06a5324dba90321ac4eaf2da17dcfe03a8f 100644 (file)
@@ -7,7 +7,7 @@ project('systemd', 'c',
                 'sysconfdir=/etc',
                 'localstatedir=/var',
         ],
-        meson_version : '>= 0.39.1',
+        meson_version : '>= 0.40',
        )
 
 # We need the same data in three different formats, ugh!
@@ -28,7 +28,7 @@ m4_defines = []
 
 rootprefixdir = get_option('rootprefix')
 if get_option('split-usr')
-        conf.set('HAVE_SPLIT_USR', 1)
+        conf.set('HAVE_SPLIT_USR', true)
         rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
 else
         rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
@@ -37,7 +37,7 @@ endif
 sysvinit_path = get_option('sysvinit-path')
 sysvrcnd_path = get_option('sysvrcnd-path')
 if sysvinit_path != '' or sysvrcnd_path != ''
-        conf.set('HAVE_SYSV_COMPAT', 1,
+        conf.set('HAVE_SYSV_COMPAT', true,
                  description : 'SysV init scripts and rcN.d links are supported')
         m4_defines += ['-DHAVE_SYSV_COMPAT']
 endif
@@ -222,6 +222,13 @@ substs.set('RC_LOCAL_SCRIPT_PATH_STOP',                       get_option('halt-l
 
 cc = meson.get_compiler('c')
 pkgconfig = import('pkgconfig')
+check_compilation_sh = find_program('tools/meson-check-compilation.sh')
+
+cxx = find_program('c++', required : false)
+if cxx.found()
+        #  Used only for tests
+        add_languages('cpp')
+endif
 
 foreach arg : ['-Wundef',
                '-Wlogical-op',
@@ -245,10 +252,6 @@ foreach arg : ['-Wundef',
                '-Wendif-labels',
                '-Wstrict-aliasing=2',
                '-Wwrite-strings',
-               '-Wno-unused-parameter',
-               '-Wno-missing-field-initializers',
-               '-Wno-unused-result',
-               '-Wno-format-signedness',
                '-Werror=overflow',
                '-Wdate-time',
                '-Wnested-externs',
@@ -267,6 +270,17 @@ foreach arg : ['-Wundef',
         endif
 endforeach
 
+# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
+# arguments, just emits a warnings. So test for the "positive" version instead.
+foreach arg : ['unused-parameter',
+               'missing-field-initializers',
+               'unused-result',
+               'format-signedness']
+        if cc.has_argument('-W' + arg)
+                add_project_arguments('-Wno-' + arg, language : 'c')
+        endif
+endforeach
+
 if cc.compiles('
    #include <time.h>
    #include <inttypes.h>
@@ -276,8 +290,7 @@ if cc.compiles('
            struct timespec now;
            return 0;
    }
-')
-        # TODO: message?
+', name : '-Werror=shadow with local shadowing')
         add_project_arguments('-Werror=shadow', language : 'c')
 endif
 
@@ -285,12 +298,15 @@ if cc.get_id() == 'clang'
         foreach arg : ['-Wno-typedef-redefinition',
                        '-Wno-gnu-variable-sized-type-not-at-end',
                       ]
-                if cc.has_argument(arg)
+                if cc.has_argument(arg,
+                                   name : '@0@ is supported'.format(arg))
                         add_project_arguments(arg, language : 'c')
                 endif
         endforeach
 endif
 
+link_test_c = files('tools/meson-link-test.c')
+
 # --as-needed and --no-undefined are provided by meson by default,
 # run mesonconf to see what is enabled
 foreach arg : ['-Wl,-z,relro',
@@ -298,7 +314,12 @@ foreach arg : ['-Wl,-z,relro',
                '-pie',
                '-Wl,-fuse-ld=gold',
               ]
-        if cc.has_argument(arg)
+
+        have = run_command(check_compilation_sh,
+                           cc.cmd_array(), '-x', 'c', arg,
+                           '-include', link_test_c).returncode() == 0
+        message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
+        if have
                 add_project_link_arguments(arg, language : 'c')
         endif
 endforeach
@@ -306,13 +327,18 @@ endforeach
 if get_option('buildtype') != 'debug'
         foreach arg : ['-ffunction-sections',
                        '-fdata-sections']
-                if cc.has_argument(arg)
+                if cc.has_argument(arg,
+                                   name : '@0@ is supported'.format(arg))
                         add_project_arguments(arg, language : 'c')
                 endif
         endforeach
 
         foreach arg : ['-Wl,--gc-sections']
-                if cc.has_argument(arg)
+                have = run_command(check_compilation_sh,
+                                   cc.cmd_array(), '-x', 'c', arg,
+                                   '-include', link_test_c).returncode() == 0
+                message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
+                if have
                         add_project_link_arguments(arg, language : 'c')
                 endif
         endforeach
@@ -323,8 +349,8 @@ cpp = ' '.join(cc.cmd_array()) + ' -E'
 #####################################################################
 # compilation result tests
 
-conf.set('_GNU_SOURCE', 1)
-conf.set('__SANE_USERSPACE_TYPES__', 1)
+conf.set('_GNU_SOURCE', true)
+conf.set('__SANE_USERSPACE_TYPES__', true)
 
 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
@@ -345,10 +371,10 @@ foreach decl : ['char16_t',
                 'key_serial_t',
                 'struct ethtool_link_settings',
                ]
-        if cc.sizeof(decl, prefix : decl_headers) > 0
-                # We get -1 if the size cannot be determined
-                conf.set('HAVE_' + decl.underscorify().to_upper(), 1)
-        endif
+
+        # 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)
 endforeach
 
 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
@@ -361,6 +387,7 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
                 ['IFLA_VLAN_PROTOCOL',               'linux/if_link.h'],
                 ['IFLA_VXLAN_REMCSUM_NOPARTIAL',     'linux/if_link.h'],
                 ['IFLA_VXLAN_GPE',                   'linux/if_link.h'],
+                ['IFLA_GENEVE_LABEL',                'linux/if_link.h'],
                 # if_tunnel.h is buggy and cannot be included on its own
                 ['IFLA_VTI_REMOTE',                  'linux/if_tunnel.h', '#include <net/if.h>'],
                 ['IFLA_IPTUN_ENCAP_DPORT',           'linux/if_tunnel.h', '#include <net/if.h>'],
@@ -381,7 +408,7 @@ endforeach
 skip = false
 foreach ident : ['secure_getenv', '__secure_getenv']
         if not skip and cc.has_function(ident)
-                conf.set('HAVE_' + ident.to_upper(), 1)
+                conf.set('HAVE_' + ident.to_upper(), true)
                 skip = true
         endif
 endforeach
@@ -410,8 +437,8 @@ foreach ident : [
 endforeach
 
 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
-        conf.set('USE_SYS_RANDOM_H', 1)
-        conf.set10('HAVE_DECL_GETRANDOM', 1)
+        conf.set('USE_SYS_RANDOM_H', true)
+        conf.set10('HAVE_DECL_GETRANDOM', true)
 else
         have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
         conf.set10('HAVE_DECL_GETRANDOM', have)
@@ -422,14 +449,13 @@ endif
 sed = find_program('sed')
 grep = find_program('grep')
 awk = find_program('awk')
-m4 = find_program('/usr/bin/m4')
+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@'
-check_compilation_sh = find_program('tools/meson-check-compilation.sh')
 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
 splash_bmp = files('test/splash.bmp')
 
@@ -504,9 +530,9 @@ foreach header : ['linux/btrfs.h',
                   'valgrind/memcheck.h',
                   'valgrind/valgrind.h',
                  ]
-        if cc.has_header(header)
-                conf.set('HAVE_' + header.underscorify().to_upper(), 1)
-        endif
+
+        conf.set('HAVE_' + header.underscorify().to_upper(),
+                 cc.has_header(header))
 endforeach
 
 ############################################################
@@ -542,7 +568,7 @@ endif
 system_uid_max = system_uid_max.to_int()
 conf.set('SYSTEM_UID_MAX', system_uid_max)
 substs.set('systemuidmax', system_uid_max)
-message('Maximum system UID is @0@'.format(system_uid_max))
+message('maximum system UID is @0@'.format(system_uid_max))
 
 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
@@ -557,7 +583,7 @@ endif
 system_gid_max = system_gid_max.to_int()
 conf.set('SYSTEM_GID_MAX', system_gid_max)
 substs.set('systemgidmax', system_gid_max)
-message('Maximum system GID is @0@'.format(system_gid_max))
+message('maximum system GID is @0@'.format(system_gid_max))
 
 tty_gid = get_option('tty-gid')
 conf.set('TTY_GID', tty_gid)
@@ -582,17 +608,32 @@ conf.set('DEFAULT_DNSSEC_MODE',
          'DNSSEC_' + default_dnssec.underscorify().to_upper())
 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
 
-conf.set_quoted('DNS_SERVERS', get_option('dns-servers'))
-substs.set('DNS_SERVERS', get_option('dns-servers'))
+dns_servers = get_option('dns-servers')
+conf.set_quoted('DNS_SERVERS', dns_servers)
+substs.set('DNS_SERVERS', dns_servers)
 
-conf.set_quoted('NTP_SERVERS', get_option('ntp-servers'))
-substs.set('NTP_SERVERS', get_option('ntp-servers'))
+ntp_servers = get_option('ntp-servers')
+conf.set_quoted('NTP_SERVERS', ntp_servers)
+substs.set('NTP_SERVERS', ntp_servers)
 
 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
 
 substs.set('SUSHELL', get_option('debug-shell'))
 substs.set('DEBUGTTY', get_option('debug-tty'))
 
+debug = get_option('debug')
+if debug != ''
+        foreach name : debug.split(',')
+                if name == 'hashmap'
+                        conf.set('ENABLE_DEBUG_HASHMAP', true)
+                elif name == 'mmap-cache'
+                        conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
+                else
+                        message('unknown debug option "@0@", ignoring'.format(name))
+                endif
+        endforeach
+endif
+
 #####################################################################
 
 threads = dependency('threads')
@@ -601,16 +642,22 @@ libm = cc.find_library('m')
 libdl = cc.find_library('dl')
 libcrypt = cc.find_library('crypt')
 
-libcap = dependency('libcap')
+libcap = dependency('libcap', required : false)
+if not libcap.found()
+        # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
+        libcap = cc.find_library('cap')
+endif
+
 libmount = dependency('mount',
                       version : '>= 2.27')
 
 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', 1)
+                conf.set('HAVE_SECCOMP', true)
                 m4_defines += ['-DHAVE_SECCOMP']
         endif
 else
@@ -623,7 +670,7 @@ if want_selinux != 'false'
                                 version : '>= 2.1.9',
                                 required : want_selinux == 'true')
         if libselinux.found()
-                conf.set('HAVE_SELINUX', 1)
+                conf.set('HAVE_SELINUX', true)
                 m4_defines += ['-DHAVE_SELINUX']
         endif
 else
@@ -635,25 +682,13 @@ if want_apparmor != 'false'
         libapparmor = dependency('libapparmor',
                                  required : want_apparmor == 'true')
         if libapparmor.found()
-                conf.set('HAVE_APPARMOR', 1)
+                conf.set('HAVE_APPARMOR', true)
                 m4_defines += ['-DHAVE_APPARMOR']
         endif
 else
         libapparmor = []
 endif
 
-want_smack = get_option('smack')
-if want_smack != 'false'
-        libsmack = dependency('libsmack',
-                              required : want_smack == 'true')
-        if libsmack.found()
-                conf.set('HAVE_SMACK', 1)
-                m4_defines += ['-DHAVE_SMACK']
-        endif
-else
-        libsmack = []
-endif
-
 smack_run_label = get_option('smack-run-label')
 if smack_run_label != ''
         conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
@@ -664,7 +699,7 @@ want_polkit = get_option('polkit')
 install_polkit = false
 install_polkit_pkla = false
 if want_polkit != 'false'
-        conf.set('ENABLE_POLKIT', 1)
+        conf.set('ENABLE_POLKIT', true)
         install_polkit = true
 
         libpolkit = dependency('polkit-gobject-1',
@@ -679,7 +714,7 @@ 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', 1)
+                conf.set('HAVE_ACL', true)
                 m4_defines += ['-DHAVE_ACL']
         endif
 else
@@ -689,9 +724,7 @@ endif
 want_audit = get_option('audit')
 if want_audit != 'false'
         libaudit = dependency('audit', required : want_audit == 'true')
-        if libaudit.found()
-                conf.set('HAVE_AUDIT', 1)
-        endif
+        conf.set('HAVE_AUDIT', libaudit.found())
 else
         libaudit = []
 endif
@@ -699,9 +732,7 @@ endif
 want_blkid = get_option('blkid')
 if want_blkid != 'false'
         libblkid = dependency('blkid', required : want_blkid == 'true')
-        if libblkid.found()
-                conf.set('HAVE_BLKID', 1)
-        endif
+        conf.set('HAVE_BLKID', libblkid.found())
 else
         libblkid = []
 endif
@@ -711,9 +742,7 @@ if want_kmod != 'false'
         libkmod = dependency('libkmod',
                              version : '>= 15',
                              required : want_kmod == 'true')
-        if libkmod.found()
-                conf.set('HAVE_KMOD', 1)
-        endif
+        conf.set('HAVE_KMOD', libkmod.found())
 else
         libkmod = []
 endif
@@ -723,7 +752,7 @@ 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', 1)
+                conf.set('HAVE_PAM', true)
                 m4_defines += ['-DHAVE_PAM']
         endif
 else
@@ -737,7 +766,7 @@ if want_microhttpd != 'false'
                                    version : '>= 0.9.33',
                                    required : want_microhttpd == 'true')
         if libmicrohttpd.found()
-                conf.set('HAVE_MICROHTTPD', 1)
+                conf.set('HAVE_MICROHTTPD', true)
                 m4_defines += ['-DHAVE_MICROHTTPD']
         endif
 else
@@ -749,9 +778,7 @@ if want_libcryptsetup != 'false'
         libcryptsetup = dependency('libcryptsetup',
                                    version : '>= 1.6.0',
                                    required : want_libcryptsetup == 'true')
-        if libcryptsetup.found()
-                conf.set('HAVE_LIBCRYPTSETUP', 1)
-        endif
+        conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
 else
         libcryptsetup = []
 endif
@@ -762,7 +789,7 @@ if want_libcurl != 'false'
                              version : '>= 7.32.0',
                              required : want_libcurl == 'true')
         if libcurl.found()
-                conf.set('HAVE_LIBCURL', 1)
+                conf.set('HAVE_LIBCURL', true)
                 m4_defines += ['-DHAVE_LIBCURL']
         endif
 else
@@ -770,15 +797,29 @@ else
 endif
 
 want_libidn = get_option('libidn')
-if want_libidn != 'false'
+want_libidn2 = get_option('libidn2')
+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
+else
+        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', 1)
+                conf.set('HAVE_LIBIDN', true)
                 m4_defines += ['-DHAVE_LIBIDN']
         endif
-else
-        libidn = []
 endif
 
 want_libiptc = get_option('libiptc')
@@ -786,7 +827,7 @@ if want_libiptc != 'false'
         libiptc = dependency('libiptc',
                              required : want_libiptc == 'true')
         if libiptc.found()
-                conf.set('HAVE_LIBIPTC', 1)
+                conf.set('HAVE_LIBIPTC', true)
                 m4_defines += ['-DHAVE_LIBIPTC']
         endif
 else
@@ -797,9 +838,7 @@ want_qrencode = get_option('qrencode')
 if want_qrencode != 'false'
         libqrencode = dependency('libqrencode',
                                  required : want_qrencode == 'true')
-        if libqrencode.found()
-                conf.set('HAVE_QRENCODE', 1)
-        endif
+        conf.set('HAVE_QRENCODE', libqrencode.found())
 else
         libqrencode = []
 endif
@@ -809,9 +848,7 @@ if want_gnutls != 'false'
         libgnutls = dependency('gnutls',
                                version : '>= 3.1.4',
                                required : want_gnutls == 'true')
-        if libgnutls.found()
-                conf.set('HAVE_GNUTLS', 1)
-        endif
+        conf.set('HAVE_GNUTLS', libgnutls.found())
 else
         libgnutls = []
 endif
@@ -820,9 +857,7 @@ want_elfutils = get_option('elfutils')
 if want_elfutils != 'false'
         libdw = dependency('libdw',
                            required : want_elfutils == 'true')
-        if libdw.found()
-                conf.set('HAVE_ELFUTILS', 1)
-        endif
+        conf.set('HAVE_ELFUTILS', libdw.found())
 else
         libdw = []
 endif
@@ -831,9 +866,7 @@ want_zlib = get_option('zlib')
 if want_zlib != 'false'
         libz = dependency('zlib',
                           required : want_zlib == 'true')
-        if libz.found()
-                conf.set('HAVE_ZLIB', 1)
-        endif
+        conf.set('HAVE_ZLIB', libz.found())
 else
         libz = []
 endif
@@ -842,9 +875,7 @@ want_bzip2 = get_option('bzip2')
 if want_bzip2 != 'false'
         libbzip2 = cc.find_library('bz2',
                                    required : want_bzip2 == 'true')
-        if libbzip2.found()
-                conf.set('HAVE_BZIP2', 1)
-        endif
+        conf.set('HAVE_BZIP2', libbzip2.found())
 else
         libbzip2 = []
 endif
@@ -853,9 +884,7 @@ want_xz = get_option('xz')
 if want_xz != 'false'
         libxz = dependency('liblzma',
                            required : want_xz == 'true')
-        if libxz.found()
-                conf.set('HAVE_XZ', 1)
-        endif
+        conf.set('HAVE_XZ', libxz.found())
 else
         libxz = []
 endif
@@ -864,9 +893,7 @@ want_lz4 = get_option('lz4')
 if want_lz4 != 'false'
         liblz4 = dependency('liblz4',
                             required : want_lz4 == 'true')
-        if liblz4.found()
-                conf.set('HAVE_LZ4', 1)
-        endif
+        conf.set('HAVE_LZ4', liblz4.found())
 else
         liblz4 = []
 endif
@@ -881,9 +908,8 @@ if want_glib != 'false'
                                 required : want_glib == 'true')
         libgio =     dependency('gio-2.0',
                                 required : want_glib == 'true')
-        if libglib.found() and libgobject.found() and libgio.found()
-                conf.set('HAVE_GLIB', 1)
-        endif
+        have = libglib.found() and libgobject.found() and libgio.found()
+        conf.set('HAVE_GLIB', have)
 else
         libglib = []
         libgobject = []
@@ -895,9 +921,7 @@ if want_xkbcommon != 'false'
         libxkbcommon = dependency('xkbcommon',
                                   version : '>= 0.3.0',
                                   required : want_xkbcommon == 'true')
-        if libxkbcommon.found()
-                conf.set('HAVE_XKBCOMMON', 1)
-        endif
+        conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
 else
         libxkbcommon = []
 endif
@@ -907,9 +931,7 @@ if want_dbus != 'false'
         libdbus = dependency('dbus-1',
                              version : '>= 1.3.2',
                              required : want_dbus == 'true')
-        if libdbus.found()
-                conf.set('HAVE_DBUS', 1)
-        endif
+        conf.set('HAVE_DBUS', libdbus.found())
 else
         libdbus = []
 endif
@@ -919,9 +941,9 @@ if want_gcrypt != 'false'
         libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
         libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
 
-        if libgcrypt.found() and libgpg_error.found()
-                conf.set('HAVE_GCRYPT', 1)
-        else
+        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 = []
@@ -933,22 +955,21 @@ endif
 
 want_importd = get_option('importd')
 if want_importd != 'false'
-        have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and
-                     conf.get('HAVE_ZLIB', 0) == 1 and
-                     conf.get('HAVE_BZIP2', 0) == 1 and
-                     conf.get('HAVE_XZ', 0) == 1 and
-                     conf.get('HAVE_GCRYPT', 0) == 1)
-        if have_deps
-                conf.set('ENABLE_IMPORTD', 1)
-        elif want_importd == 'true'
+        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
                 error('importd support was requested, but dependencies are not available')
         endif
 endif
 
 want_remote = get_option('remote')
 if want_remote != 'false'
-        have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1,
-                     conf.get('HAVE_LIBCURL', 0) == 1]
+        have_deps = [conf.get('HAVE_MICROHTTPD', false),
+                     conf.get('HAVE_LIBCURL', false)]
         # 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
@@ -956,9 +977,7 @@ 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
-        if have_deps[0] or have_deps[1]
-                conf.set('ENABLE_REMOTE', 1)
-        endif
+        conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
 endif
 
 foreach pair : [['utmp',          'HAVE_UTMP'],
@@ -986,11 +1005,14 @@ foreach pair : [['utmp',          'HAVE_UTMP'],
                 ['rfkill',        'ENABLE_RFKILL'],
                 ['ldconfig',      'ENABLE_LDCONFIG'],
                 ['efi',           'ENABLE_EFI'],
+                ['tpm',           'SD_BOOT_LOG_TPM'],
                 ['ima',           'HAVE_IMA'],
+                ['smack',         'HAVE_SMACK'],
+                ['gshadow',       'ENABLE_GSHADOW'],
                ]
 
         if get_option(pair[0])
-                conf.set(pair[1], 1)
+                conf.set(pair[1], true)
                 m4_defines += ['-D' + pair[1]]
         endif
 endforeach
@@ -1021,8 +1043,10 @@ if get_option('efi')
                 gnu_efi_arch = ''
         endif
 
-        conf.set('ENABLE_EFI', 1)
+        conf.set('ENABLE_EFI', true)
         conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
+
+        conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
 endif
 
 #####################################################################
@@ -1132,15 +1156,14 @@ test_dlopen = executable(
         link_with : [libbasic],
         dependencies : [libdl])
 
-foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
-                 ['systemd',     '',               []],
-                 ['mymachines', 'ENABLE_MACHINED', []],
-                 ['resolve',    'ENABLE_RESOLVED', [libdl]]]
+foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
+                 ['systemd',    ''               ],
+                 ['mymachines', 'ENABLE_MACHINED'],
+                 ['resolve',    'ENABLE_RESOLVED']]
 
-        condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1
+        condition = tuple[1] == '' or conf.get(tuple[1], false)
         if condition
                 module = tuple[0]
-                extra_deps = tuple[2]
 
                 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
                 version_script_arg = join_paths(meson.current_source_dir(), sym)
@@ -1156,7 +1179,7 @@ foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
                         link_with : [libsystemd_internal,
                                      libbasic],
                         dependencies : [threads,
-                                        librt] + extra_deps,
+                                        librt],
                         link_depends : sym,
                         install : true,
                         install_dir : rootlibdir)
@@ -1179,8 +1202,7 @@ executable('systemd',
            systemd_sources,
            include_directories : includes,
            link_with : [libcore,
-                        libshared,
-                        libudev],
+                        libshared],
            dependencies : [threads,
                            librt,
                            libseccomp,
@@ -1195,7 +1217,6 @@ exe = executable('systemd-analyze',
                  systemd_analyze_sources,
                  include_directories : includes,
                  link_with : [libcore,
-                              libudev,
                               libshared],
                  dependencies : [threads,
                                  librt,
@@ -1211,8 +1232,7 @@ executable('systemd-journald',
            systemd_journald_sources,
            include_directories : includes,
            link_with : [libjournal_core,
-                        libshared,
-                        libudev],
+                        libshared],
            dependencies : [threads,
                            libxz,
                            liblz4,
@@ -1225,8 +1245,7 @@ exe = executable('systemd-cat',
                  systemd_cat_sources,
                  include_directories : includes,
                  link_with : [libjournal_core,
-                              libshared,
-                              libudev],
+                              libshared],
                  dependencies : [threads],
                  install_rpath : rootlibexecdir,
                  install : true)
@@ -1235,8 +1254,7 @@ public_programs += [exe]
 exe = executable('journalctl',
                  journalctl_sources,
                  include_directories : includes,
-                 link_with : [libshared,
-                              libudev],
+                 link_with : [libshared],
                  dependencies : [threads,
                                  libqrencode,
                                  libxz,
@@ -1271,7 +1289,7 @@ executable('systemd-fstab-generator',
            install : true,
            install_dir : systemgeneratordir)
 
-if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1
+if conf.get('ENABLE_ENVIRONMENT_D', false)
         executable('30-systemd-environment-d-generator',
                    'src/environment-d-generator/environment-d-generator.c',
                    include_directories : includes,
@@ -1285,7 +1303,7 @@ if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1
                                  join_paths(environmentdir, '99-environment.conf'))
 endif
 
-if conf.get('ENABLE_HIBERNATE', 0) == 1
+if conf.get('ENABLE_HIBERNATE', false)
         executable('systemd-hibernate-resume-generator',
                    'src/hibernate-resume/hibernate-resume-generator.c',
                    include_directories : includes,
@@ -1303,13 +1321,12 @@ if conf.get('ENABLE_HIBERNATE', 0) == 1
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('HAVE_BLKID', 0) == 1
+if conf.get('HAVE_BLKID', false)
         executable('systemd-gpt-auto-generator',
                    'src/gpt-auto-generator/gpt-auto-generator.c',
                    'src/basic/blkid-util.h',
                    include_directories : includes,
-                   link_with : [libshared,
-                                libudev],
+                   link_with : [libshared],
                    dependencies : libblkid,
                    install_rpath : rootlibexecdir,
                    install : true,
@@ -1325,7 +1342,7 @@ if conf.get('HAVE_BLKID', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_RESOLVED', 0) == 1
+if conf.get('ENABLE_RESOLVED', false)
         executable('systemd-resolved',
                    systemd_resolved_sources,
                    gcrypt_util_sources,
@@ -1355,13 +1372,12 @@ if conf.get('ENABLE_RESOLVED', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_LOGIND', 0) == 1
+if conf.get('ENABLE_LOGIND', false)
         executable('systemd-logind',
                    systemd_logind_sources,
                    include_directories : includes,
                    link_with : [liblogind_core,
-                                libshared,
-                                libudev],
+                                libshared],
                    dependencies : [threads,
                                    libacl],
                    install_rpath : rootlibexecdir,
@@ -1371,8 +1387,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1
         exe = executable('loginctl',
                          loginctl_sources,
                          include_directories : includes,
-                         link_with : [libshared,
-                                      libudev],
+                         link_with : [libshared],
                          dependencies : [threads,
                                          liblz4,
                                          libxz],
@@ -1390,7 +1405,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1
                          install_dir : rootbindir)
         public_programs += [exe]
 
-        if conf.get('HAVE_PAM', 0) == 1
+        if conf.get('HAVE_PAM', false)
                 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
                 pam_systemd = shared_library(
                         'pam_systemd',
@@ -1414,7 +1429,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1
         endif
 endif
 
-if conf.get('HAVE_PAM', 0) == 1
+if conf.get('HAVE_PAM', false)
         executable('systemd-user-sessions',
                    'src/user-sessions/user-sessions.c',
                    include_directories : includes,
@@ -1424,7 +1439,7 @@ if conf.get('HAVE_PAM', 0) == 1
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1
+if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
         exe = executable('bootctl',
                          'src/boot/bootctl.c',
                          include_directories : includes,
@@ -1456,23 +1471,21 @@ exe = executable('systemctl', 'src/systemctl/systemctl.c',
                  install_dir : rootbindir)
 public_programs += [exe]
 
-if conf.get('ENABLE_BACKLIGHT', 0) == 1
+if conf.get('ENABLE_BACKLIGHT', false)
         executable('systemd-backlight',
                    'src/backlight/backlight.c',
                    include_directories : includes,
-                   link_with : [libshared,
-                                libudev],
+                   link_with : [libshared],
                    install_rpath : rootlibexecdir,
                    install : true,
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_RFKILL', 0) == 1
+if conf.get('ENABLE_RFKILL', false)
         executable('systemd-rfkill',
                    'src/rfkill/rfkill.c',
                    include_directories : includes,
-                   link_with : [libshared,
-                                libudev],
+                   link_with : [libshared],
                    install_rpath : rootlibexecdir,
                    install : true,
                    install_dir : rootlibexecdir)
@@ -1486,7 +1499,7 @@ executable('systemd-system-update-generator',
            install : true,
            install_dir : systemgeneratordir)
 
-if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1
+if conf.get('HAVE_LIBCRYPTSETUP', false)
         executable('systemd-cryptsetup',
                    'src/cryptsetup/cryptsetup.c',
                    include_directories : includes,
@@ -1524,7 +1537,7 @@ if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1
                    install_dir : systemgeneratordir)
 endif
 
-if conf.get('HAVE_SYSV_COMPAT', 0) == 1
+if conf.get('HAVE_SYSV_COMPAT', false)
         executable('systemd-sysv-generator',
                    'src/sysv-generator/sysv-generator.c',
                    include_directories : includes,
@@ -1542,7 +1555,7 @@ if conf.get('HAVE_SYSV_COMPAT', 0) == 1
                    install_dir : systemgeneratordir)
 endif
 
-if conf.get('ENABLE_HOSTNAMED', 0) == 1
+if conf.get('ENABLE_HOSTNAMED', false)
         executable('systemd-hostnamed',
                    'src/hostname/hostnamed.c',
                    include_directories : includes,
@@ -1560,8 +1573,8 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_LOCALED', 0) == 1
-        if conf.get('HAVE_XKBCOMMON', 0) == 1
+if conf.get('ENABLE_LOCALED', false)
+        if conf.get('HAVE_XKBCOMMON', false)
                 # logind will load libxkbcommon.so dynamically on its own
                 deps = [libdl]
         else
@@ -1586,7 +1599,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_TIMEDATED', 0) == 1
+if conf.get('ENABLE_TIMEDATED', false)
         executable('systemd-timedated',
                    'src/timedate/timedated.c',
                    include_directories : includes,
@@ -1604,7 +1617,7 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_TIMESYNCD', 0) == 1
+if conf.get('ENABLE_TIMESYNCD', false)
         executable('systemd-timesyncd',
                    systemd_timesyncd_sources,
                    include_directories : includes,
@@ -1616,7 +1629,7 @@ if conf.get('ENABLE_TIMESYNCD', 0) == 1
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_MACHINED', 0) == 1
+if conf.get('ENABLE_MACHINED', false)
         executable('systemd-machined',
                    systemd_machined_sources,
                    include_directories : includes,
@@ -1639,7 +1652,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_IMPORTD', 0) == 1
+if conf.get('ENABLE_IMPORTD', false)
         executable('systemd-importd',
                    systemd_importd_sources,
                    include_directories : includes,
@@ -1688,7 +1701,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1
         public_programs += [systemd_pull, systemd_import, systemd_export]
 endif
 
-if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1
+if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
         exe = executable('systemd-journal-upload',
                          systemd_journal_upload_sources,
                          include_directories : includes,
@@ -1704,7 +1717,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1
+if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
         s_j_remote = executable('systemd-journal-remote',
                                 systemd_journal_remote_sources,
                                 include_directories : includes,
@@ -1733,7 +1746,7 @@ if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1
         public_programs += [s_j_remote, s_j_gatewayd]
 endif
 
-if conf.get('ENABLE_COREDUMP', 0) == 1
+if conf.get('ENABLE_COREDUMP', false)
         executable('systemd-coredump',
                    systemd_coredump_sources,
                    include_directories : includes,
@@ -1759,7 +1772,7 @@ if conf.get('ENABLE_COREDUMP', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_BINFMT', 0) == 1
+if conf.get('ENABLE_BINFMT', false)
         exe = executable('systemd-binfmt',
                          'src/binfmt/binfmt.c',
                          include_directories : includes,
@@ -1775,7 +1788,7 @@ if conf.get('ENABLE_BINFMT', 0) == 1
                                  mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
 endif
 
-if conf.get('ENABLE_VCONSOLE', 0) == 1
+if conf.get('ENABLE_VCONSOLE', false)
         executable('systemd-vconsole-setup',
                    'src/vconsole/vconsole-setup.c',
                    include_directories : includes,
@@ -1785,7 +1798,7 @@ if conf.get('ENABLE_VCONSOLE', 0) == 1
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_RANDOMSEED', 0) == 1
+if conf.get('ENABLE_RANDOMSEED', false)
         executable('systemd-random-seed',
                    'src/random-seed/random-seed.c',
                    include_directories : includes,
@@ -1795,7 +1808,7 @@ if conf.get('ENABLE_RANDOMSEED', 0) == 1
                    install_dir : rootlibexecdir)
 endif
 
-if conf.get('ENABLE_FIRSTBOOT', 0) == 1
+if conf.get('ENABLE_FIRSTBOOT', false)
         executable('systemd-firstboot',
                    'src/firstboot/firstboot.c',
                    include_directories : includes,
@@ -1970,8 +1983,7 @@ executable('systemd-initctl',
 exe = executable('systemd-mount',
                  'src/mount/mount-tool.c',
                  include_directories : includes,
-                 link_with : [libshared,
-                              libudev],
+                 link_with : [libshared],
                  install_rpath : rootlibexecdir,
                  install : true)
 public_programs += [exe]
@@ -2005,7 +2017,7 @@ exe = executable('busctl',
                  install : true)
 public_programs += [exe]
 
-if conf.get('ENABLE_SYSUSERS', 0) == 1
+if conf.get('ENABLE_SYSUSERS', false)
         exe = executable('systemd-sysusers',
                          'src/sysusers/sysusers.c',
                          include_directories : includes,
@@ -2016,7 +2028,7 @@ if conf.get('ENABLE_SYSUSERS', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_TMPFILES', 0) == 1
+if conf.get('ENABLE_TMPFILES', false)
         exe = executable('systemd-tmpfiles',
                          'src/tmpfiles/tmpfiles.c',
                          include_directories : includes,
@@ -2028,7 +2040,7 @@ if conf.get('ENABLE_TMPFILES', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_HWDB', 0) == 1
+if conf.get('ENABLE_HWDB', false)
         exe = executable('systemd-hwdb',
                          'src/hwdb/hwdb.c',
                          'src/libsystemd/sd-hwdb/hwdb-internal.h',
@@ -2040,7 +2052,7 @@ if conf.get('ENABLE_HWDB', 0) == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_QUOTACHECK', 0) == 1
+if conf.get('ENABLE_QUOTACHECK', false)
         executable('systemd-quotacheck',
                    'src/quotacheck/quotacheck.c',
                    include_directories : includes,
@@ -2063,6 +2075,7 @@ public_programs += [exe]
 exe = executable('systemd-udevd',
                  systemd_udevd_sources,
                  include_directories : includes,
+                 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
                  link_with : [libudev_core,
                               libsystemd_network,
                               libudev_internal],
@@ -2095,8 +2108,7 @@ public_programs += [exe]
 executable('systemd-shutdown',
            systemd_shutdown_sources,
            include_directories : includes,
-           link_with : [libshared,
-                        libudev],
+           link_with : [libshared],
            install_rpath : rootlibexecdir,
            install : true,
            install_dir : rootlibexecdir)
@@ -2118,7 +2130,7 @@ executable('systemd-update-utmp',
            install : true,
            install_dir : rootlibexecdir)
 
-if conf.get('HAVE_KMOD', 0) == 1
+if conf.get('HAVE_KMOD', false)
         executable('systemd-modules-load',
                    'src/modules-load/modules-load.c',
                    include_directories : includes,
@@ -2141,9 +2153,7 @@ exe = executable('systemd-nspawn',
                  'src/core/loopback-setup.c',
                  'src/core/loopback-setup.h',
                  include_directories : [includes, include_directories('src/nspawn')],
-                 link_with : [libfirewall,
-                              libshared,
-                              libudev],
+                 link_with : [libshared],
                  dependencies : [libacl,
                                  libblkid,
                                  libseccomp,
@@ -2152,12 +2162,11 @@ exe = executable('systemd-nspawn',
                  install : true)
 public_programs += [exe]
 
-if conf.get('ENABLE_NETWORKD', 0) == 1
+if conf.get('ENABLE_NETWORKD', false)
         executable('systemd-networkd',
                    systemd_networkd_sources,
                    include_directories : includes,
                    link_with : [libnetworkd_core,
-                                libfirewall,
                                 libsystemd_network,
                                 libudev_internal,
                                 libshared],
@@ -2203,7 +2212,7 @@ foreach tuple : tests
                 type = ''
         endif
 
-        if condition == '' or conf.get(condition, 0) == 1
+        if condition == '' or conf.get(condition, false)
                 install = install_tests and type == ''
 
                 exe = executable(
@@ -2316,11 +2325,10 @@ if git.found() and etags.found()
                  ':/*.[ch]'])
         all_files = files(all_files.stdout().split())
 
-        custom_target(
+        run_target(
                 'TAGS',
-                output : 'TAGS',
                 input : all_files,
-                command : [etags, '-o', '@OUTPUT@'] + all_files)
+                command : [etags, '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
 endif
 
 if git.found()
@@ -2329,3 +2337,182 @@ if git.found()
                 'git-contrib',
                 command : [meson_git_contrib_sh])
 endif
+
+if git.found()
+        git_head = run_command(
+                git,
+                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                 'rev-parse', 'HEAD']).stdout().strip()
+        git_head_short = run_command(
+                git,
+                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
+
+        run_target(
+                'git-snapshot',
+                command : ['git', 'archive',
+                           '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
+                                                                 git_head_short),
+                           '--prefix', 'systemd-@0@/'.format(git_head),
+                           'HEAD'])
+endif
+
+############################################################
+
+status = [
+        '@0@ @1@'.format(meson.project_name(), meson.project_version()),
+
+        'prefix:                            @0@'.format(prefixdir),
+        'rootprefix:                        @0@'.format(rootprefixdir),
+        'sysconf dir:                       @0@'.format(sysconfdir),
+        'includedir:                        @0@'.format(includedir),
+        'lib dir:                           @0@'.format(libdir),
+        'rootlib dir:                       @0@'.format(rootlibdir),
+        'SysV init scripts:                 @0@'.format(sysvinit_path),
+        'SysV rc?.d directories:            @0@'.format(sysvrcnd_path),
+        'PAM modules dir:                   @0@'.format(pamlibdir),
+        'PAM configuration dir:             @0@'.format(pamconfdir),
+        'RPM macros dir:                    @0@'.format(rpmmacrosdir),
+        'D-Bus policy dir:                  @0@'.format(dbuspolicydir),
+        'D-Bus session dir:                 @0@'.format(dbussessionservicedir),
+        'D-Bus system dir:                  @0@'.format(dbussystemservicedir),
+        'bash completions dir:              @0@'.format(bashcompletiondir),
+        'zsh completions dir:               @0@'.format(zshcompletiondir),
+        'extra start script:                @0@'.format(get_option('rc-local')),
+        'extra stop script:                 @0@'.format(get_option('halt-local')),
+        'debug shell:                       @0@ @ @1@'.format(get_option('debug-shell'),
+                                                              get_option('debug-tty')),
+        'TTY GID:                           @0@'.format(tty_gid),
+        'maximum system UID:                @0@'.format(system_uid_max),
+        'maximum system GID:                @0@'.format(system_gid_max),
+        '/dev/kvm access mode:              @0@'.format(get_option('dev-kvm-mode')),
+        'certificate root:                  @0@'.format(get_option('certificate-root')),
+        'support URL:                       @0@'.format(support_url),
+        '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')),
+
+        'default DNSSEC mode:               @0@'.format(default_dnssec),
+        'default cgroup hierarchy:          @0@'.format(default_hierarchy),
+        'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
+
+alt_dns_servers = '\n                                            '.join(dns_servers.split(' '))
+alt_ntp_servers = '\n                                            '.join(ntp_servers.split(' '))
+status += [
+        'default DNS servers:               @0@'.format(alt_dns_servers),
+        'default NTP servers:               @0@'.format(alt_ntp_servers)]
+
+alt_time_epoch = run_command('date', '-Is', '-u', '-d',
+                             '@@0@'.format(time_epoch)).stdout().strip()
+status += [
+        'time epoch:                        @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
+
+# TODO:
+# CFLAGS:   ${OUR_CFLAGS} ${CFLAGS}
+# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
+# LDFLAGS:  ${OUR_LDFLAGS} ${LDFLAGS}
+
+if conf.get('ENABLE_EFI', false)
+        status += [
+                'efi arch:                          @0@'.format(efi_arch)]
+
+        if have_gnu_efi
+                status += [
+                        'EFI machine type:                  @0@'.format(EFI_MACHINE_TYPE_NAME),
+                        'EFI CC                             @0@'.format(efi_cc),
+                        'EFI libdir:                        @0@'.format(efi_libdir),
+                        'EFI ldsdir:                        @0@'.format(efi_ldsdir),
+                        'EFI includedir:                    @0@'.format(efi_incdir)]
+        endif
+endif
+
+found = []
+missing = []
+
+foreach tuple : [
+        ['libcryptsetup'],
+        ['PAM'],
+        ['AUDIT'],
+        ['IMA'],
+        ['AppArmor'],
+        ['SELinux'],
+        ['SECCOMP'],
+        ['SMACK'],
+        ['zlib'],
+        ['xz'],
+        ['lz4'],
+        ['bzip2'],
+        ['ACL'],
+        ['gcrypt'],
+        ['qrencode'],
+        ['microhttpd'],
+        ['gnutls'],
+        ['libcurl'],
+        ['libidn2'],
+        ['libidn'],
+        ['libiptc'],
+        ['elfutils'],
+        ['binfmt'],
+        ['vconsole'],
+        ['quotacheck'],
+        ['tmpfiles'],
+        ['environment.d'],
+        ['sysusers'],
+        ['firstboot'],
+        ['randomseed'],
+        ['backlight'],
+        ['rfkill'],
+        ['logind'],
+        ['machined'],
+        ['importd'],
+        ['hostnamed'],
+        ['timedated'],
+        ['timesyncd'],
+        ['localed'],
+        ['networkd'],
+        ['resolved'],
+        ['coredump'],
+        ['polkit'],
+        ['legacy pkla',      install_polkit_pkla],
+        ['efi'],
+        ['gnu-efi',          have_gnu_efi],
+        ['kmod'],
+        ['xkbcommon'],
+        ['blkid'],
+        ['dbus'],
+        ['glib'],
+        ['nss-myhostname',   conf.get('HAVE_MYHOSTNAME', false)],
+        ['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)],
+        ['SysV compat'],
+        ['utmp'],
+        ['ldconfig'],
+        ['hibernate'],
+        ['adm group',        get_option('adm-group')],
+        ['wheel group',      get_option('wheel-group')],
+        ['gshadow'],
+        ['debug hashmap'],
+        ['debug mmap cache'],
+]
+
+        cond = tuple.get(1, '')
+        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)
+        endif
+        if cond
+                found += [tuple[0]]
+        else
+                missing += [tuple[0]]
+        endif
+endforeach
+
+status += [
+        'enabled features: @0@'.format(', '.join(found)),
+        'disabled features: @0@'.format(', '.join(missing))]
+message('\n         '.join(status))