]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: check if necessary cflags dependencies are set
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jul 2026 18:52:36 +0000 (03:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 3 Jul 2026 12:50:45 +0000 (21:50 +0900)
This makes each `foo_cflags` dependency define a `SYSTEMD_CFLAGS_MARKER_FOO`
macro, and checks if the macro is set when headers provided by external
libraries are included.

With this, we can fail fast at compile time if necessary `_cflags`
dependencies are omitted in meson.build. Missing dependencies found by this
mechanism have been added across the tree.

66 files changed:
meson.build
src/analyze/meson.build
src/basic/compress.c
src/bootctl/meson.build
src/core/meson.build
src/coredump/meson.build
src/creds/meson.build
src/cryptenroll/meson.build
src/cryptsetup/cryptsetup-tokens/meson.build
src/cryptsetup/meson.build
src/dissect/meson.build
src/fuzz/meson.build
src/growfs/meson.build
src/home/meson.build
src/imds/meson.build
src/import/meson.build
src/journal-remote/meson.build
src/journal/audit_type-to-name.awk
src/journal/meson.build
src/libsystemd/sd-bus/test-bus-marshal.c
src/locale/xkbcommon-util.h
src/login/meson.build
src/measure/meson.build
src/network/meson.build
src/nsresourced/meson.build
src/repart/meson.build
src/report/meson.build
src/sbsign/authenticode.h
src/shared/acl-util.h
src/shared/apparmor-util.h
src/shared/blkid-util.h
src/shared/bpf-link.h
src/shared/bpf-util.h
src/shared/crypto-util.h
src/shared/cryptsetup-util.h
src/shared/curl-util.h
src/shared/elf-util.c
src/shared/fdisk-util.h
src/shared/gnutls-util.h
src/shared/idn-util.h
src/shared/libarchive-util.h
src/shared/libaudit-util.h
src/shared/libcrypt-util.c
src/shared/libfido2-util.h
src/shared/libmount-util.h
src/shared/microhttpd-util.h
src/shared/module-util.h
src/shared/pam-util.h
src/shared/password-quality-util-passwdqc.c
src/shared/password-quality-util-pwquality.c
src/shared/pcre2-util.h
src/shared/pkcs11-util.h
src/shared/qrcode-util.c
src/shared/reboot-util.c
src/shared/seccomp-util.h
src/shared/selinux-util.h
src/shared/ssl-util.h
src/shared/tpm2-util.h
src/sysext/meson.build
src/systemctl/meson.build
src/test/gcrypt-util.h
src/test/meson.build
src/tmpfiles/meson.build
src/tpm2-setup/meson.build
src/udev/meson.build
src/veritysetup/meson.build

index 8f629df5b7ba23f285459664c8a2762ba70ed0c7..1ce4c95368da356160b642c9437ed49ec7aa3bad 100644 (file)
@@ -1028,13 +1028,18 @@ endif
 
 if get_option('libc') == 'musl'
         libcrypt = []
-        libcrypt_cflags = []
+        libcrypt_cflags = declare_dependency(
+                compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBCRYPT',
+        )
         have = get_option('libcrypt').allowed()
 else
         libcrypt = dependency('libcrypt', 'libxcrypt',
                               required : get_option('libcrypt'),
                               version : '>=4.4.0')
-        libcrypt_cflags = libcrypt.partial_dependency(includes: true, compile_args: true)
+        libcrypt_cflags = declare_dependency(
+                dependencies : libcrypt.partial_dependency(includes: true, compile_args: true),
+                compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBCRYPT',
+        )
         have = libcrypt.found()
 endif
 conf.set10('HAVE_LIBCRYPT', have)
@@ -1052,7 +1057,10 @@ bpf_compiler = get_option('bpf-compiler')
 libbpf = dependency('libbpf',
                     required : bpf_framework,
                     version : bpf_compiler == 'gcc' ? '>= 1.4.0' : '>= 0.1.0')
-libbpf_cflags = libbpf.partial_dependency(includes: true, compile_args: true)
+libbpf_cflags = declare_dependency(
+        dependencies : libbpf.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBBPF',
+)
 conf.set10('HAVE_LIBBPF', libbpf.found())
 
 libmount = dependency('mount',
@@ -1060,12 +1068,18 @@ libmount = dependency('mount',
                       required : get_option('libmount'))
 have = libmount.found()
 conf.set10('HAVE_LIBMOUNT', have)
-libmount_cflags = libmount.partial_dependency(includes: true, compile_args: true)
+libmount_cflags = declare_dependency(
+        dependencies : libmount.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBMOUNT',
+)
 
 libfdisk = dependency('fdisk',
                       version : '>= 2.35',
                       required : get_option('fdisk'))
-libfdisk_cflags = libfdisk.partial_dependency(includes: true, compile_args: true)
+libfdisk_cflags = declare_dependency(
+        dependencies : libfdisk.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBFDISK',
+)
 conf.set10('HAVE_LIBFDISK', libfdisk.found())
 
 # This prefers pwquality if both are enabled or auto.
@@ -1079,7 +1093,10 @@ if not have
         libpwquality = dependency('passwdqc',
                                   required : get_option('passwdqc'))
 endif
-libpwquality_cflags = libpwquality.partial_dependency(includes: true, compile_args: true)
+libpwquality_cflags = declare_dependency(
+        dependencies : libpwquality.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBPWQUALITY',
+)
 conf.set10('HAVE_PWQUALITY', have)
 conf.set10('HAVE_PASSWDQC', not have and libpwquality.found())
 
@@ -1087,19 +1104,28 @@ libseccomp = dependency('libseccomp',
                         version : '>= 2.4.0',
                         required : get_option('seccomp'))
 conf.set10('HAVE_SECCOMP', libseccomp.found())
-libseccomp_cflags = libseccomp.partial_dependency(includes: true, compile_args: true)
+libseccomp_cflags = declare_dependency(
+        dependencies : libseccomp.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBSECCOMP',
+)
 
 libselinux = dependency('libselinux',
                         version : '>= 2.1.9',
                         required : get_option('selinux'))
 conf.set10('HAVE_SELINUX', libselinux.found())
-libselinux_cflags = libselinux.partial_dependency(includes: true, compile_args: true)
+libselinux_cflags = declare_dependency(
+        dependencies : libselinux.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBSELINUX',
+)
 
 libapparmor = dependency('libapparmor',
                          version : '>= 2.13',
                          required : get_option('apparmor'))
 conf.set10('HAVE_APPARMOR', libapparmor.found())
-libapparmor_cflags = libapparmor.partial_dependency(includes: true, compile_args: true)
+libapparmor_cflags = declare_dependency(
+        dependencies : libapparmor.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBAPPARMOR',
+)
 
 have = get_option('smack') and get_option('smack-run-label') != ''
 conf.set10('HAVE_SMACK_RUN_LABEL', have)
@@ -1125,30 +1151,45 @@ conf.set10('ENABLE_POLKIT', install_polkit)
 libacl = dependency('libacl',
                     required : get_option('acl'))
 conf.set10('HAVE_ACL', libacl.found())
-libacl_cflags = libacl.partial_dependency(includes: true, compile_args: true)
+libacl_cflags = declare_dependency(
+        dependencies : libacl.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBACL',
+)
 
 libaudit = dependency('audit',
                       required : get_option('audit'))
 conf.set10('HAVE_AUDIT', libaudit.found())
-libaudit_cflags = libaudit.partial_dependency(includes: true, compile_args: true)
+libaudit_cflags = declare_dependency(
+        dependencies : libaudit.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBAUDIT',
+)
 
 libblkid = dependency('blkid',
                       version : '>=2.37.0',
                       required : get_option('blkid'))
 conf.set10('HAVE_BLKID', libblkid.found())
-libblkid_cflags = libblkid.partial_dependency(includes: true, compile_args: true)
+libblkid_cflags = declare_dependency(
+        dependencies : libblkid.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBBLKID',
+)
 
 libkmod = dependency('libkmod',
                      version : '>= 15',
                      required : get_option('kmod'))
 conf.set10('HAVE_KMOD', libkmod.found())
-libkmod_cflags = libkmod.partial_dependency(includes: true, compile_args: true)
+libkmod_cflags = declare_dependency(
+        dependencies : libkmod.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBKMOD',
+)
 
 libxenctrl = dependency('xencontrol',
                         version : '>= 4.9',
                         required : get_option('xenctrl'))
 conf.set10('HAVE_XENCTRL', libxenctrl.found())
-libxenctrl_cflags = libxenctrl.partial_dependency(includes: true, compile_args: true)
+libxenctrl_cflags = declare_dependency(
+        dependencies : libxenctrl.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBXENCTRL',
+)
 
 feature = get_option('pam')
 libpam = dependency('pam',
@@ -1158,13 +1199,19 @@ if not libpam.found()
         libpam = cc.find_library('pam', required : feature)
 endif
 conf.set10('HAVE_PAM', libpam.found())
-libpam_cflags = libpam.partial_dependency(includes: true, compile_args: true)
+libpam_cflags = declare_dependency(
+        dependencies : libpam.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBPAM',
+)
 
 libmicrohttpd = dependency('libmicrohttpd',
                            version : '>= 0.9.33',
                            required : get_option('microhttpd'))
 conf.set10('HAVE_MICROHTTPD', libmicrohttpd.found())
-libmicrohttpd_cflags = libmicrohttpd.partial_dependency(includes: true, compile_args: true)
+libmicrohttpd_cflags = declare_dependency(
+        dependencies : libmicrohttpd.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBMICROHTTPD',
+)
 
 libcryptsetup = get_option('libcryptsetup')
 libcryptsetup_plugins = get_option('libcryptsetup-plugins')
@@ -1178,7 +1225,10 @@ endif
 libcryptsetup = dependency('libcryptsetup',
                            version : '>= 2.4.0',
                            required : libcryptsetup)
-libcryptsetup_cflags = libcryptsetup.partial_dependency(includes: true, compile_args: true)
+libcryptsetup_cflags = declare_dependency(
+        dependencies : libcryptsetup.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBCRYPTSETUP',
+)
 
 have = libcryptsetup.found()
 conf.set10('HAVE_LIBCRYPTSETUP', have)
@@ -1188,19 +1238,28 @@ conf.set10('HAVE_LIBCRYPTSETUP_PLUGINS',
 libcurl = dependency('libcurl',
                      version : '>= 7.32.0',
                      required : get_option('libcurl'))
-libcurl_cflags = libcurl.partial_dependency(includes: true, compile_args: true)
+libcurl_cflags = declare_dependency(
+        dependencies : libcurl.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBCURL',
+)
 conf.set10('HAVE_LIBCURL', libcurl.found())
 conf.set10('CURL_NO_OLDIES', conf.get('BUILD_MODE_DEVELOPER') == 1)
 
 libidn2 = dependency('libidn2',
                      required : get_option('libidn2'))
-libidn2_cflags = libidn2.partial_dependency(includes: true, compile_args: true)
+libidn2_cflags = declare_dependency(
+        dependencies : libidn2.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBIDN2',
+)
 conf.set10('HAVE_LIBIDN2', libidn2.found())
 
 libqrencode = dependency('libqrencode',
                          version : '>= 3',
                          required : get_option('qrencode'))
-libqrencode_cflags = libqrencode.partial_dependency(includes: true, compile_args: true)
+libqrencode_cflags = declare_dependency(
+        dependencies : libqrencode.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBQRENCODE',
+)
 conf.set10('HAVE_QRENCODE', libqrencode.found())
 
 feature = get_option('gcrypt')
@@ -1208,7 +1267,10 @@ libgcrypt = dependency('libgcrypt',
                        required : feature.disabled() ? feature : false)
 conf.set10('HAVE_GCRYPT', libgcrypt.found())
 if libgcrypt.found()
-        libgcrypt_cflags = libgcrypt.partial_dependency(includes: true, compile_args: true)
+        libgcrypt_cflags = declare_dependency(
+                dependencies : libgcrypt.partial_dependency(includes: true, compile_args: true),
+                compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBGCRYPT',
+        )
 else
         libgcrypt_cflags = []
 endif
@@ -1217,26 +1279,38 @@ libgnutls = dependency('gnutls',
                        version : '>= 3.1.4',
                        required : get_option('gnutls'))
 conf.set10('HAVE_GNUTLS', libgnutls.found())
-libgnutls_cflags = libgnutls.partial_dependency(includes: true, compile_args: true)
+libgnutls_cflags = declare_dependency(
+        dependencies : libgnutls.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBGNUTLS',
+)
 
 libopenssl = dependency('openssl',
                         version : '>= 3.0.0',
                         required : get_option('openssl'))
-libopenssl_cflags = libopenssl.partial_dependency(includes: true, compile_args: true)
+libopenssl_cflags = declare_dependency(
+        dependencies : libopenssl.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBOPENSSL',
+)
 conf.set10('HAVE_OPENSSL', libopenssl.found())
 
 libp11kit = dependency('p11-kit-1',
                        version : '>= 0.23.3',
                        required : get_option('p11kit'))
 conf.set10('HAVE_P11KIT', libp11kit.found())
-libp11kit_cflags = libp11kit.partial_dependency(includes: true, compile_args: true)
+libp11kit_cflags = declare_dependency(
+        dependencies : libp11kit.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBP11KIT',
+)
 
 feature = get_option('libfido2').require(
         conf.get('HAVE_OPENSSL') == 1,
         error_message : 'openssl required')
 libfido2 = dependency('libfido2',
                       required : feature)
-libfido2_cflags = libfido2.partial_dependency(includes: true, compile_args: true)
+libfido2_cflags = declare_dependency(
+        dependencies : libfido2.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBFIDO2',
+)
 conf.set10('HAVE_LIBFIDO2', libfido2.found())
 
 tss2_esys = dependency('tss2-esys', required : get_option('tpm2'))
@@ -1250,6 +1324,7 @@ tpm2_cflags = declare_dependency(
                 tss2_rc.partial_dependency(includes: true, compile_args: true),
                 tss2_tcti_device.partial_dependency(includes: true, compile_args: true),
         ],
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_TPM2',
 )
 conf.set10('HAVE_TPM2', tss2_esys.found() and tss2_mu.found() and tss2_rc.found() and tss2_tcti_device.found())
 conf.set10('HAVE_TSS2_ESYS3', tss2_esys.found() and tss2_esys.version().version_compare('>= 3.0.0'))
@@ -1265,13 +1340,17 @@ libelf_cflags = declare_dependency(
                 libelf.partial_dependency(includes: true, compile_args: true),
                 libdw.partial_dependency(includes: true, compile_args: true),
         ],
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBELF',
 )
 conf.set10('HAVE_ELFUTILS', libdw.found() and libelf.found())
 
 libz = dependency('zlib',
                   required : get_option('zlib'))
 conf.set10('HAVE_ZLIB', libz.found())
-libz_cflags = libz.partial_dependency(includes: true, compile_args: true)
+libz_cflags = declare_dependency(
+        dependencies : libz.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBZ',
+)
 
 feature = get_option('bzip2')
 libbzip2 = dependency('bzip2',
@@ -1281,24 +1360,36 @@ if not libbzip2.found()
         libbzip2 = cc.find_library('bz2', required : feature)
 endif
 conf.set10('HAVE_BZIP2', libbzip2.found())
-libbzip2_cflags = libbzip2.partial_dependency(includes: true, compile_args: true)
+libbzip2_cflags = declare_dependency(
+        dependencies : libbzip2.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBBZIP2',
+)
 
 libxz = dependency('liblzma',
                    required : get_option('xz'))
 conf.set10('HAVE_XZ', libxz.found())
-libxz_cflags = libxz.partial_dependency(includes: true, compile_args: true)
+libxz_cflags = declare_dependency(
+        dependencies : libxz.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBXZ',
+)
 
 liblz4 = dependency('liblz4',
                     version : '>= 1.3.0',
                     required : get_option('lz4'))
 conf.set10('HAVE_LZ4', liblz4.found())
-liblz4_cflags = liblz4.partial_dependency(includes: true, compile_args: true)
+liblz4_cflags = declare_dependency(
+        dependencies : liblz4.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBLZ4',
+)
 
 libzstd = dependency('libzstd',
                      version : '>= 1.4.0',
                      required : get_option('zstd'))
 conf.set10('HAVE_ZSTD', libzstd.found())
-libzstd_cflags = libzstd.partial_dependency(includes: true, compile_args: true)
+libzstd_cflags = declare_dependency(
+        dependencies : libzstd.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBZSTD',
+)
 
 conf.set10('HAVE_COMPRESSION', libxz.found() or liblz4.found() or libzstd.found())
 
@@ -1334,18 +1425,27 @@ conf.set('DEFAULT_COMPRESSION', 'COMPRESSION_@0@'.format(compression.to_upper())
 libarchive = dependency('libarchive',
                         version : '>= 3.0',
                         required : get_option('libarchive'))
-libarchive_cflags = libarchive.partial_dependency(includes: true, compile_args: true)
+libarchive_cflags = declare_dependency(
+        dependencies : libarchive.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBARCHIVE',
+)
 conf.set10('HAVE_LIBARCHIVE', libarchive.found())
 
 libxkbcommon = dependency('xkbcommon',
                           version : '>= 0.3.0',
                           required : get_option('xkbcommon'))
-libxkbcommon_cflags = libxkbcommon.partial_dependency(includes: true, compile_args: true)
+libxkbcommon_cflags = declare_dependency(
+        dependencies : libxkbcommon.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBXKBCOMMON',
+)
 conf.set10('HAVE_XKBCOMMON', libxkbcommon.found())
 
 libpcre2 = dependency('libpcre2-8',
                       required : get_option('pcre2'))
-libpcre2_cflags = libpcre2.partial_dependency(includes: true, compile_args: true)
+libpcre2_cflags = declare_dependency(
+        dependencies : libpcre2.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBPCRE2',
+)
 conf.set10('HAVE_PCRE2', libpcre2.found())
 
 libglib =    dependency('glib-2.0',
@@ -1363,13 +1463,17 @@ libglib_cflags = declare_dependency(
                 libgobject.partial_dependency(includes: true, compile_args: true),
                 libgio.partial_dependency(includes: true, compile_args: true),
         ],
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBGLIB',
 )
 
 libdbus = dependency('dbus-1',
                      version : '>= 1.3.2',
                      required : get_option('dbus'))
 conf.set10('HAVE_DBUS', libdbus.found())
-libdbus_cflags = libdbus.partial_dependency(includes: true, compile_args: true)
+libdbus_cflags = declare_dependency(
+        dependencies : libdbus.partial_dependency(includes: true, compile_args: true),
+        compile_args : '-DSYSTEMD_CFLAGS_MARKER_LIBDBUS',
+)
 
 dbusdatadir = libdbus.get_variable(pkgconfig: 'datadir', default_value: datadir) / 'dbus-1'
 
@@ -1828,12 +1932,16 @@ if static_libsystemd != 'false'
                 install_tag: 'libsystemd',
                 install_dir : libdir,
                 pic : static_libsystemd_pic,
-                dependencies : [liblz4_cflags,
-                                libm,
-                                libucontext,
-                                libxz_cflags,
-                                libzstd_cflags,
-                                userspace],
+                dependencies : [
+                        libbzip2_cflags,
+                        liblz4_cflags,
+                        libm,
+                        libucontext,
+                        libxz_cflags,
+                        libz_cflags,
+                        libzstd_cflags,
+                        userspace,
+                ],
                 c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
 
         alias_target('libsystemd', libsystemd, install_libsystemd_static)
@@ -1871,8 +1979,15 @@ if static_libudev != 'false'
                 install_tag: 'libudev',
                 install_dir : libdir,
                 link_depends : libudev_sym,
-                dependencies : [libshared_deps,
-                                userspace],
+                dependencies : [
+                        libbzip2_cflags,
+                        liblz4_cflags,
+                        libshared_deps,
+                        libxz_cflags,
+                        libz_cflags,
+                        libzstd_cflags,
+                        userspace,
+                ],
                 c_args : static_libudev_pic ? [] : ['-fno-PIC'],
                 pic : static_libudev_pic)
 
index 67001845ac181660241933ef15bf4aa2c8008da9..a8232eb851cd2aee9bffcb2b1733ed5b802b7c07 100644 (file)
@@ -55,7 +55,10 @@ executables += [
                         libcore,
                         libshared,
                 ],
-                'dependencies' : libseccomp_cflags,
+                'dependencies' : [
+                        libseccomp_cflags,
+                        tpm2_cflags,
+                ],
                 'install' : conf.get('ENABLE_ANALYZE') == 1,
         },
         core_test_template + {
index d75065781820f017cba6923257e3436def32c1ff..70d0b7ced319cfec68bffdc89d4f5edb3fedcd92 100644 (file)
@@ -6,25 +6,40 @@
 #include <unistd.h>
 
 #if HAVE_XZ
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBXZ
+#  error "missing libxz_cflags in meson dependency."
+#endif
 #include <lzma.h>
 #endif
 
 #if HAVE_LZ4
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBLZ4
+#  error "missing liblz4_cflags in meson dependency."
+#endif
 #include <lz4.h>
 #include <lz4frame.h>
 #include <lz4hc.h>
 #endif
 
 #if HAVE_ZSTD
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBZSTD
+#  error "missing libzstd_cflags in meson dependency."
+#endif
 #include <zstd.h>
 #include <zstd_errors.h>
 #endif
 
 #if HAVE_ZLIB
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBZ
+#  error "missing libz_cflags in meson dependency."
+#endif
 #include <zlib.h>
 #endif
 
 #if HAVE_BZIP2
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBBZIP2
+#  error "missing libbzip2_cflags in meson dependency."
+#endif
 #include <bzlib.h>
 #endif
 
index 06137bdae00ced3a48ccf114bf563ef982e26fad..958a804b80598b22b2359b7f795521fd974892c5 100644 (file)
@@ -24,7 +24,10 @@ executables += [
                 ],
                 'sources' : bootctl_sources,
                 'link_with' : boot_link_with,
-                'dependencies' : [libopenssl_cflags],
+                'dependencies' : [
+                        libopenssl_cflags,
+                        tpm2_cflags,
+                ],
         },
         test_template + {
                 'sources' : files(
index 26c84fa78b2f282e8cbe2605c9af914f8f2b5f6d..e46698b4cf8ec5545dbe4300928a1d49e6a2c3d1 100644 (file)
@@ -174,14 +174,18 @@ libcore_static = static_library(
         include_directories : core_includes,
         implicit_include_directories : false,
         c_args : ['-fvisibility=default'],
-        dependencies : [libaudit_cflags,
-                        libbpf_cflags,
-                        libcryptsetup_cflags,
-                        libm,
-                        libmount_cflags,
-                        libseccomp_cflags,
-                        libselinux_cflags,
-                        userspace],
+        dependencies : [
+                libacl_cflags,
+                libaudit_cflags,
+                libbpf_cflags,
+                libcryptsetup_cflags,
+                libm,
+                libmount_cflags,
+                libpcre2_cflags,
+                libseccomp_cflags,
+                libselinux_cflags,
+                userspace,
+        ],
         build_by_default : false)
 
 libcore = shared_library(
@@ -210,6 +214,7 @@ core_libs_shared = [
 
 systemd_deps = [
         libapparmor_cflags,
+        libaudit_cflags,
         libkmod_cflags,
         libmount_cflags,
         libseccomp_cflags,
@@ -226,6 +231,7 @@ if conf.get('SYSTEMD_MULTICALL_BINARY') == 1
         systemd_deps += [
                 libbpf_cflags,
                 libcryptsetup_cflags,
+                libopenssl_cflags,
                 libpam_cflags,
         ]
 endif
@@ -282,6 +288,7 @@ else
                                 libbpf_cflags,
                                 libcryptsetup_cflags,
                                 libmount_cflags,
+                                libopenssl_cflags,
                                 libpam_cflags,
                                 libseccomp_cflags,
                                 libselinux_cflags,
index b0753d86fa88216fe91a973205177e18a9614302..b1286f80ff6791f109e1b5f577f0fe34b1f7d0de 100644 (file)
@@ -38,7 +38,10 @@ executables += [
                 'sources' : systemd_coredump_sources,
                 'extract' : systemd_coredump_extract_sources,
                 'link_with' : [libshared],
-                'dependencies' : common_dependencies,
+                'dependencies' : [
+                        common_dependencies,
+                        libacl_cflags,
+                ],
         },
         executable_template + {
                 'name' : 'coredumpctl',
index c18fe2ec8901d239e8a8d1ae9c9705b2fac4cdbd..6a14f8e0750bf28516528b681fadd62bdbbe8621 100644 (file)
@@ -12,6 +12,7 @@ executables += [
                 'dependencies' : [
                         libmount_cflags,
                         libopenssl_cflags,
+                        tpm2_cflags,
                 ],
         },
 ]
index 3fbb5bf080bcc0e188c496a2d0a4e60a4d633957..f0d08ea56c2fdf0de0d31f3c0a11eeaf8c449e36 100644 (file)
@@ -27,6 +27,7 @@ executables += [
                         libfido2_cflags,
                         libopenssl_cflags,
                         libp11kit_cflags,
+                        tpm2_cflags,
                 ],
         },
 ]
index 772c29f50f526df773a76728d6656025d060ae6a..078062d073f1ce0e518687f47a849c5d0ba0718b 100644 (file)
@@ -5,7 +5,10 @@ lib_cryptsetup_token_common = static_library(
         'cryptsetup-token-util.c',
         include_directories : includes,
         implicit_include_directories : false,
-        dependencies : userspace,
+        dependencies : [
+                libcryptsetup_cflags,
+                userspace,
+        ],
         link_with : libshared,
         build_by_default : false)
 
index 9b7f3fa344da5fadd3bebddd33e25f74485dd8a5..85f15885c021fb1f83cf1b85b39dc83073398381 100644 (file)
@@ -23,11 +23,15 @@ executables += [
                         libmount_cflags,
                         libopenssl_cflags,
                         libp11kit_cflags,
+                        tpm2_cflags,
                 ],
         },
         generator_template + {
                 'name' : 'systemd-cryptsetup-generator',
                 'sources' : files('cryptsetup-generator.c'),
+                'dependencies' : [
+                        libcryptsetup_cflags,
+                ],
         },
 ]
 
index 24943cc8029052367833d9db759ec2e9e9a1f13e..92e23058979b5850aaa874ca853b1436cf57f6d4 100644 (file)
@@ -9,6 +9,9 @@ executables += [
                 'name' : 'systemd-dissect',
                 'public' : true,
                 'sources' : files('dissect.c'),
+                'dependencies' : [
+                        libarchive_cflags,
+                ],
         },
 ]
 
index 65fc6896f1f77c2f7274a2041f34882817b70265..10848a77e6fc768c07f765b84469cb652fcf68a3 100644 (file)
@@ -8,7 +8,6 @@ simple_fuzzers += files(
         'fuzz-env-file.c',
         'fuzz-hostname-setup.c',
         'fuzz-json.c',
-        'fuzz-pe-binary.c',
         'fuzz-time-util.c',
         'fuzz-udev-database.c',
         'fuzz-user-record.c',
@@ -16,6 +15,13 @@ simple_fuzzers += files(
         'fuzz-varlink-idl.c',
 )
 
+executables += [
+        fuzz_template + {
+                'sources' : files('fuzz-pe-binary.c'),
+                'dependencies' : libopenssl_cflags,
+        },
+]
+
 # The following fuzzers do not work on oss-fuzz. See #11018.
 if not want_ossfuzz
         simple_fuzzers += files('fuzz-compress.c')
index 0fcedb19d96d383fd68160397ccbd2bd5e2ca2b2..7bdc329c36dbbf159ba8fbff10ae4849d3e5e57c 100644 (file)
@@ -4,6 +4,9 @@ executables += [
         libexec_template + {
                 'name' : 'systemd-growfs',
                 'sources' : files('growfs.c'),
+                'dependencies' : [
+                        libcryptsetup_cflags,
+                ],
         },
         libexec_template + {
                 'name' : 'systemd-makefs',
index b724517ae9ce9e8f6d18731889878045bbf6bdb9..2713b0463514b8f6397085e955d7730a863c8538 100644 (file)
@@ -75,7 +75,9 @@ executables += [
                 'objects' : ['systemd-homed'],
                 'dependencies' : [
                         libblkid_cflags,
+                        libcryptsetup_cflags,
                         libfdisk_cflags,
+                        libfido2_cflags,
                         libopenssl_cflags,
                         libp11kit_cflags,
                 ],
@@ -87,6 +89,7 @@ executables += [
                 'extract' : homectl_extract,
                 'objects' : ['systemd-homed'],
                 'dependencies' : [
+                        libfido2_cflags,
                         libopenssl_cflags,
                         libp11kit_cflags,
                 ],
index a23735d100219fd049504a2652f0675c4982420b..9167600b651ef19873e7881733447e2570d468d3 100644 (file)
@@ -10,6 +10,9 @@ executables += [
                 'public' : true,
                 'sources' : files('imdsd.c'),
                 'extract' : files('imds-util.c'),
+                'dependencies' : [
+                        libcurl_cflags,
+                ],
         },
         libexec_template + {
                 'name' : 'systemd-imds',
index f133f276b4be223960aed30ad629032a5ea6bd54..e141ffb9750f5b6a8736d1433a66ff4f787f983a 100644 (file)
@@ -17,6 +17,10 @@ executables += [
                         'import-common.c',
                         'qcow2-util.c',
                 ),
+                'dependencies' : [
+                        libarchive_cflags,
+                        libselinux_cflags,
+                ],
         },
         libexec_template + {
                 'name' : 'systemd-pull',
@@ -30,7 +34,10 @@ executables += [
                         'pull-tar.c',
                 ),
                 'objects' : ['systemd-importd'],
-                'dependencies' : libopenssl_cflags,
+                'dependencies' : [
+                        libcurl_cflags,
+                        libopenssl_cflags,
+                ],
         },
         libexec_template + {
                 'name' : 'systemd-import',
@@ -73,6 +80,9 @@ executables += [
         test_template + {
                 'sources' : files('test-tar.c'),
                 'type' : 'manual',
+                'dependencies' : [
+                        libarchive_cflags,
+                ],
         },
         test_template + {
                 'sources' : files('test-qcow2.c'),
index 22ac8703b55d4dd020d7044ee22bebb58b3d3011..1338a3e673cefdb3ace28b612959b5f95d5fe7d4 100644 (file)
@@ -59,7 +59,10 @@ executables += [
                 'sources' : systemd_journal_upload_sources,
                 'extract' : systemd_journal_upload_extract_sources,
                 'objects' : ['systemd-journal-remote'],
-                'dependencies' : common_deps,
+                'dependencies' : [
+                        common_deps,
+                        libcurl_cflags,
+                ],
         },
         test_template + {
                 'sources' : files('test-journal-header-util.c'),
index ef834ff15eaf11bb604018e3c6bf916dab0089f3..879156fd2f0979e5661c1a0f1ccd533563dd4e42 100644 (file)
@@ -2,6 +2,9 @@
 
 BEGIN{
         print "#if HAVE_AUDIT"
+        print "#  ifndef SYSTEMD_CFLAGS_MARKER_LIBAUDIT"
+        print "#    error \"missing libaudit_cflags in meson dependency.\""
+        print "#  endif"
         print "#  include <libaudit.h>"
         print "#endif"
         print ""
index 3579265a119313cfaef920ceab28e0b34701b08d..41561deb8b3b7b53f842799c841ba7c67a02e2ba 100644 (file)
@@ -95,7 +95,10 @@ executables += [
                 'sources' : systemd_journald_sources,
                 'extract' : systemd_journald_extract_sources,
                 'dependencies' : [
+                        libacl_cflags,
+                        libaudit_cflags,
                         liblz4_cflags,
+                        libpcre2_cflags,
                         libselinux_cflags,
                         libxz_cflags,
                         libzstd_cflags,
@@ -106,6 +109,9 @@ executables += [
                 'public' : true,
                 'conditions' : ['HAVE_QRENCODE'],
                 'sources' : files('bsod.c'),
+                'dependencies' : [
+                        libqrencode_cflags,
+                ],
         },
         executable_template + {
                 'name' : 'systemd-cat',
@@ -121,6 +127,7 @@ executables += [
                 'dependencies' : [
                         liblz4_cflags,
                         libopenssl_cflags,
+                        libpcre2_cflags,
                         libxz_cflags,
                         libzstd_cflags,
                 ],
index 05074fd92b2f6c6cc0c8ec47e596cadb329f2453..064b76d3e000e4fb71e86289adf73194c7086e7e 100644 (file)
@@ -5,12 +5,18 @@
 #include "macro.h"
 
 #if HAVE_GLIB
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBGLIB
+#  error "missing libglib_cflags in meson dependency."
+#endif
 DISABLE_WARNING_FORMAT_NONLITERAL
 #include <gio/gio.h> /* NOLINT */
 REENABLE_WARNING
 #endif
 
 #if HAVE_DBUS
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBDBUS
+#  error "missing libdbus_cflags in meson dependency."
+#endif
 #include <dbus/dbus.h>
 #endif
 
index 1a709ae50c03e0c78d6ba51f7f3f442e5b076cce..e441e9d89bac63697fbc1589c6bd15098ec17331 100644 (file)
@@ -5,6 +5,10 @@
 #include "shared-forward.h"
 
 #if HAVE_XKBCOMMON
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBXKBCOMMON
+#  error "missing libxkbcommon_cflags in meson dependency."
+#endif
+
 #include <xkbcommon/xkbcommon.h>
 
 extern DLSYM_PROTOTYPE(xkb_context_new);
index 44325ccd7c02f4bb04b369b272ff188a7ff4ad62..effb44c3a8314372be24cd9a784a4bf3c7dee533 100644 (file)
@@ -48,6 +48,9 @@ executables += [
                 'dbus' : true,
                 'sources' : systemd_logind_sources,
                 'extract' : systemd_logind_extract_sources,
+                'dependencies' : [
+                        libacl_cflags,
+                ],
         },
         executable_template + {
                 'name' : 'loginctl',
index ff777dc5d9842e8642ee7c23dd79e81de1f270c9..3dd793e8c35745f07b4862fe7bcdbe4ae5ac54fa 100644 (file)
@@ -9,6 +9,9 @@ executables += [
                         'HAVE_TPM2',
                 ],
                 'sources' : files('measure-tool.c'),
-                'dependencies' : libopenssl_cflags,
+                'dependencies' : [
+                        libopenssl_cflags,
+                        tpm2_cflags,
+                ],
         },
 ]
index 110af9511c11bc1023d4b60d7180cf8d27fb2d3c..b620e512df77609c56090dc963db62a824fccb03 100644 (file)
@@ -204,9 +204,12 @@ executables += [
                         libsystemd_network,
                         networkd_link_with,
                 ],
+                'dependencies' : [
+                        libbpf_cflags,
+                ],
                 'bpf_programs': [
                         'sysctl-monitor',
-                ]
+                ],
         },
         libexec_template + {
                 'name' : 'systemd-networkd-wait-online',
@@ -225,6 +228,9 @@ executables += [
                         libsystemd_network,
                         networkd_link_with,
                 ],
+                'dependencies' : [
+                        libselinux_cflags,
+                ],
         },
         libexec_template + {
                 'name' : 'systemd-network-generator',
index 1654e1766b1eb0f535db7d96a0d94b41889b0e8c..2037d06bc8a412e8c4031dddc253fa4b77863950 100644 (file)
@@ -24,6 +24,9 @@ executables += [
                 'name' : 'systemd-nsresourced',
                 'sources' : systemd_nsresourced_sources,
                 'extract' : systemd_nsresourced_extract_sources,
+                'dependencies' : [
+                        libbpf_cflags,
+                ],
                 'bpf_programs': ['userns-restrict'],
         },
         libexec_template + {
index 6d3278c3ca65f973d3610123188ffab7f6fa4f54..721fe73b9ae9e4ddb10f33852aa6e5eb61b5bf59 100644 (file)
@@ -15,9 +15,11 @@ executables += [
                 ),
                 'dependencies' : [
                         libblkid_cflags,
+                        libcryptsetup_cflags,
                         libfdisk_cflags,
                         libmount_cflags,
                         libopenssl_cflags,
+                        tpm2_cflags,
                 ],
         },
         executable_template + {
@@ -32,9 +34,11 @@ executables += [
                 ],
                 'dependencies' : [
                         libblkid_cflags,
+                        libcryptsetup_cflags,
                         libfdisk_cflags,
                         libmount_cflags,
                         libopenssl_cflags,
+                        tpm2_cflags,
                 ],
         },
 ]
index d0a316c6897d28bee7e229c418b0ad15c278680a..8a4716ec21c0a0c0e339646ec0bd849c81dbc75d 100644 (file)
@@ -10,6 +10,9 @@ executables += [
                         'report-sign.c',
                         'report-upload.c',
                 ),
+                'dependencies' : [
+                        libcurl_cflags,
+                ],
         },
 
         libexec_template + {
index c076fe36241d88e0e53c6be8b087b6fd32c2e6b1..236435a7e96f6f7e708a61821402317c3bec882a 100644 (file)
@@ -1,6 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
+#  error "missing libopenssl_cflags in meson dependency."
+#endif
+
 #include <openssl/asn1.h>
 
 #include "shared-forward.h"
index 981f43a8cc082b349856c4ad5c4675e55d56bf55..2b9ac817366536e33a33dc499a03680e6b86e852 100644 (file)
@@ -6,6 +6,10 @@
 #include "shared-forward.h"
 
 #if HAVE_ACL
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBACL
+#  error "missing libacl_cflags in meson dependency."
+#endif
+
 #include <acl/libacl.h> /* IWYU pragma: export */
 #include <sys/acl.h>    /* IWYU pragma: export */
 
index e87ba84504d7d2b63338fc2b2cf129751f4af9f5..2d47a341cb9be160cb4533346ff0e5f4e0e1d829 100644 (file)
@@ -4,6 +4,10 @@
 #include "shared-forward.h"
 
 #if HAVE_APPARMOR
+#  ifndef SYSTEMD_CFLAGS_MARKER_LIBAPPARMOR
+#    error "missing libapparmor_cflags in meson dependency."
+#  endif
+
 #  include <sys/apparmor.h>
 
 #  include "dlfcn-util.h"
index c211bbf3abc0f211ee7e1abd2c9de8ce4a087db1..97356477fadfa60ef2731490afd54f680b329b76 100644 (file)
@@ -6,6 +6,9 @@
 #include "shared-forward.h"
 
 #if HAVE_BLKID
+#  ifndef SYSTEMD_CFLAGS_MARKER_LIBBLKID
+#    error "missing libblkid_cflags in meson dependency."
+#  endif
 
 #include <blkid.h>
 
index 4de95eb2e1ee3536bfb5395562b2d54a0e5a1d1b..b5be07865d391d6c058dbb4680d64203a06e7e80 100644 (file)
@@ -2,6 +2,9 @@
 #pragma once
 
 #if HAVE_LIBBPF
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBBPF
+#  error "missing libbpf_cflags in meson dependency."
+#endif
 
 #include <bpf/libbpf.h>
 
index faf7349b8a0794ab7479932b6465573dda89971b..6c2e7a2c98e439d03e060a4df31b9fe2eda21dc9 100644 (file)
@@ -6,6 +6,9 @@
 #include "sd-dlopen.h"
 
 #if HAVE_LIBBPF
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBBPF
+#  error "missing libbpf_cflags in meson dependency."
+#endif
 
 #include <bpf/bpf.h>    /* IWYU pragma: export */
 #include <bpf/libbpf.h> /* IWYU pragma: export */
index 42a3f2f8c0e61c450355f46c25c68430208d37bd..9927dfb5c7bc3ec273040d7221e283232ae4fd27 100644 (file)
@@ -33,6 +33,10 @@ int dlopen_libcrypto(int log_level);
 #define X509_FINGERPRINT_SIZE SHA256_DIGEST_SIZE
 
 #if HAVE_OPENSSL
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
+#  error "missing libopenssl_cflags in meson dependency."
+#endif
+
 #define LIBCRYPTO_NOTE(priority)                                        \
         SD_ELF_NOTE_DLOPEN("libcrypto",                                 \
                            "Support for cryptographic operations",      \
index 1b3ab8b9604f0b4089328cac81d730176886d170..6e9c95aa9e8f6b26245f3f2c64212895ad94b7d8 100644 (file)
@@ -7,6 +7,10 @@
 #include "shared-forward.h"
 
 #if HAVE_LIBCRYPTSETUP
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBCRYPTSETUP
+#  error "missing libcryptsetup_cflags in meson dependency."
+#endif
+
 #include <libcryptsetup.h> /* IWYU pragma: export */
 
 /* Available since libcryptsetup 2.7. Always redeclare so DLSYM_PROTOTYPE's typeof() resolves on older
index 33bf3684c9eead88fdc16b6f3cbde5eb446f10de..a010cefac104628ba4e781f612e3859fa8f6bdbe 100644 (file)
@@ -6,6 +6,10 @@
 #include "shared-forward.h"
 
 #if HAVE_LIBCURL
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBCURL
+#  error "missing libcurl_cflags in meson dependency."
+#endif
+
 #include <curl/curl.h>            /* IWYU pragma: export */
 
 #include "dlfcn-util.h"
index 2210ab39f14235e8c6c16be9708300753113b709..5e40541ffcf9bc56b61120735fdc9190ba033470 100644 (file)
@@ -1,6 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #if HAVE_ELFUTILS
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBELF
+#  error "missing libelf_cflags in meson dependency."
+#endif
+
 #include <dwarf.h>
 #include <elfutils/libdwelf.h>
 #include <elfutils/libdwfl.h>
index 367c6cd051e4436dcbcf98e8daa75f946fb7b059..acdbd7c741cdee34436e3d66c9df0b2621b4fc4e 100644 (file)
@@ -6,6 +6,9 @@
 #include "shared-forward.h"
 
 #if HAVE_LIBFDISK
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBFDISK
+#  error "missing libfdisk_cflags in meson dependency."
+#endif
 
 #include <libfdisk.h> /* IWYU pragma: export */
 
index a110b437c3823ecab9e94e3d8dc91fdecabbf54c..dd0f1d55acb3e136085267ce729639339d2972aa 100644 (file)
@@ -6,6 +6,10 @@
 int dlopen_gnutls(int log_level);
 
 #if HAVE_GNUTLS
+#  ifndef SYSTEMD_CFLAGS_MARKER_LIBGNUTLS
+#    error "missing libgnutls_cflags in meson dependency."
+#  endif
+
 #  include <gnutls/gnutls.h>    /* IWYU pragma: export */
 #  include <gnutls/x509.h>      /* IWYU pragma: export */
 
index 9bed27140fde98fe200ca03d5803a2b0761cca35..0f3db74c63289f2fc03e06381cdfa0fce780c1b3 100644 (file)
@@ -6,6 +6,10 @@
 #include "shared-forward.h"
 
 #if HAVE_LIBIDN2
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBIDN2
+#  error "missing libidn2_cflags in meson dependency."
+#endif
+
 #include <idn2.h>
 
 #include "dlfcn-util.h"
index afaf3712007a8cc53a925bd643929cb61a44f04a..71b4d66d42ce2215d99d579b8797fcd902e17956 100644 (file)
@@ -6,6 +6,10 @@
 #include "shared-forward.h"
 
 #if HAVE_LIBARCHIVE
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBARCHIVE
+#  error "missing libarchive_cflags in meson dependency."
+#endif
+
 #include <archive.h>            /* IWYU pragma: export */
 #include <archive_entry.h>      /* IWYU pragma: export */
 
index 75cef6f1a04f941de4dfb9bc4b7fbde35ebcdb2d..d16e25df671ba852f22aeccfbfe96a84f7424e4c 100644 (file)
@@ -6,6 +6,10 @@
 int dlopen_libaudit(int log_level);
 
 #if HAVE_AUDIT
+#  ifndef SYSTEMD_CFLAGS_MARKER_LIBAUDIT
+#    error "missing libaudit_cflags in meson dependency."
+#  endif
+
 #  include <libaudit.h>         /* IWYU pragma: export */
 
 #  include "dlfcn-util.h"
index d9710566e6d2ee5233c8e514e4b2c07962072f61..106d7688fe958cfaa0c2d6497c5056e88836e009 100644 (file)
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #if HAVE_LIBCRYPT
+#  ifndef SYSTEMD_CFLAGS_MARKER_LIBCRYPT
+#    error "missing libcrypt_cflags in meson dependency."
+#  endif
 #  include <crypt.h>
 #endif
 
index 12a0201332fa493f13427de707b2aa6f51878c98..82705a7f23dd7970cc5c39d556c43ab87de55444 100644 (file)
@@ -19,6 +19,10 @@ typedef enum Fido2EnrollFlags {
 int dlopen_libfido2(int log_level);
 
 #if HAVE_LIBFIDO2
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBFIDO2
+#  error "missing libfido2_cflags in meson dependency."
+#endif
+
 #include <fido.h>
 
 #include "dlfcn-util.h"
index 44e58ec932040861d1c5a56c99b7562e49de8e0e..3afdb9737885a0a4f414a41d1b945195768bc5a5 100644 (file)
@@ -6,6 +6,9 @@
 #include "shared-forward.h"
 
 #if HAVE_LIBMOUNT
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBMOUNT
+#  error "missing libmount_cflags in meson dependency."
+#endif
 
 /* This needs to be after sys/mount.h */
 #include <libmount.h> /* IWYU pragma: export */
index 39b2b9267b2e31fda7bb5d6a5031479b3dadc8f4..c430f9e3d1a26a178a5095caa5bd1ee09f47a611 100644 (file)
@@ -8,6 +8,10 @@
 int dlopen_microhttpd(int log_level);
 
 #if HAVE_MICROHTTPD
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBMICROHTTPD
+#  error "missing libmicrohttpd_cflags in meson dependency."
+#endif
+
 #define MICROHTTPD_NOTE(priority)                                       \
         SD_ELF_NOTE_DLOPEN("microhttpd",                                \
                            "Support for embedded HTTP server via libmicrohttpd", \
index 730e14c31b32a32840301ed7947e39d27d4b1d41..59d2f3b1f1e0713b49182fd4e8165de4dc022ee1 100644 (file)
@@ -6,6 +6,9 @@
 #include "shared-forward.h"
 
 #if HAVE_KMOD
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBKMOD
+#  error "missing libkmod_cflags in meson dependency."
+#endif
 
 #include <libkmod.h> /* IWYU pragma: export */
 
index 408c371e8d7432e87c27c2d907ad439e8b71260d..41591a4d36cfc216157a5ad6319112226982d6c5 100644 (file)
@@ -6,6 +6,10 @@
 #include "shared-forward.h"
 
 #if HAVE_PAM
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBPAM
+#  error "missing libpam_cflags in meson dependency."
+#endif
+
 #include <security/pam_appl.h>
 #include <security/pam_ext.h>
 #include <security/pam_modules.h>       /* IWYU pragma: export */
index f32245d344cbea9758c8c17f10f9b3dc0064fb67..8d762f7e5cc6d823928755afc7935e6824f6789e 100644 (file)
@@ -6,6 +6,9 @@
 #include "log.h"                 /* IWYU pragma: keep */
 
 #if HAVE_PASSWDQC
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBPWQUALITY
+#  error "missing libpwquality_cflags in meson dependency."
+#endif
 
 #include <passwdqc.h>
 
index 34d9b1aa16e2662e421996796ec7af1206ace8fe..9952c4d195b2791984dd13625f3c24807c3cf860 100644 (file)
@@ -6,6 +6,9 @@
 #include "log.h"
 
 #if HAVE_PWQUALITY
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBPWQUALITY
+#  error "missing libpwquality_cflags in meson dependency."
+#endif
 
 #include <pwquality.h>
 #include <stdio.h>
index ba8827fb0749b666b0c384d3f160107f105358d7..6b24dc49824e03806690c3db57d166f3dacbe261 100644 (file)
@@ -4,6 +4,9 @@
 #include "shared-forward.h"
 
 #if HAVE_PCRE2
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBPCRE2
+#  error "missing libpcre2_cflags in meson dependency."
+#endif
 
 #include "dlfcn-util.h"
 
index f4599a50f16c6c39d1a6b91cd70f2c902e8e51b6..141fd29c338bebb409e02c0362fb8caa0c39ccaa 100644 (file)
@@ -2,6 +2,9 @@
 #pragma once
 
 #if HAVE_P11KIT
+#  ifndef SYSTEMD_CFLAGS_MARKER_LIBP11KIT
+#    error "missing libp11kit_cflags in meson dependency."
+#  endif
 #  include <p11-kit/p11-kit.h>  /* IWYU pragma: export */
 #  include <p11-kit/uri.h>      /* IWYU pragma: export */
 #endif
index 44d674ba6a3ae549ac2030bd68b2b3eba093517e..a5bf75f88918cd1188b370203f16fa55683dbf1c 100644 (file)
@@ -3,6 +3,9 @@
 #include "qrcode-util.h"
 
 #if HAVE_QRENCODE
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBQRENCODE
+#  error "missing libqrencode_cflags in meson dependency."
+#endif
 #include <qrencode.h>
 #endif
 #include <stdio.h>
index bd04fee34215433120c59075c1842c8ddf29110d..758b7a2600b06c322c0e72b201ed32369d61cae9 100644 (file)
@@ -5,6 +5,10 @@
 #include <unistd.h>
 
 #if HAVE_XENCTRL
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBXENCTRL
+#  error "missing libxenctrl_cflags in meson dependency."
+#endif
+
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 
index 89dcaf5ca74b07a754e1cf85c1ef35afc187857e..2bcb2d935bad08eb2814d2098646452a0dc75ddb 100644 (file)
@@ -7,6 +7,10 @@
 #include "shared-forward.h"
 
 #if HAVE_SECCOMP
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBSECCOMP
+#  error "missing libseccomp_cflags in meson dependency."
+#endif
+
 #include <seccomp.h> /* IWYU pragma: export */
 
 #include "dlfcn-util.h"
index 98cfb6bbe40b43b78b24ef00fc0fe10bceeb360d..3cc48dd3acd92bb71051bb04392693dafc218d10 100644 (file)
@@ -8,6 +8,10 @@
 #include "shared-forward.h"
 
 #if HAVE_SELINUX
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBSELINUX
+#  error "missing libselinux_cflags in meson dependency."
+#endif
+
 #include <selinux/avc.h>
 #include <selinux/label.h>
 #include <selinux/context.h>
index 857d4b5e173561ad9dda0d19a59ac76c59bc02cf..3a9a4084da34d1e026d69b2c01e15e47330c18ad 100644 (file)
@@ -8,6 +8,10 @@
 int dlopen_libssl(int log_level);
 
 #if HAVE_OPENSSL
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
+#  error "missing libopenssl_cflags in meson dependency."
+#endif
+
 #define LIBSSL_NOTE(priority)                                           \
         SD_ELF_NOTE_DLOPEN("libssl",                                    \
                            "Support for TLS",                           \
index eb910b1e84c3b83b51daa797d4adbec3602f3954..88098acac8ca7873257d338054d0f4c0bf782f77 100644 (file)
@@ -50,6 +50,10 @@ static inline bool TPM2_PCR_MASK_VALID(uint32_t pcr_mask) {
 int dlopen_tpm2(int log_level);
 
 #if HAVE_TPM2
+#ifndef SYSTEMD_CFLAGS_MARKER_TPM2
+#  error "missing tpm2_cflags in meson dependency."
+#endif
+
 #define TPM2_ESYS_NOTE(priority) \
         SD_ELF_NOTE_DLOPEN("tpm", "Support for TPM", priority, "libtss2-esys.so.0")
 #define TPM2_RC_NOTE(priority) \
index 75d06163c0c5eb8388592ec5278c8b84f29a6635..2df28f4398581625d34cd5d751065d4b8f8b6311 100644 (file)
@@ -10,6 +10,7 @@ executables += [
                         libblkid_cflags,
                         libcryptsetup_cflags,
                         libmount_cflags,
+                        libselinux_cflags,
                 ],
         },
 ]
index 882704c9d7d8799303ea50629bba632cfacf6f28..c287f8a490384e2dc3cf3a998560def05733083b 100644 (file)
@@ -65,6 +65,9 @@ executables += [
                 'sources' : files('fuzz-systemctl-parse-argv.c'),
                 'objects' : ['systemctl'],
                 'link_with' : systemctl_link_with,
+                'dependencies' : [
+                        libselinux_cflags,
+                ],
         },
 ]
 
index 03404886974ce3aef9da21730b94ef79ea9e70b0..37eb3f5b61922e3eafc19bb47fef225c0a8fa62a 100644 (file)
@@ -11,6 +11,10 @@ int dlopen_gcrypt(int log_level);
 int initialize_libgcrypt(bool secmem);
 
 #if HAVE_GCRYPT
+#ifndef SYSTEMD_CFLAGS_MARKER_LIBGCRYPT
+#  error "missing libgcrypt_cflags in meson dependency."
+#endif
+
 #define GCRYPT_NOTE(priority)                                           \
         SD_ELF_NOTE_DLOPEN("gcrypt",                                    \
                            "Support for journald forward-sealing",      \
index c90235e078949b5d70f03eabce26f46dfefd1c92..d7353ce8e2ce54661302882656274adbed5682c9 100644 (file)
@@ -79,13 +79,11 @@ simple_tests += files(
         'test-clock.c',
         'test-color-util.c',
         'test-compare-operator.c',
-        'test-condition.c',
         'test-conf-files.c',
         'test-conf-parser.c',
         'test-copy.c',
         'test-coredump-util.c',
         'test-cpu-set-util.c',
-        'test-creds.c',
         'test-daemon.c',
         'test-data-fd-util.c',
         'test-date.c',
@@ -170,7 +168,6 @@ simple_tests += files(
         'test-parse-util.c',
         'test-path-lookup.c',
         'test-path-util.c',
-        'test-pe-binary.c',
         'test-percent-util.c',
         'test-pidref.c',
         'test-pressure.c',
@@ -246,6 +243,7 @@ executables += [
         test_template + {
                 'sources' : files('test-acl-util.c'),
                 'conditions' : ['HAVE_ACL'],
+                'dependencies' : libacl_cflags,
         },
         test_template + {
                 'sources' : files('test-af-list.c') +
@@ -280,6 +278,14 @@ executables += [
                 'sources' : files('test-compress.c'),
                 'link_with' : [libshared],
         },
+        test_template + {
+                'sources' : files('test-condition.c'),
+                'dependencies' : [
+                        libapparmor_cflags,
+                        libaudit_cflags,
+                        libselinux_cflags,
+                ],
+        },
         test_template + {
                 'sources' : files('test-coredump-stacktrace.c'),
                 'type' : 'manual',
@@ -291,6 +297,10 @@ executables += [
                 'override_options' : ['b_sanitize=none', 'strip=false', 'debug=true'],
                 'c_args' : ['-fno-sanitize=all', '-fno-optimize-sibling-calls', '-O1'],
         },
+        test_template + {
+                'sources' : files('test-creds.c'),
+                'dependencies' : tpm2_cflags,
+        },
         test_template + {
                 'sources' : files('test-crypto-util.c'),
                 'dependencies' : libopenssl_cflags,
@@ -306,15 +316,29 @@ executables += [
                         'gcrypt-util.c',
                 ),
                 'dependencies' : [
+                        libacl_cflags,
+                        libapparmor_cflags,
+                        libarchive_cflags,
+                        libaudit_cflags,
                         libblkid_cflags,
+                        libbpf_cflags,
+                        libcryptsetup_cflags,
+                        libcurl_cflags,
                         libfdisk_cflags,
+                        libfido2_cflags,
                         libgcrypt_cflags,
                         libgnutls_cflags,
+                        libidn2_cflags,
                         libkmod_cflags,
                         libmicrohttpd_cflags,
                         libmount_cflags,
+                        libopenssl_cflags,
                         libp11kit_cflags,
+                        libpam_cflags,
+                        libpcre2_cflags,
                         libseccomp_cflags,
+                        libselinux_cflags,
+                        tpm2_cflags,
                 ],
         },
         test_template + {
@@ -373,6 +397,7 @@ executables += [
         test_template + {
                 'sources' : files('test-curl-util.c'),
                 'conditions' : ['HAVE_LIBCURL'],
+                'dependencies' : libcurl_cflags,
         },
         test_template + {
                 'sources' : files('test-libcrypt-util.c'),
@@ -423,6 +448,10 @@ executables += [
                 'objects' : ['test-nss-hosts'],
                 'conditions' : ['ENABLE_NSS'],
         },
+        test_template + {
+                'sources' : files('test-pe-binary.c'),
+                'dependencies' : libopenssl_cflags,
+        },
         test_template + {
                 'sources' : files('test-pkcs7-util.c'),
                 'dependencies' : libopenssl_cflags,
@@ -476,7 +505,10 @@ executables += [
         },
         test_template + {
                 'sources' : files('test-tpm2.c'),
-                'dependencies' : libopenssl_cflags,
+                'dependencies' : [
+                        libopenssl_cflags,
+                        tpm2_cflags,
+                ],
                 'timeout' : 120,
         },
         test_template + {
@@ -528,11 +560,17 @@ executables += [
         },
         core_test_template + {
                 'sources' : files('test-bpf-restrict-fs.c'),
-                'dependencies' : common_test_dependencies,
+                'dependencies' : [
+                        common_test_dependencies,
+                        libbpf_cflags,
+                ],
         },
         core_test_template + {
                 'sources' : files('test-bpf-restrict-fsaccess.c'),
-                'dependencies' : common_test_dependencies,
+                'dependencies' : [
+                        common_test_dependencies,
+                        libbpf_cflags,
+                ],
                 'bpf_programs' : ['restrict-fsaccess'],
                 'type' : 'manual',
         },
@@ -584,7 +622,10 @@ executables += [
         },
         core_test_template + {
                 'sources' : files('test-load-fragment.c'),
-                'dependencies' : common_test_dependencies,
+                'dependencies' : [
+                        common_test_dependencies,
+                        libpcre2_cflags,
+                ],
         },
         core_test_template + {
                 'sources' : files('test-loop-util.c'),
index 2a7728c295533dd40105321948a00b1041d60150..fcf2749e4bf2bd2715f19ff5834762051907bdaf 100644 (file)
@@ -12,7 +12,10 @@ executables += [
                 'public' : true,
                 'extract' : files('tmpfiles.c') +
                             offline_passwd_c,
-                'dependencies' : libacl_cflags,
+                'dependencies' : [
+                        libacl_cflags,
+                        libselinux_cflags,
+                ],
         },
         executable_template + {
                 'name' : 'systemd-tmpfiles.standalone',
@@ -24,7 +27,10 @@ executables += [
                         libshared_static,
                         libsystemd_static,
                 ],
-                'dependencies' : libacl_cflags,
+                'dependencies' : [
+                        libacl_cflags,
+                        libselinux_cflags,
+                ],
         },
         test_template + {
                 'sources' : files('test-offline-passwd.c') +
index 55f0ce26d31cb972bb749ae51e0f82bf36ce729e..bb3c3338ba251f0266b95a96f4504a90792c2d72 100644 (file)
@@ -11,6 +11,7 @@ executables += [
                 ],
                 'dependencies' : [
                         libopenssl_cflags,
+                        tpm2_cflags,
                 ],
         },
         libexec_template + {
@@ -21,6 +22,9 @@ executables += [
                         'HAVE_OPENSSL',
                         'HAVE_TPM2',
                 ],
+                'dependencies' : [
+                        tpm2_cflags,
+                ],
         },
         libexec_template + {
                 'name' : 'systemd-tpm2-swtpm',
@@ -39,6 +43,9 @@ executables += [
                         'HAVE_OPENSSL',
                         'HAVE_TPM2',
                 ],
+                'dependencies' : [
+                        tpm2_cflags,
+                ],
         },
 ]
 
index 375645e7593ed79b5ea3e9f86bec761f96b33438..6c2232c74c6dc289873b529e8681993a72c208ec 100644 (file)
@@ -122,6 +122,8 @@ udev_dependencies = [
         libblkid_cflags,
         libkmod_cflags,
         libmount_cflags,
+        libselinux_cflags,
+        tpm2_cflags,
 ]
 
 udev_plugin_template = executable_template + {
index 21432d41f1658454674282fbcae8a2f00e765e78..437e58ecd834ef179f53a1007c5798c9457e339f 100644 (file)
@@ -8,7 +8,10 @@ executables += [
         libexec_template + {
                 'name' : 'systemd-veritysetup',
                 'sources' : files('veritysetup.c'),
-                'dependencies' : libcryptsetup_cflags,
+                'dependencies' : [
+                        libcryptsetup_cflags,
+                        tpm2_cflags,
+                ],
         },
         generator_template + {
                 'name' : 'systemd-veritysetup-generator',