]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Introduce userspace dep
authorJan Janssen <medhefgo@web.de>
Sun, 26 Feb 2023 10:07:24 +0000 (11:07 +0100)
committerJan Janssen <medhefgo@web.de>
Fri, 10 Mar 2023 10:40:14 +0000 (11:40 +0100)
This will help in a later commit to separate userspace from EFI builds.

18 files changed:
meson.build
src/basic/meson.build
src/core/meson.build
src/cryptsetup/cryptsetup-tokens/meson.build
src/import/meson.build
src/journal-remote/meson.build
src/journal/meson.build
src/libsystemd-network/meson.build
src/libsystemd/meson.build
src/libudev/meson.build
src/login/meson.build
src/machine/meson.build
src/network/meson.build
src/nspawn/meson.build
src/resolve/meson.build
src/shared/meson.build
src/timesync/meson.build
src/udev/meson.build

index 4a5978453650b59f700ab51ea8d3efe6b68b6743..8b298ca3359d66800cc4fe0aa6b2e5f7b022df01 100644 (file)
@@ -318,6 +318,8 @@ conf.set10('FIRST_BOOT_FULL_PRESET',                          get_option('first-
 #####################################################################
 
 cc = meson.get_compiler('c')
+userspace_c_args = []
+userspace_c_ld_args = []
 meson_build_sh = find_program('tools/meson-build.sh')
 
 want_tests = get_option('tests')
@@ -336,9 +338,9 @@ endif
 if want_libfuzzer
         fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer', required : false)
         if fuzzing_engine.found()
-                add_project_arguments('-fsanitize-coverage=trace-pc-guard,trace-cmp', language : 'c')
+                userspace_c_args += '-fsanitize-coverage=trace-pc-guard,trace-cmp'
         elif cc.has_argument('-fsanitize=fuzzer-no-link')
-                add_project_arguments('-fsanitize=fuzzer-no-link', language : 'c')
+                userspace_c_args += '-fsanitize=fuzzer-no-link'
         else
                 error('Looks like neither libFuzzer nor -fsanitize=fuzzer-no-link is supported')
         endif
@@ -451,7 +453,7 @@ if get_option('mode') == 'release'
         possible_common_cc_flags += '-ftrivial-auto-var-init=zero'
 endif
 
-possible_cc_flags = possible_common_cc_flags + [
+possible_cc_flags = [
         '-Werror=missing-declarations',
         '-Werror=missing-prototypes',
         '-fdiagnostics-show-option',
@@ -477,9 +479,15 @@ if get_option('mode') == 'developer'
         possible_cc_flags += '-fno-omit-frame-pointer'
 endif
 
-add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
-add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
-add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
+add_project_arguments(
+        cc.get_supported_arguments(
+                basic_disabled_warnings,
+                possible_common_cc_flags
+        ),
+        language : 'c')
+
+userspace_c_args += cc.get_supported_arguments(possible_cc_flags)
+userspace_c_ld_args += cc.get_supported_link_arguments(possible_link_flags)
 
 have = cc.has_argument('-Wzero-length-bounds')
 conf.set10('HAVE_ZERO_LENGTH_BOUNDS', have)
@@ -667,7 +675,9 @@ else
                 command: vcs_tagger)
 endif
 
-versiondep = declare_dependency(sources: version_h)
+versiondep = declare_dependency(
+        sources: version_h,
+        include_directories : include_directories('.'))
 
 shared_lib_tag = get_option('shared-lib-tag')
 if shared_lib_tag == ''
@@ -1980,7 +1990,7 @@ export_dbus_interfaces_py = find_program('tools/dbus_exporter.py')
 ############################################################
 
 if get_option('b_coverage')
-        add_project_arguments('-include', 'src/basic/coverage.h', language : 'c')
+        userspace_c_args += ['-include', 'src/basic/coverage.h']
 endif
 
 ############################################################
@@ -1989,10 +1999,15 @@ config_h = configure_file(
         output : 'config.h',
         configuration : conf)
 
-add_project_arguments('-include', 'config.h', language : 'c')
+userspace_c_args += ['-include', 'config.h']
 
 jinja2_cmdline = [meson_render_jinja2, config_h, version_h]
 
+userspace = declare_dependency(
+        compile_args : userspace_c_args,
+        link_args : userspace_c_ld_args,
+)
+
 ############################################################
 
 # binaries that have --help and are intended for use by humans,
@@ -2042,8 +2057,9 @@ libsystemd = shared_library(
                      libbasic_gcrypt,
                      libbasic_compress],
         link_whole : [libsystemd_static],
-        dependencies : [threads,
-                        librt],
+        dependencies : [librt,
+                        threads,
+                        userspace],
         link_depends : libsystemd_sym,
         install : true,
         install_tag: 'libsystemd',
@@ -2064,17 +2080,18 @@ install_libsystemd_static = static_library(
         install_tag: 'libsystemd',
         install_dir : rootlibdir,
         pic : static_libsystemd_pic,
-        dependencies : [threads,
-                        librt,
-                        libxz,
-                        libzstd,
-                        liblz4,
-                        libdl,
+        dependencies : [libblkid,
                         libcap,
-                        libblkid,
-                        libmount,
+                        libdl,
                         libgcrypt,
+                        liblz4,
+                        libmount,
                         libopenssl,
+                        librt,
+                        libxz,
+                        libzstd,
+                        threads,
+                        userspace,
                         versiondep],
         c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
 
@@ -2086,7 +2103,8 @@ libudev = shared_library(
                      '-Wl,--version-script=' + libudev_sym_path],
         link_with : [libsystemd_static, libshared_static],
         link_whole : libudev_basic,
-        dependencies : [threads],
+        dependencies : [threads,
+                        userspace],
         link_depends : libudev_sym,
         install : true,
         install_tag: 'libudev',
@@ -2107,8 +2125,9 @@ install_libudev_static = static_library(
         install_tag: 'libudev',
         install_dir : rootlibdir,
         link_depends : libudev_sym,
-        dependencies : [libshared_deps,
-                        libmount,
+        dependencies : [libmount,
+                        libshared_deps,
+                        userspace,
                         versiondep],
         c_args : static_libudev_pic ? [] : ['-fno-PIC'],
         pic : static_libudev_pic)
@@ -2125,6 +2144,7 @@ if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1
                                      libshared],
                         dependencies : [libcryptsetup,
                                         tpm2,
+                                        userspace,
                                         versiondep],
                         link_depends : cryptsetup_token_sym,
                         install_rpath : rootpkglibdir,
@@ -2143,6 +2163,7 @@ if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1
                                      libshared],
                         dependencies : [libcryptsetup,
                                         libfido2,
+                                        userspace,
                                         versiondep],
                         link_depends : cryptsetup_token_sym,
                         install_rpath : rootpkglibdir,
@@ -2161,6 +2182,7 @@ if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1
                                      libshared],
                         dependencies : [libcryptsetup,
                                         libp11kit,
+                                        userspace,
                                         versiondep],
                         link_depends : cryptsetup_token_sym,
                         install_rpath : rootpkglibdir,
@@ -2227,7 +2249,8 @@ test_dlopen = executable(
         test_dlopen_c,
         include_directories : includes,
         link_with : [libbasic],
-        dependencies : [libdl],
+        dependencies : [libdl,
+                        userspace],
         build_by_default : want_tests != 'false')
 
 foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
@@ -2263,8 +2286,9 @@ foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
                         link_with : [libsystemd_static,
                                      libshared_static,
                                      libbasic],
-                        dependencies : [threads,
-                                        librt],
+                        dependencies : [librt,
+                                        threads,
+                                        userspace],
                         link_depends : sym,
                         install : true,
                         install_tag : 'nss',
@@ -2297,6 +2321,7 @@ exe = executable(
         link_with : [libcore,
                      libshared],
         dependencies : [libseccomp,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -2315,6 +2340,7 @@ exe = executable(
         link_with : [libcore,
                      libshared],
         dependencies : [libseccomp,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : conf.get('ENABLE_ANALYZE') == 1)
@@ -2332,11 +2358,12 @@ executable(
         include_directories : includes,
         link_with : [libjournal_core,
                      libshared],
-        dependencies : [threads,
-                        libxz,
-                        liblz4,
+        dependencies : [liblz4,
                         libselinux,
+                        libxz,
                         libzstd,
+                        threads,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -2349,6 +2376,7 @@ public_programs += executable(
         link_with : [libjournal_core,
                      libshared],
         dependencies : [threads,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true)
@@ -2366,12 +2394,12 @@ public_programs += executable(
         journalctl_sources,
         include_directories : includes,
         link_with : [journalctl_link_with],
-        dependencies : [threads,
-                        libdl,
-                        libxz,
+        dependencies : [libdl,
                         liblz4,
+                        libxz,
                         libzstd,
-                        libdl,
+                        threads,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -2382,6 +2410,7 @@ executable(
         'src/getty-generator/getty-generator.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : systemgeneratordir)
@@ -2391,6 +2420,7 @@ executable(
         'src/debug-generator/debug-generator.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : systemgeneratordir)
@@ -2400,6 +2430,7 @@ executable(
         'src/run-generator/run-generator.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : systemgeneratordir)
@@ -2409,6 +2440,7 @@ exe = executable(
         'src/fstab-generator/fstab-generator.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : systemgeneratordir)
@@ -2431,6 +2463,7 @@ if conf.get('ENABLE_ENVIRONMENT_D') == 1
                 'src/environment-d-generator/environment-d-generator.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : userenvgeneratordir)
@@ -2446,6 +2479,7 @@ if conf.get('ENABLE_HIBERNATE') == 1
                 'src/hibernate-resume/hibernate-resume-generator.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -2455,6 +2489,7 @@ if conf.get('ENABLE_HIBERNATE') == 1
                 'src/hibernate-resume/hibernate-resume.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2466,7 +2501,8 @@ if conf.get('HAVE_BLKID') == 1
                 'src/gpt-auto-generator/gpt-auto-generator.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : libblkid,
+                dependencies : [libblkid,
+                                userspace],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -2476,7 +2512,8 @@ if conf.get('HAVE_BLKID') == 1
                 'src/dissect/dissect.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
 
@@ -2493,7 +2530,8 @@ if conf.get('ENABLE_RESOLVE') == 1
                 link_with : [libshared,
                              libbasic_gcrypt,
                              libsystemd_resolve_core],
-                dependencies : systemd_resolved_dependencies,
+                dependencies : [systemd_resolved_dependencies,
+                                userspace],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2505,10 +2543,11 @@ if conf.get('ENABLE_RESOLVE') == 1
                 link_with : [libshared,
                              libbasic_gcrypt,
                              libsystemd_resolve_core],
-                dependencies : [threads,
-                                lib_openssl_or_gcrypt,
-                                libm,
+                dependencies : [lib_openssl_or_gcrypt,
                                 libidn,
+                                libm,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
@@ -2529,8 +2568,9 @@ if conf.get('ENABLE_LOGIND') == 1
                 include_directories : includes,
                 link_with : [liblogind_core,
                              libshared],
-                dependencies : [threads,
-                                libacl,
+                dependencies : [libacl,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2541,10 +2581,11 @@ if conf.get('ENABLE_LOGIND') == 1
                 loginctl_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [threads,
-                                liblz4,
+                dependencies : [liblz4,
                                 libxz,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2555,7 +2596,8 @@ if conf.get('ENABLE_LOGIND') == 1
                 'src/login/inhibit.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootbindir)
@@ -2571,9 +2613,10 @@ if conf.get('ENABLE_LOGIND') == 1
                                      '-Wl,--version-script=' + version_script_arg],
                         link_with : [libsystemd_static,
                                      libshared_static],
-                        dependencies : [threads,
+                        dependencies : [libpam_misc,
                                         libpam,
-                                        libpam_misc,
+                                        threads,
+                                        userspace,
                                         versiondep],
                         link_depends : pam_systemd_sym,
                         install : true,
@@ -2594,6 +2637,7 @@ if conf.get('ENABLE_LOGIND') == 1
                 user_runtime_dir_sources,
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2605,6 +2649,7 @@ if conf.get('HAVE_PAM') == 1
                 'src/user-sessions/user-sessions.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2623,6 +2668,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1
                 include_directories : includes,
                 link_with : [boot_link_with],
                 dependencies : [libblkid,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
@@ -2641,6 +2687,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1
                 include_directories : includes,
                 link_with : [boot_link_with],
                 dependencies : [libblkid,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2651,6 +2698,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1
                 'src/boot/bless-boot-generator.c',
                 include_directories : includes,
                 link_with : [boot_link_with],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -2662,6 +2710,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1
                         include_directories : includes,
                         link_with : [libshared],
                         dependencies : [libopenssl,
+                                        userspace,
                                         versiondep],
                         install_rpath : rootpkglibdir,
                         install : true,
@@ -2671,9 +2720,10 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1
                         'src/boot/pcrphase.c',
                         include_directories : includes,
                         link_with : [libshared],
-                        dependencies : [libopenssl,
+                        dependencies : [libblkid,
+                                        libopenssl,
                                         tpm2,
-                                        libblkid,
+                                        userspace,
                                         versiondep],
                         install_rpath : rootpkglibdir,
                         install : true,
@@ -2687,6 +2737,7 @@ executable(
         include_directories : includes,
         link_with : [libshared],
         dependencies : [libblkid,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -2698,6 +2749,7 @@ public_programs += executable(
         include_directories : includes,
         link_with : [libshared],
         dependencies : [threads,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true)
@@ -2707,12 +2759,13 @@ systemctl = executable(
         systemctl_sources,
         include_directories : includes,
         link_with : systemctl_link_with,
-        dependencies : [threads,
-                        libcap,
+        dependencies : [libcap,
+                        liblz4,
                         libselinux,
                         libxz,
-                        liblz4,
                         libzstd,
+                        threads,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -2725,8 +2778,9 @@ if conf.get('ENABLE_PORTABLED') == 1
                 systemd_portabled_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [threads,
-                                libselinux,
+                dependencies : [libselinux,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2738,6 +2792,7 @@ if conf.get('ENABLE_PORTABLED') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2750,7 +2805,8 @@ if conf.get('ENABLE_SYSEXT') == 1
                 systemd_sysext_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootbindir)
@@ -2763,6 +2819,7 @@ if conf.get('ENABLE_USERDB') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2774,6 +2831,7 @@ if conf.get('ENABLE_USERDB') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2785,6 +2843,7 @@ if conf.get('ENABLE_USERDB') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
@@ -2797,12 +2856,13 @@ if conf.get('ENABLE_HOMED') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              libshared_fdisk],
-                dependencies : [threads,
-                                libblkid,
+                dependencies : [libblkid,
                                 libcrypt,
-                                libopenssl,
                                 libfdisk,
+                                libopenssl,
                                 libp11kit,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2813,10 +2873,11 @@ if conf.get('ENABLE_HOMED') == 1
                 systemd_homed_sources,
                 include_directories : home_includes,
                 link_with : [libshared],
-                dependencies : [threads,
-                                libcrypt,
-                                libopenssl,
+                dependencies : [libcrypt,
                                 libm,
+                                libopenssl,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2827,11 +2888,12 @@ if conf.get('ENABLE_HOMED') == 1
                 homectl_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [threads,
-                                libcrypt,
+                dependencies : [libcrypt,
+                                libdl,
                                 libopenssl,
                                 libp11kit,
-                                libdl,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
@@ -2847,10 +2909,11 @@ if conf.get('ENABLE_HOMED') == 1
                                      '-Wl,--version-script=' + version_script_arg],
                         link_with : [libsystemd_static,
                                      libshared_static],
-                        dependencies : [threads,
-                                        libpam,
+                        dependencies : [libcrypt,
                                         libpam_misc,
-                                        libcrypt,
+                                        libpam,
+                                        threads,
+                                        userspace,
                                         versiondep],
                         link_depends : pam_systemd_home_sym,
                         install : true,
@@ -2884,6 +2947,7 @@ if conf.get('ENABLE_BACKLIGHT') == 1
                 'src/backlight/backlight.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2895,6 +2959,7 @@ if conf.get('ENABLE_RFKILL') == 1
                 'src/rfkill/rfkill.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2905,6 +2970,7 @@ executable(
         'src/system-update-generator/system-update-generator.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : systemgeneratordir)
@@ -2916,9 +2982,10 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [libcryptsetup,
+                                libopenssl,
                                 libp11kit,
-                                versiondep,
-                                libopenssl],
+                                userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2928,6 +2995,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1
                 'src/cryptsetup/cryptsetup-generator.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -2938,6 +3006,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [libcryptsetup,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2948,7 +3017,8 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1
                 'src/veritysetup/veritysetup-generator.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -2962,6 +3032,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1
                                 libdl,
                                 libopenssl,
                                 libp11kit,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
@@ -2972,6 +3043,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [libcryptsetup,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -2982,6 +3054,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1
                 ['src/integritysetup/integritysetup-generator.c', 'src/integritysetup/integrity-util.c'],
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -2993,6 +3066,7 @@ if conf.get('HAVE_SYSV_COMPAT') == 1
                 'src/sysv-generator/sysv-generator.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -3009,6 +3083,7 @@ if conf.get('HAVE_SYSV_COMPAT') == 1
                 'src/rc-local-generator/rc-local-generator.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : systemgeneratordir)
@@ -3020,6 +3095,7 @@ if conf.get('ENABLE_XDG_AUTOSTART') == 1
                 systemd_xdg_autostart_generator_sources,
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : usergeneratordir)
@@ -3029,6 +3105,7 @@ if conf.get('ENABLE_XDG_AUTOSTART') == 1
                 'src/xdg-autostart-generator/xdg-autostart-condition.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3040,6 +3117,7 @@ if conf.get('ENABLE_HOSTNAMED') == 1
                 'src/hostname/hostnamed.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3049,7 +3127,8 @@ if conf.get('ENABLE_HOSTNAMED') == 1
                 'src/hostname/hostnamectl.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
 endif
@@ -3060,9 +3139,11 @@ if conf.get('ENABLE_LOCALED') == 1
                 # need to specify where the headers are
                 deps = [libdl,
                         libxkbcommon.partial_dependency(compile_args: true),
+                        userspace,
                         versiondep]
         else
-                deps = [versiondep]
+                deps = [userspace,
+                        versiondep]
         endif
 
         dbus_programs += executable(
@@ -3080,7 +3161,8 @@ if conf.get('ENABLE_LOCALED') == 1
                 localectl_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
 endif
@@ -3091,6 +3173,7 @@ if conf.get('ENABLE_TIMEDATED') == 1
                 'src/timedate/timedated.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3104,6 +3187,7 @@ if conf.get('ENABLE_TIMEDATECTL') == 1
                 install_rpath : rootpkglibdir,
                 link_with : [libshared],
                 dependencies : [libm,
+                                userspace,
                                 versiondep],
                 install : true)
 endif
@@ -3114,8 +3198,9 @@ if conf.get('ENABLE_TIMESYNCD') == 1
                 systemd_timesyncd_sources,
                 include_directories : includes,
                 link_with : [libtimesyncd_core],
-                dependencies : [threads,
-                                libm,
+                dependencies : [libm,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3126,6 +3211,7 @@ if conf.get('ENABLE_TIMESYNCD') == 1
                 'src/timesync/wait-sync.c',
                 include_directories : includes,
                 link_with : [libtimesyncd_core],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3138,6 +3224,7 @@ if conf.get('ENABLE_MACHINED') == 1
                 include_directories : includes,
                 link_with : [libmachine_core,
                              libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3147,10 +3234,11 @@ if conf.get('ENABLE_MACHINED') == 1
                 'src/machine/machinectl.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [threads,
+                dependencies : [liblz4,
                                 libxz,
-                                liblz4,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3164,6 +3252,7 @@ if conf.get('ENABLE_IMPORTD') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3175,11 +3264,12 @@ if conf.get('ENABLE_IMPORTD') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              lib_import_common],
-                dependencies : [libcurl,
-                                lib_openssl_or_gcrypt,
-                                libz,
+                dependencies : [lib_openssl_or_gcrypt,
                                 libbzip2,
+                                libcurl,
                                 libxz,
+                                libz,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3191,10 +3281,11 @@ if conf.get('ENABLE_IMPORTD') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              lib_import_common],
-                dependencies : [libcurl,
-                                libz,
-                                libbzip2,
+                dependencies : [libbzip2,
+                                libcurl,
                                 libxz,
+                                libz,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3206,7 +3297,8 @@ if conf.get('ENABLE_IMPORTD') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              lib_import_common],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3217,10 +3309,11 @@ if conf.get('ENABLE_IMPORTD') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              lib_import_common],
-                dependencies : [libcurl,
-                                libz,
-                                libbzip2,
+                dependencies : [libbzip2,
+                                libcurl,
                                 libxz,
+                                libz,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3235,12 +3328,13 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
                 systemd_journal_upload_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [threads,
-                                libcurl,
+                dependencies : [libcurl,
                                 libgnutls,
-                                libxz,
                                 liblz4,
+                                libxz,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3254,12 +3348,13 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
                 include_directories : journal_includes,
                 link_with : [libshared,
                              libsystemd_journal_remote],
-                dependencies : [threads,
+                dependencies : [libgnutls,
+                                liblz4,
                                 libmicrohttpd,
-                                libgnutls,
                                 libxz,
-                                liblz4,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3270,12 +3365,13 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
                 systemd_journal_gatewayd_sources,
                 include_directories : journal_includes,
                 link_with : [libshared],
-                dependencies : [threads,
+                dependencies : [libgnutls,
+                                liblz4,
                                 libmicrohttpd,
-                                libgnutls,
                                 libxz,
-                                liblz4,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3289,11 +3385,12 @@ if conf.get('ENABLE_COREDUMP') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              libbasic_compress],
-                dependencies : [threads,
-                                libacl,
-                                libxz,
+                dependencies : [libacl,
                                 liblz4,
+                                libxz,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3305,10 +3402,11 @@ if conf.get('ENABLE_COREDUMP') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              libbasic_compress],
-                dependencies : [threads,
+                dependencies : [liblz4,
                                 libxz,
-                                liblz4,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
@@ -3320,11 +3418,12 @@ if conf.get('ENABLE_PSTORE') == 1
                 systemd_pstore_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [threads,
-                                libacl,
-                                libxz,
+                dependencies : [libacl,
                                 liblz4,
+                                libxz,
                                 libzstd,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3337,6 +3436,7 @@ if conf.get('ENABLE_OOMD') == 1
                    include_directories : includes,
                    link_with : [libshared],
                    dependencies : [libatomic,
+                                   userspace,
                                    versiondep],
                    install_rpath : rootpkglibdir,
                    install : true,
@@ -3347,7 +3447,8 @@ if conf.get('ENABLE_OOMD') == 1
                 oomctl_sources,
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true)
 endif
@@ -3358,7 +3459,8 @@ if conf.get('ENABLE_BINFMT') == 1
                 'src/binfmt/binfmt.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3378,10 +3480,11 @@ if conf.get('ENABLE_SYSUPDATE') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              libshared_fdisk],
-                dependencies : [threads,
-                                libblkid,
+                dependencies : [libblkid,
                                 libfdisk,
                                 libopenssl,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3395,6 +3498,7 @@ if conf.get('ENABLE_VCONSOLE') == 1
                 'src/vconsole/vconsole-setup.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3406,7 +3510,8 @@ if conf.get('ENABLE_RANDOMSEED') == 1
                 'src/random-seed/random-seed.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3419,6 +3524,7 @@ if conf.get('ENABLE_FIRSTBOOT') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [libcrypt,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3430,7 +3536,8 @@ executable(
         'src/remount-fs/remount-fs.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3440,7 +3547,8 @@ executable(
         'src/machine-id-setup/machine-id-setup-main.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootbindir)
@@ -3450,7 +3558,8 @@ executable(
         'src/fsck/fsck.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3460,7 +3569,8 @@ executable(
         'src/partition/growfs.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3470,7 +3580,8 @@ executable(
         'src/partition/makefs.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3480,7 +3591,8 @@ executable(
         'src/sleep/sleep.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3495,7 +3607,8 @@ public_programs += executable(
         'src/sysctl/sysctl.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3505,7 +3618,8 @@ public_programs += executable(
         'src/ac-power/ac-power.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3514,7 +3628,8 @@ public_programs += executable(
         'src/detect-virt/detect-virt.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3523,7 +3638,8 @@ public_programs += executable(
         'src/delta/delta.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3532,7 +3648,8 @@ public_programs += executable(
         'src/escape/escape.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootbindir)
@@ -3542,7 +3659,8 @@ public_programs += executable(
         'src/notify/notify.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootbindir)
@@ -3554,6 +3672,7 @@ public_programs += executable(
         link_with : [libshared],
         dependencies : [threads,
                         libopenssl,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -3564,6 +3683,7 @@ executable(
         'src/volatile-root/volatile-root.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : conf.get('ENABLE_INITRD') == 1,
         install_dir : rootlibexecdir)
@@ -3573,6 +3693,7 @@ executable(
         'src/cgroups-agent/cgroups-agent.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3582,7 +3703,8 @@ systemd_id128 = executable(
         'src/id128/id128.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 public_programs += systemd_id128
@@ -3600,7 +3722,8 @@ public_programs += executable(
         'src/path/path.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3609,7 +3732,8 @@ public_programs += executable(
         'src/ask-password/ask-password.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootbindir)
@@ -3619,6 +3743,7 @@ executable(
         'src/reply-password/reply-password.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3628,7 +3753,8 @@ public_programs += executable(
         'src/tty-ask-password-agent/tty-ask-password-agent.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootbindir)
@@ -3638,7 +3764,8 @@ public_programs += executable(
         'src/cgls/cgls.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3647,7 +3774,8 @@ public_programs += executable(
         'src/cgtop/cgtop.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3656,6 +3784,7 @@ executable(
         'src/initctl/initctl.c',
         include_directories : includes,
         link_with : [libshared],
+        dependencies : userspace,
         install_rpath : rootpkglibdir,
         install : (conf.get('HAVE_SYSV_COMPAT') == 1),
         install_dir : rootlibexecdir)
@@ -3666,6 +3795,7 @@ public_programs += executable(
         include_directories : includes,
         link_with : [libshared],
         dependencies: [libmount,
+                       userspace,
                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
@@ -3678,7 +3808,8 @@ public_programs += executable(
         'src/run/run.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3687,7 +3818,7 @@ public_programs += executable(
         'src/stdio-bridge/stdio-bridge.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep,
+        dependencies : [userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true)
@@ -3697,7 +3828,8 @@ public_programs += executable(
         busctl_sources,
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true)
 
@@ -3707,7 +3839,8 @@ if enable_sysusers
                 'src/sysusers/sysusers.c',
                 include_directories : includes,
                 link_with : [libshared],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootbindir)
@@ -3730,7 +3863,8 @@ if enable_sysusers
                                      libbasic,
                                      libbasic_gcrypt,
                                      libsystemd_static],
-                        dependencies : [versiondep],
+                        dependencies : [userspace,
+                                        versiondep],
                         install : true,
                         install_dir : rootbindir)
                 public_programs += exe
@@ -3751,6 +3885,7 @@ if conf.get('ENABLE_TMPFILES') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [libacl,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3775,6 +3910,7 @@ if conf.get('ENABLE_TMPFILES') == 1
                                      libbasic_gcrypt,
                                      libsystemd_static],
                         dependencies : [libacl,
+                                        userspace,
                                         versiondep],
                         install : true,
                         install_dir : rootbindir)
@@ -3795,7 +3931,8 @@ if conf.get('ENABLE_HWDB') == 1
                 'src/hwdb/hwdb.c',
                 include_directories : includes,
                 link_with : udev_link_with,
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : udev_rpath,
                 install : true,
                 install_dir : rootbindir)
@@ -3816,6 +3953,7 @@ if conf.get('ENABLE_QUOTACHECK') == 1
                 'src/quotacheck/quotacheck.c',
                 include_directories : includes,
                 link_with : [libshared],
+                dependencies : userspace,
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -3827,6 +3965,7 @@ public_programs += executable(
         include_directories : includes,
         link_with : [libshared],
         dependencies : [threads,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -3837,11 +3976,12 @@ udevadm = executable(
         udevadm_sources,
         include_directories : includes,
         link_with : [libudevd_core],
-        dependencies : [threads,
-                        libkmod,
-                        libidn,
-                        libacl,
+        dependencies : [libacl,
                         libblkid,
+                        libidn,
+                        libkmod,
+                        threads,
+                        userspace,
                         versiondep],
         install_rpath : udev_rpath,
         install : true,
@@ -3862,10 +4002,11 @@ if conf.get('ENABLE_REPART') == 1
                 include_directories : includes,
                 link_with : [libshared,
                              libshared_fdisk],
-                dependencies : [threads,
-                                libblkid,
+                dependencies : [libblkid,
                                 libfdisk,
                                 libopenssl,
+                                threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3883,10 +4024,11 @@ if conf.get('ENABLE_REPART') == 1
                                      libbasic_gcrypt,
                                      libsystemd_static,
                                      libshared_fdisk],
-                        dependencies : [threads,
-                                        libblkid,
+                        dependencies : [libblkid,
                                         libfdisk,
                                         libopenssl,
+                                        threads,
+                                        userspace,
                                         versiondep],
                         install_rpath : rootpkglibdir,
                         install : true,
@@ -3901,6 +4043,7 @@ executable(
         include_directories : includes,
         link_with : [libshared],
         dependencies : [libmount,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true,
@@ -3916,6 +4059,7 @@ if have_standalone_binaries
                              libbasic,
                              libsystemd_static],
                 dependencies : [libmount,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3927,7 +4071,8 @@ executable(
         'src/update-done/update-done.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -3938,6 +4083,7 @@ executable(
         include_directories : includes,
         link_with : [libshared],
         dependencies : [libaudit,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : (conf.get('ENABLE_UTMP') == 1),
@@ -3950,6 +4096,7 @@ if conf.get('HAVE_KMOD') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 dependencies : [libkmod,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3971,6 +4118,7 @@ public_programs += executable(
                      libshared],
         dependencies : [libblkid,
                         libseccomp,
+                        userspace,
                         versiondep],
         install_rpath : rootpkglibdir,
         install : true)
@@ -3984,6 +4132,7 @@ if conf.get('ENABLE_NETWORKD') == 1
                              libsystemd_network,
                              networkd_link_with],
                 dependencies : [threads,
+                                userspace,
                                 versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
@@ -3994,7 +4143,8 @@ if conf.get('ENABLE_NETWORKD') == 1
                 systemd_networkd_wait_online_sources,
                 include_directories : includes,
                 link_with : [networkd_link_with],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -4005,7 +4155,8 @@ if conf.get('ENABLE_NETWORKD') == 1
                 include_directories : libsystemd_network_includes,
                 link_with : [libsystemd_network,
                              networkd_link_with],
-                dependencies : [versiondep],
+                dependencies : [userspace,
+                                versiondep],
                 install_rpath : rootpkglibdir,
                 install : true,
                 install_dir : rootbindir)
@@ -4016,7 +4167,8 @@ exe = executable(
         network_generator_sources,
         include_directories : includes,
         link_with : [networkd_link_with],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -4034,7 +4186,8 @@ executable(
         'src/sulogin-shell/sulogin-shell.c',
         include_directories : includes,
         link_with : [libshared],
-        dependencies : [versiondep],
+        dependencies : [userspace,
+                        versiondep],
         install_rpath : rootpkglibdir,
         install : true,
         install_dir : rootlibexecdir)
@@ -4098,9 +4251,18 @@ foreach test : tests
         condition = test.get('condition', '')
         type = test.get('type', '')
         base = test.get('base', {})
+        deps = [
+                base.get('dependencies', []),
+                test.get('dependencies', []),
+                versiondep,
+        ]
 
         # FIXME: Use fs.stem() with meson >= 0.54.0
-        name = '@0@'.format(sources[0]).split('/')[-1].split('.')[0]
+        name = '@0@'.format(sources[0]).split('/')[-1]
+        if not name.endswith('.cc')
+                deps += [userspace]
+        endif
+        name = name.split('.')[0]
 
         suite = fs.name(fs.parent('@0@'.format(sources[0])))
         # FIXME: Use str.replace() with meson >= 0.58.0
@@ -4116,7 +4278,7 @@ foreach test : tests
                 sources,
                 include_directories : [base.get('includes', []), test.get('includes', includes)],
                 link_with : [base.get('link_with', []), test.get('link_with', libshared)],
-                dependencies : [versiondep, base.get('dependencies', []), test.get('dependencies', [])],
+                dependencies : deps,
                 c_args : [test_cflags, test.get('c_args', [])],
                 build_by_default : want_tests != 'false',
                 install_rpath : rootpkglibdir,
@@ -4142,6 +4304,7 @@ exe = executable(
         test_libsystemd_sym_c,
         include_directories : includes,
         link_with : [libsystemd],
+        dependencies : userspace,
         build_by_default : want_tests != 'false',
         install : install_tests,
         install_dir : testsdir)
@@ -4154,8 +4317,12 @@ exe = executable(
         test_libsystemd_sym_c,
         include_directories : includes,
         link_with : [install_libsystemd_static],
-        dependencies : [threads], # threads is already included in dependencies on the library,
-                                  # but does not seem to get propagated. Add here as a work-around.
+        dependencies : [
+                # threads is already included in dependencies on the library,
+                # but does not seem to get propagated. Add here as a work-around.
+                threads,
+                userspace,
+        ],
         build_by_default : want_tests != 'false' and static_libsystemd_pic,
         install : install_tests and static_libsystemd_pic,
         install_dir : testsdir)
@@ -4169,6 +4336,7 @@ exe = executable(
         include_directories : libudev_includes,
         c_args : ['-Wno-deprecated-declarations'] + test_cflags,
         link_with : [libudev],
+        dependencies : userspace,
         build_by_default : want_tests != 'false',
         install : install_tests,
         install_dir : testsdir)
@@ -4182,6 +4350,7 @@ exe = executable(
         include_directories : libudev_includes,
         c_args : ['-Wno-deprecated-declarations'] + test_cflags,
         link_with : [install_libudev_static],
+        dependencies : userspace,
         build_by_default : want_tests != 'false' and static_libudev_pic,
         install : install_tests and static_libudev_pic,
         install_dir : testsdir)
@@ -4228,7 +4397,11 @@ foreach fuzzer : fuzzers
                         include_directories('src/fuzz'),
                 ],
                 link_with : [base.get('link_with', []), fuzzer.get('link_with', libshared)],
-                dependencies : [dependencies, versiondep],
+                dependencies : [
+                        dependencies,
+                        userspace,
+                        versiondep,
+                ],
                 c_args : [test_cflags, fuzzer.get('c_args', [])],
                 link_args: link_args,
                 install : false,
index b9da0544c20c29ee6f6d0a4508e4e0d9934f6d06..2a26a6e508ea94428c69d0f2a5556f6c818310ff 100644 (file)
@@ -262,10 +262,11 @@ libbasic = static_library(
         basic_sources,
         fundamental_sources,
         include_directories : basic_includes,
-        dependencies : [versiondep,
+        dependencies : [libcap,
+                        libm,
                         threads,
-                        libcap,
-                        libm],
+                        userspace,
+                        versiondep],
         c_args : ['-fvisibility=default'],
         build_by_default : false)
 
@@ -281,7 +282,8 @@ libbasic_gcrypt = static_library(
         'basic-gcrypt',
         basic_gcrypt_sources,
         include_directories : basic_includes,
-        dependencies : [libgcrypt],
+        dependencies : [libgcrypt,
+                        userspace],
         c_args : ['-fvisibility=default'],
         build_by_default : false)
 
@@ -297,8 +299,9 @@ libbasic_compress = static_library(
         'basic-compress',
         basic_compress_sources,
         include_directories : basic_includes,
-        dependencies : [libxz,
+        dependencies : [liblz4,
+                        libxz,
                         libzstd,
-                        liblz4],
+                        userspace],
         c_args : ['-fvisibility=default'],
         build_by_default : false)
index 15df4485cae9c6fd311ed0049eab70cf089dc466..e68c55917f8ae53f48a3f662f7c6d6e4cb3acd6d 100644 (file)
@@ -120,19 +120,20 @@ libcore = shared_library(
         link_args : ['-shared',
                      '-Wl,--version-script=' + libshared_sym_path],
         link_with : libshared,
-        dependencies : [versiondep,
-                        threads,
+        dependencies : [libacl,
+                        libapparmor,
+                        libaudit,
+                        libblkid,
                         libdl,
+                        libkmod,
+                        libmount,
+                        libpam,
                         librt,
                         libseccomp,
-                        libpam,
-                        libaudit,
-                        libkmod,
-                        libapparmor,
                         libselinux,
-                        libmount,
-                        libblkid,
-                        libacl],
+                        threads,
+                        userspace,
+                        versiondep],
         install : true,
         install_dir : rootpkglibdir)
 
index 9df3fea5d7a212ade368ef9b1619d8b67452842a..e7b7fbab119fb4843c0d7b69dabc4c5cc1ce4fb7 100644 (file)
@@ -7,6 +7,7 @@ lib_cryptsetup_token_common = static_library(
         'cryptsetup-token-common',
         'cryptsetup-token-util.c',
         include_directories : includes,
+        dependencies : userspace,
         link_with : libshared,
         build_by_default : false)
 
index 58b9719cc1bb43e56b9bc640a73dbe9df65791bc..ffebeebacd40da7a5dc8f456481a630d9c819676 100644 (file)
@@ -36,7 +36,8 @@ if conf.get('ENABLE_IMPORTD') == 1
                 include_directories : includes,
                 dependencies : [libbzip2,
                                 libxz,
-                                libz],
+                                libz,
+                                userspace],
                 build_by_default : false)
 
         install_data('org.freedesktop.import1.conf',
index 74f01b04764ebb7ecfbd02effc13dcaf3d2e93d1..9fe1b8049b58144b7df7aceefe1194bcc1bade5e 100644 (file)
@@ -22,11 +22,12 @@ libsystemd_journal_remote = static_library(
         libsystemd_journal_remote_sources,
         include_directories : journal_includes,
         link_with : libjournal_core,
-        dependencies : [threads,
+        dependencies : [libgnutls,
+                        liblz4,
                         libmicrohttpd,
-                        libgnutls,
                         libxz,
-                        liblz4],
+                        threads,
+                        userspace],
         build_by_default : false)
 
 systemd_journal_remote_sources = files('journal-remote-main.c')
index c9ff54c9917fdbb3e57350a0be85def8f9bd62bf..1490113f1cca49b5d686c4622ea9e29f15f3eb8f 100644 (file)
@@ -25,7 +25,8 @@ libjournal_core = static_library(
         'journal-core',
         sources,
         include_directories : includes,
-        dependencies: threads,
+        dependencies: [threads,
+                       userspace],
         build_by_default : false)
 
 journal_includes = [includes, include_directories('.')]
index 85d4afeb05826b2c96e884f9dad31c0805332095..ac4a15b47471c640fcf5d0b9977a01ceefbf7939 100644 (file)
@@ -32,6 +32,7 @@ libsystemd_network = static_library(
         'systemd-network',
         sources,
         include_directories : includes,
+        dependencies : userspace,
         build_by_default : false)
 
 libsystemd_network_includes = [includes, include_directories('.')]
index 23fa7c20cae02abfe9eb94af45de8bfa25b5fd4a..91887be8312338fb7e8312995364baabcbed8566 100644 (file)
@@ -122,7 +122,8 @@ libsystemd_static = static_library(
         link_with : [libbasic,
                      libbasic_compress],
         dependencies : [threads,
-                        librt],
+                        librt,
+                        userspace],
         build_by_default : false)
 
 libsystemd_sym = files('libsystemd.sym')
index 0e53b83e515a0dd27d2ab802073085063877324a..1c349cef6df4217d1b0e8ce023a59533b9f2ebfc 100644 (file)
@@ -25,6 +25,7 @@ libudev_basic = static_library(
         'udev-basic',
         libudev_sources,
         include_directories : includes,
+        dependencies : userspace,
         c_args : ['-fvisibility=default'],
         build_by_default : false)
 
index 198023715b607537d4696f410c526ee6d7c21e9f..473cf340893ba405e89d2f3c64ce696df879c67d 100644 (file)
@@ -35,7 +35,8 @@ liblogind_core = static_library(
         'logind-core',
         liblogind_core_sources,
         include_directories : includes,
-        dependencies : libacl,
+        dependencies : [libacl,
+                        userspace],
         build_by_default : false)
 
 loginctl_sources = files(
index 7b09d4b24f95f8ee0de4fbd5914802b1e0fc223b..d8b2dd188d0ea2035d13f7d42b884487cbf054b0 100644 (file)
@@ -18,7 +18,8 @@ libmachine_core = static_library(
         'machine-core',
         libmachine_core_sources,
         include_directories : includes,
-        dependencies : threads,
+        dependencies : [threads,
+                        userspace],
         build_by_default : false)
 
 if conf.get('ENABLE_MACHINED') == 1
index 91572ba132c0cd7df3f113285f039518dd6295ad..dab77a0d22b92a68a3f64af92bd0f9d7761fb68c 100644 (file)
@@ -146,6 +146,7 @@ libnetworkd_core = static_library(
         'networkd-core',
         sources,
         include_directories : network_includes,
+        dependencies : userspace,
         link_with : networkd_link_with,
         build_by_default : false)
 
index 43e3e188b2f919ae7e23f2f25125f5ad94e04f60..9f00e8825649c92b21144eaa4aaff7582b5d6182 100644 (file)
@@ -31,7 +31,8 @@ libnspawn_core = static_library(
         include_directories : includes,
         dependencies : [libacl,
                         libseccomp,
-                        libselinux],
+                        libselinux,
+                        userspace],
         build_by_default : false)
 
 systemd_nspawn_sources = files('nspawn.c')
index 8166118c74ff2f16863ac43d33efe4fc9c3734bf..052d54086f53d976ed2d02c8fafef4be667b0d77 100644 (file)
@@ -85,6 +85,7 @@ libsystemd_resolve_core = static_library(
         'systemd-resolve-core',
         basic_dns_sources,
         include_directories : includes,
+        dependencies : userspace,
         build_by_default : false)
 
 systemd_resolved_sources += custom_target(
index 82fd206d69280dcad571150516079f1242c31eab..5234b3f7c6f8841945c2aaf1bb4de9b4ffdae6f3 100644 (file)
@@ -296,7 +296,8 @@ libshared_static = static_library(
         libshared_name,
         shared_sources,
         include_directories : includes,
-        dependencies : libshared_deps,
+        dependencies : [libshared_deps,
+                        userspace],
         c_args : ['-fvisibility=default'],
         build_by_default : false)
 
@@ -310,7 +311,8 @@ libshared = shared_library(
                       libbasic,
                       libbasic_gcrypt,
                       libsystemd_static],
-        dependencies : libshared_deps,
+        dependencies : [libshared_deps,
+                        userspace],
         install : true,
         install_dir : rootpkglibdir)
 
@@ -323,7 +325,8 @@ if get_option('fdisk') != 'false'
                 'shared-fdisk',
                 shared_fdisk_sources,
                 include_directories : includes,
-                dependencies : [libfdisk],
+                dependencies : [libfdisk,
+                                userspace],
                 c_args : ['-fvisibility=default'],
                 build_by_default : false)
 endif
index f847728f62f75830dfcbfe978ce66f6e2c0b7690..54f5b18a3aa6145f20ab08ad8f88909418be7a4d 100644 (file)
@@ -29,6 +29,7 @@ libtimesyncd_core = static_library(
         'timesyncd-core',
         sources,
         include_directories : includes,
+        dependencies : userspace,
         link_with : timesyncd_link_with,
         build_by_default : false)
 
index 1cac581e7fe8bceb50377b0694ccb339367dfb08..af7dea0dce80630d3aa3b562f95b6e27d7a9bf4b 100644 (file)
@@ -108,7 +108,8 @@ libudevd_core = static_library(
         include_directories : udev_includes,
         link_with : udev_link_with,
         dependencies : [libblkid,
-                        libkmod],
+                        libkmod,
+                        userspace],
         build_by_default : false)
 
 udev_progs = [['ata_id/ata_id.c'],
@@ -134,7 +135,8 @@ foreach prog : udev_progs
                 name,
                 prog,
                 include_directories : includes,
-                dependencies : versiondep,
+                dependencies : [userspace,
+                                versiondep],
                 link_with : udev_link_with,
                 install_rpath : udev_rpath,
                 install : true,