meson: Extract objects instead of creating intermediate static libraries

Currently, when we want to add unit tests for code that is compiled into
an executable, we either compile the code at least twice (once for the
executable, and once for each test that uses it) or we create a static
library which is then used by both the executable and all the tests.

Both of these options are not ideal, compiling source files more than
once slows down the build for no reason and creating the intermediate
static libraries takes a lot of boilerplate.

Instead, let's use the extract_objects() method that meson exposes on
build targets. This allows us to extract the objects corresponding to
specific source files and use them in other executables. Because we
define all executables upfront into a dictionary, we integrate this into
the dictionary approach by adding two new fields:

- 'extract' takes a list of files for which objects should be extracted.
  The extracted objects are stored in a dict keyed by the executable name
  from which they were extracted.
- 'objects' takes the name of an executable from which the extracted
  objects should be added to the current executable.

One side effect of this approach is that we can't build test executables
anymore without building the main executable, so we stop building test
executables unless we're also building the main executable. This allows
us to switch to using subdir_done() in all of these subdirectories to skip
parsing them if the corresponding component is disabled.

These changes get me down from 2439 => 2403 ninja targets on a full rebuild
from scratch.
This commit is contained in:
Daan De Meyer
2025-05-07 22:55:15 +02:00
parent d8def5dc87
commit 6350d2dbd9
25 changed files with 442 additions and 577 deletions

View File

@@ -2004,6 +2004,7 @@ catalogs = []
modules = [] # nss, pam, and other plugins
executables = []
executables_by_name = {}
objects_by_name = {}
fuzzer_exes = []
generated_sources = [version_h, vmlinux_h_dependency]
@@ -2430,7 +2431,8 @@ foreach dict : executables
kwargs = {}
foreach key, val : dict
if key in ['name', 'dbus', 'public', 'conditions',
'type', 'suite', 'timeout', 'parallel']
'type', 'suite', 'timeout', 'parallel',
'objects', 'extract']
continue
endif
@@ -2441,6 +2443,17 @@ foreach dict : executables
kwargs += { key : [ kwargs.get(key, []), val ]}
endforeach
foreach val : dict.get('objects', [])
obj = objects_by_name[val]
kwargs += {
'objects' : obj['objects'],
'include_directories' : [
kwargs.get('include_directories', []),
obj['include_directories'],
],
}
endforeach
if is_test
kwargs += { 'install_dir' : kwargs.get('install_dir') / dict.get('type', '') }
foreach key, val : test_additional_kwargs
@@ -2461,6 +2474,15 @@ foreach dict : executables
executables_by_name += { name : exe }
if dict.has_key('extract')
objects_by_name += {
name : {
'objects' : exe.extract_objects(dict['extract']),
'include_directories' : fs.parent(dict['extract'][0]),
}
}
endif
if dict.get('build_by_default', true)
if dict.get('dbus', false)
dbus_programs += exe

View File

@@ -43,7 +43,7 @@ rules = [
conf.get('HAVE_DMI') == 1],
[files('70-power-switch.rules'),
enable_logind],
conf.get('ENABLE_LOGIND') == 1]
]
all_rules = []
@@ -65,9 +65,9 @@ rules_in = [
['64-btrfs.rules'],
['99-systemd.rules'],
['70-uaccess.rules', enable_logind and conf.get('HAVE_ACL') == 1],
['71-seat.rules', enable_logind],
['73-seat-late.rules', enable_logind],
['70-uaccess.rules', conf.get('ENABLE_LOGIND') == 1 and conf.get('HAVE_ACL') == 1],
['71-seat.rules', conf.get('ENABLE_LOGIND') == 1],
['73-seat-late.rules', conf.get('ENABLE_LOGIND') == 1],
['90-vconsole.rules', conf.get('ENABLE_VCONSOLE') == 1],
]

View File

@@ -34,15 +34,18 @@ systemd_analyze_sources = files(
'analyze-unit-files.c',
'analyze-unit-paths.c',
'analyze-verify.c',
'analyze-verify-util.c',
'analyze.c',
)
systemd_analyze_extract_sources = files(
'analyze-verify-util.c'
)
executables += [
executable_template + {
'name' : 'systemd-analyze',
'public' : conf.get('ENABLE_ANALYZE') == 1,
'sources' : systemd_analyze_sources,
'sources' : [systemd_analyze_sources, systemd_analyze_extract_sources],
'extract' : systemd_analyze_extract_sources,
'include_directories' : core_includes,
'link_with' : [
libcore,
@@ -52,9 +55,7 @@ executables += [
'install' : conf.get('ENABLE_ANALYZE') == 1,
},
core_test_template + {
'sources' : files(
'test-verify.c',
'analyze-verify-util.c',
),
'sources' : files('test-verify.c'),
'objects' : ['systemd-analyze'],
},
]

View File

@@ -1,20 +1,21 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
busctl_sources = files(
'busctl-introspect.c',
'busctl.c',
)
busctl_extract_sources = files(
'busctl-introspect.c',
)
executables += [
executable_template + {
'name' : 'busctl',
'public' : true,
'sources' : busctl_sources,
'sources' : [busctl_sources, busctl_extract_sources],
'extract' : busctl_extract_sources,
},
test_template + {
'sources' : files(
'test-busctl-introspect.c',
'busctl-introspect.c',
)
'sources' : files('test-busctl-introspect.c'),
'objects' : ['busctl'],
},
]

View File

@@ -1,7 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_COREDUMP') != 1
subdir_done()
endif
systemd_coredump_sources = files(
'coredump.c',
)
systemd_coredump_extract_sources = files(
'coredump-vacuum.c',
)
@@ -15,29 +21,26 @@ common_dependencies = [
executables += [
libexec_template + {
'name' : 'systemd-coredump',
'conditions' : ['ENABLE_COREDUMP'],
'sources' : systemd_coredump_sources,
'sources' : [systemd_coredump_sources, systemd_coredump_extract_sources],
'extract' : systemd_coredump_extract_sources,
'link_with' : [libshared],
'dependencies' : common_dependencies + [libacl],
},
executable_template + {
'name' : 'coredumpctl',
'public' : true,
'conditions' : ['ENABLE_COREDUMP'],
'sources' : files('coredumpctl.c'),
'link_with' : [libshared],
'dependencies' : common_dependencies,
},
test_template + {
'sources' : files(
'test-coredump-vacuum.c',
'coredump-vacuum.c',
),
'sources' : files('test-coredump-vacuum.c'),
'objects' : ['systemd-coredump'],
'type' : 'manual',
},
]
if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
if install_sysconfdir_samples
install_data('coredump.conf',
install_dir : pkgconfigfiledir)
endif

View File

@@ -4,29 +4,7 @@ if conf.get('ENABLE_HOMED') != 1
subdir_done()
endif
systemd_homework_sources = files(
'home-util.c',
'homework-blob.c',
'homework-cifs.c',
'homework-directory.c',
'homework-fscrypt.c',
'homework-luks.c',
'homework-mount.c',
'homework-password-cache.c',
'homework-quota.c',
'homework.c',
'user-record-util.c',
)
if conf.get('HAVE_P11KIT') == 1
systemd_homework_sources += files('homework-pkcs11.c')
endif
if conf.get('HAVE_LIBFIDO2') == 1
systemd_homework_sources += files('homework-fido2.c')
endif
systemd_homed_sources = files(
'home-util.c',
'homed-bus.c',
'homed-conf.c',
'homed-home-bus.c',
@@ -36,11 +14,33 @@ systemd_homed_sources = files(
'homed-operation.c',
'homed-varlink.c',
'homed.c',
'user-record-password-quality.c',
'user-record-sign.c',
)
systemd_homed_extract_sources = files(
'home-util.c',
'user-record-password-quality.c',
'user-record-util.c',
)
systemd_homework_sources = files(
'homework-blob.c',
'homework-cifs.c',
'homework-directory.c',
'homework-fscrypt.c',
'homework-luks.c',
'homework-mount.c',
'homework-password-cache.c',
'homework-quota.c',
'homework.c',
)
if conf.get('HAVE_P11KIT') == 1
systemd_homework_sources += files('homework-pkcs11.c')
endif
if conf.get('HAVE_LIBFIDO2') == 1
systemd_homework_sources += files('homework-fido2.c')
endif
homed_gperf_c = custom_target(
'homed_gperf.c',
input : 'homed-gperf.gperf',
@@ -51,13 +51,10 @@ generated_sources += [homed_gperf_c]
systemd_homed_sources += [homed_gperf_c]
homectl_sources = files(
'home-util.c',
'homectl-fido2.c',
'homectl-pkcs11.c',
'homectl-recovery-key.c',
'homectl.c',
'user-record-password-quality.c',
'user-record-util.c',
)
pam_systemd_home_sources = files(
@@ -67,9 +64,24 @@ pam_systemd_home_sources = files(
)
executables += [
libexec_template + {
'name' : 'systemd-homed',
'dbus' : true,
'sources' : [systemd_homed_sources, systemd_homed_extract_sources],
'include_directories' : includes +
include_directories('.'),
'extract' : systemd_homed_extract_sources,
'dependencies' : [
libcrypt,
libm,
libopenssl,
threads,
],
},
libexec_template + {
'name' : 'systemd-homework',
'sources' : systemd_homework_sources,
'objects' : ['systemd-homed'],
'link_with' : [
libshared,
libshared_fdisk
@@ -83,23 +95,11 @@ executables += [
threads,
],
},
libexec_template + {
'name' : 'systemd-homed',
'dbus' : true,
'sources' : systemd_homed_sources,
'include_directories' : includes +
include_directories('.'),
'dependencies' : [
libcrypt,
libm,
libopenssl,
threads,
],
},
executable_template + {
'name' : 'homectl',
'public' : true,
'sources' : homectl_sources,
'objects' : ['systemd-homed'],
'dependencies' : [
libcrypt,
libdl,

View File

@@ -7,6 +7,11 @@ endif
systemd_importd_sources = files(
'importd.c',
)
systemd_importd_extract_sources = files(
'import-common.c',
'import-compress.c',
'qcow2-util.c',
)
systemd_pull_sources = files(
'pull.c',
@@ -33,30 +38,6 @@ systemd_export_sources = files(
'export-raw.c',
)
importd_common_sources = files(
'import-common.c',
'import-compress.c',
'qcow2-util.c',
)
lib_import_common = static_library(
'import-common',
sources : importd_common_sources,
include_directories : includes,
dependencies : [
libbzip2,
libxz,
libz,
libzstd,
userspace,
],
build_by_default : false)
common_libs = [
lib_import_common,
libshared,
]
common_deps = [
libbzip2,
libcurl,
@@ -69,16 +50,15 @@ executables += [
libexec_template + {
'name' : 'systemd-importd',
'dbus' : true,
'conditions' : ['ENABLE_IMPORTD'],
'sources' : systemd_importd_sources,
'dependencies' : threads,
'sources' : [systemd_importd_sources, systemd_importd_extract_sources],
'extract' : systemd_importd_extract_sources,
'dependencies' : [common_deps, threads],
},
libexec_template + {
'name' : 'systemd-pull',
'public' : true,
'conditions' : ['ENABLE_IMPORTD'],
'sources' : systemd_pull_sources,
'link_with' : common_libs,
'objects' : ['systemd-importd'],
'dependencies' : common_deps + [
libopenssl,
],
@@ -86,43 +66,37 @@ executables += [
libexec_template + {
'name' : 'systemd-import',
'public' : true,
'conditions' : ['ENABLE_IMPORTD'],
'sources' : systemd_import_sources,
'link_with' : common_libs,
'objects' : ['systemd-importd'],
'dependencies' : common_deps,
},
libexec_template + {
'name' : 'systemd-import-fs',
'public' : true,
'conditions' : ['ENABLE_IMPORTD'],
'sources' : systemd_import_fs_sources,
'link_with' : common_libs,
'objects' : ['systemd-importd'],
'dependencies' : common_deps,
},
libexec_template + {
'name' : 'systemd-export',
'public' : true,
'conditions' : ['ENABLE_IMPORTD'],
'sources' : systemd_export_sources,
'link_with' : common_libs,
'objects' : ['systemd-importd'],
'dependencies' : common_deps,
},
executable_template + {
'name' : 'importctl',
'public' : true,
'conditions' : ['ENABLE_IMPORTD'],
'sources' : files('importctl.c'),
},
generator_template + {
'name' : 'systemd-import-generator',
'sources' : files('import-generator.c'),
'conditions' : ['ENABLE_IMPORTD'],
},
test_template + {
'sources' : files(
'test-qcow2.c',
'qcow2-util.c',
),
'dependencies' : libz,
'sources' : files('test-qcow2.c'),
'objects' : ['systemd-importd'],
'dependencies' : common_deps,
'conditions' : ['HAVE_ZLIB'],
'type' : 'manual',
},

View File

@@ -1,13 +1,20 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_REMOTE') != 1
subdir_done()
endif
systemd_journal_upload_sources = files(
'journal-compression-util.c',
'journal-header-util.c',
'journal-upload-journal.c',
'journal-upload.c',
)
systemd_journal_upload_extract_sources = files(
'journal-header-util.c',
)
libsystemd_journal_remote_sources = files(
systemd_journal_remote_sources = files('journal-remote-main.c')
systemd_journal_remote_extract_sources = files(
'journal-compression-util.c',
'journal-remote-parse.c',
'journal-remote-write.c',
@@ -15,25 +22,11 @@ libsystemd_journal_remote_sources = files(
)
if conf.get('HAVE_MICROHTTPD') == 1
libsystemd_journal_remote_sources += files(
systemd_journal_remote_extract_sources += files(
'microhttpd-util.c',
)
endif
libsystemd_journal_remote = static_library(
'systemd-journal-remote',
libsystemd_journal_remote_sources,
include_directories : includes,
dependencies : [libgnutls,
liblz4_cflags,
libmicrohttpd,
libxz_cflags,
threads,
userspace],
build_by_default : false)
systemd_journal_remote_sources = files('journal-remote-main.c')
systemd_journal_gatewayd_sources = files(
'journal-gatewayd.c',
'microhttpd-util.c',
@@ -51,57 +44,40 @@ executables += [
libexec_template + {
'name' : 'systemd-journal-upload',
'public' : true,
'conditions' : [
'ENABLE_REMOTE',
'HAVE_LIBCURL',
],
'sources' : systemd_journal_upload_sources,
'conditions' : ['HAVE_LIBCURL'],
'sources' : [systemd_journal_upload_sources, systemd_journal_upload_extract_sources],
'extract' : systemd_journal_upload_extract_sources,
'dependencies' : common_deps + [libcurl],
},
libexec_template + {
'name' : 'systemd-journal-remote',
'public' : true,
'conditions' : [
'ENABLE_REMOTE',
'HAVE_MICROHTTPD',
],
'sources' : systemd_journal_remote_sources,
'link_with' : [
libshared,
libsystemd_journal_remote,
],
'conditions' : ['HAVE_MICROHTTPD'],
'sources' : [systemd_journal_remote_sources, systemd_journal_remote_extract_sources],
'extract' : systemd_journal_remote_extract_sources,
'dependencies' : common_deps + [libmicrohttpd],
},
libexec_template + {
'name' : 'systemd-journal-gatewayd',
'public' : true,
'conditions' : [
'ENABLE_REMOTE',
'HAVE_MICROHTTPD',
],
'conditions' : ['HAVE_MICROHTTPD'],
'sources' : systemd_journal_gatewayd_sources,
'dependencies' : common_deps + [libmicrohttpd],
},
test_template + {
'sources' : files('test-journal-header-util.c'),
'objects' : ['systemd-journal-upload'],
},
fuzz_template + {
'sources' : files('fuzz-journal-remote.c'),
'link_with' : [
libshared,
libsystemd_journal_remote,
],
},
]
executables += [
test_template + {
'sources' : files('test-journal-header-util.c', 'journal-header-util.c'),
'objects' : ['systemd-journal-remote'],
'dependencies' : common_deps + [libmicrohttpd],
},
]
in_files = [
['journal-upload.conf',
conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1 and install_sysconfdir_samples],
['journal-remote.conf',
conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 and install_sysconfdir_samples]]
['journal-upload.conf', conf.get('HAVE_LIBCURL') == 1 and install_sysconfdir_samples],
['journal-remote.conf', conf.get('HAVE_MICROHTTPD') == 1 and install_sysconfdir_samples]]
foreach tuple : in_files
file = tuple[0]
@@ -114,7 +90,7 @@ foreach tuple : in_files
install_dir : pkgconfigfiledir)
endforeach
if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
if conf.get('HAVE_MICROHTTPD') == 1
install_data('browse.html',
install_dir : pkgdatadir / 'gatewayd')

View File

@@ -1,6 +1,9 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
sources = files(
systemd_journald_sources = files(
'journald.c',
)
systemd_journald_extract_sources = files(
'journald-audit.c',
'journald-client.c',
'journald-console.c',
@@ -14,6 +17,9 @@ sources = files(
'journald-syslog.c',
'journald-varlink.c',
'journald-wall.c',
# Build fuzz-journald.c as part of systemd-journald so we only compile it once instead of once per
# fuzz test.
'fuzz-journald.c',
)
journald_gperf_c = custom_target(
@@ -23,15 +29,7 @@ journald_gperf_c = custom_target(
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
generated_sources += journald_gperf_c
sources += journald_gperf_c
libjournal_core = static_library(
'journal-core',
sources,
include_directories : includes,
dependencies: [threads,
userspace],
build_by_default : false)
systemd_journald_extract_sources += journald_gperf_c
journalctl_sources = files(
'journalctl.c',
@@ -54,28 +52,20 @@ else
endif
journal_test_template = test_template + {
'link_with' : [
libjournal_core,
libshared,
],
'objects' : ['systemd-journald'],
}
journal_fuzz_template = fuzz_template + {
'link_with' : [
libjournal_core,
libshared,
],
'objects' : ['systemd-journald'],
'dependencies' : libselinux,
}
executables += [
libexec_template + {
'name' : 'systemd-journald',
'sources' : files('journald.c'),
'link_with' : [
libjournal_core,
libshared,
],
'sources' : [systemd_journald_sources, systemd_journald_extract_sources],
'include_directories' : [libexec_template['include_directories'], include_directories('.')],
'extract' : systemd_journald_extract_sources,
'dependencies' : [
liblz4_cflags,
libselinux,
@@ -89,18 +79,14 @@ executables += [
'public' : true,
'conditions' : ['HAVE_QRENCODE'],
'sources' : files('bsod.c'),
'link_with' : libshared,
'dependencies' : libqrencode,
},
executable_template + {
'name' : 'systemd-cat',
'public' : true,
'sources' : files('cat.c'),
'link_with' : [
libjournal_core,
libshared,
],
'dependencies' : threads,
'objects' : ['systemd-journald'],
'dependencies' : [libselinux, threads],
},
executable_template + {
'name' : 'journalctl',
@@ -123,11 +109,13 @@ executables += [
libxz_cflags,
],
},
test_template + {
'sources' : files(
'test-journald-rate-limit.c',
'journald-rate-limit.c',
),
journal_test_template + {
'sources' : files('test-journald-rate-limit.c'),
'dependencies' : [
liblz4_cflags,
libselinux,
libxz_cflags,
],
},
journal_test_template + {
'sources' : files('test-journald-syslog.c'),
@@ -145,40 +133,22 @@ executables += [
],
},
journal_fuzz_template + {
'sources' : files(
'fuzz-journald-audit.c',
'fuzz-journald.c',
),
'sources' : files('fuzz-journald-audit.c'),
},
journal_fuzz_template + {
'sources' : files(
'fuzz-journald-kmsg.c',
'fuzz-journald.c',
),
'sources' : files('fuzz-journald-kmsg.c'),
},
journal_fuzz_template + {
'sources' : files(
'fuzz-journald-native.c',
'fuzz-journald.c',
),
'sources' : files('fuzz-journald-native.c'),
},
journal_fuzz_template + {
'sources' : files(
'fuzz-journald-native-fd.c',
'fuzz-journald.c',
),
'sources' : files('fuzz-journald-native-fd.c'),
},
journal_fuzz_template + {
'sources' : files(
'fuzz-journald-stream.c',
'fuzz-journald.c',
),
'sources' : files('fuzz-journald-stream.c'),
},
journal_fuzz_template + {
'sources' : files(
'fuzz-journald-syslog.c',
'fuzz-journald.c',
),
'sources' : files('fuzz-journald-syslog.c'),
},
]

View File

@@ -1,8 +1,14 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_LOCALED') != 1
subdir_done()
endif
systemd_localed_sources = files(
'localed.c'
)
systemd_localed_extract_sources = files(
'localed-util.c',
'localed.c',
'xkbcommon-util.c',
)
@@ -23,22 +29,18 @@ executables += [
libexec_template + {
'name' : 'systemd-localed',
'dbus' : true,
'conditions' : ['ENABLE_LOCALED'],
'sources' : systemd_localed_sources,
'sources' : [systemd_localed_sources, systemd_localed_extract_sources],
'extract' : systemd_localed_extract_sources,
'dependencies' : libxkbcommon_deps,
},
executable_template + {
'name' : 'localectl',
'public' : true,
'conditions' : ['ENABLE_LOCALED'],
'sources' : files('localectl.c'),
},
test_template + {
'sources' : files(
'test-localed-util.c',
'localed-util.c',
'xkbcommon-util.c',
),
'sources' : files('test-localed-util.c'),
'objects' : ['systemd-localed'],
'dependencies' : libxkbcommon_deps,
},
]
@@ -49,14 +51,12 @@ executables += [
kbd_model_map = meson.current_source_dir() / 'kbd-model-map'
language_fallback_map = meson.current_source_dir() / 'language-fallback-map'
if conf.get('ENABLE_LOCALED') == 1
install_data('org.freedesktop.locale1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.locale1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.locale1.policy',
install_dir : polkitpolicydir)
install_data('kbd-model-map',
'language-fallback-map',
install_dir : pkgdatadir)
endif
install_data('org.freedesktop.locale1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.locale1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.locale1.policy',
install_dir : polkitpolicydir)
install_data('kbd-model-map',
'language-fallback-map',
install_dir : pkgdatadir)

View File

@@ -1,18 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_LOGIND') != 1
subdir_done()
endif
systemd_logind_sources = files(
'logind.c',
)
logind_gperf_c = custom_target(
'logind_gperf.c',
input : 'logind-gperf.gperf',
output : 'logind-gperf.c',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
generated_sources += logind_gperf_c
liblogind_core_sources = files(
systemd_logind_extract_sources = files(
'logind-action.c',
'logind-brightness.c',
'logind-button.c',
@@ -33,15 +28,14 @@ liblogind_core_sources = files(
'logind-wall.c',
)
liblogind_core_sources += [logind_gperf_c]
logind_gperf_c = custom_target(
'logind_gperf.c',
input : 'logind-gperf.gperf',
output : 'logind-gperf.c',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
liblogind_core = static_library(
'logind-core',
liblogind_core_sources,
include_directories : includes,
dependencies : [libacl,
userspace],
build_by_default : false)
generated_sources += logind_gperf_c
systemd_logind_extract_sources += [logind_gperf_c]
loginctl_sources = files(
'loginctl.c',
@@ -52,12 +46,9 @@ executables += [
libexec_template + {
'name' : 'systemd-logind',
'dbus' : true,
'conditions' : ['ENABLE_LOGIND'],
'sources' : systemd_logind_sources,
'link_with' : [
liblogind_core,
libshared,
],
'sources' : [systemd_logind_sources, systemd_logind_extract_sources],
'include_directories' : [libexec_template['include_directories'], include_directories('.')],
'extract' : systemd_logind_extract_sources,
'dependencies' : [
libacl,
threads,
@@ -66,7 +57,6 @@ executables += [
executable_template + {
'name' : 'loginctl',
'public' : true,
'conditions' : ['ENABLE_LOGIND'],
'sources' : loginctl_sources,
'dependencies' : [
liblz4_cflags,
@@ -78,12 +68,10 @@ executables += [
executable_template + {
'name' : 'systemd-inhibit',
'public' : true,
'conditions' : ['ENABLE_LOGIND'],
'sources' : files('inhibit.c'),
},
libexec_template + {
'name' : 'systemd-user-runtime-dir',
'conditions' : ['ENABLE_LOGIND'],
'sources' : files('user-runtime-dir.c'),
},
test_template + {
@@ -92,10 +80,7 @@ executables += [
},
test_template + {
'sources' : files('test-login-tables.c'),
'link_with' : [
liblogind_core,
libshared,
],
'objects' : ['systemd-logind'],
'dependencies' : threads,
},
test_template + {
@@ -111,31 +96,24 @@ simple_tests += files(
modules += [
pam_template + {
'name' : 'pam_systemd',
'conditions' : [
'ENABLE_LOGIND',
'HAVE_PAM',
],
'conditions' : ['HAVE_PAM'],
'sources' : files('pam_systemd.c'),
'version-script' : meson.current_source_dir() / 'pam_systemd.sym',
},
pam_template + {
'name' : 'pam_systemd_loadkey',
'conditions' : [
'HAVE_PAM',
],
'conditions' : ['HAVE_PAM'],
'sources' : files('pam_systemd_loadkey.c'),
'version-script' : meson.current_source_dir() / 'pam_systemd_loadkey.sym',
},
]
enable_logind = conf.get('ENABLE_LOGIND') == 1
custom_target(
'logind.conf',
input : 'logind.conf.in',
output : 'logind.conf',
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : enable_logind and install_sysconfdir_samples and pkgsysconfdir != 'no',
install : install_sysconfdir_samples and pkgsysconfdir != 'no',
install_dir : pkgconfigfiledir)
custom_target(
@@ -143,16 +121,14 @@ custom_target(
input : 'systemd-user.in',
output : 'systemd-user',
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : enable_logind and pamconfdir != 'no',
install : pamconfdir != 'no',
install_dir : pamconfdir)
if enable_logind
install_data('org.freedesktop.login1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.login1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.login1.policy',
install_dir : polkitpolicydir)
install_data('10-systemd-logind-root-ignore-inhibitors.rules.example',
install_dir : polkitrulesdir)
endif
install_data('org.freedesktop.login1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.login1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.login1.policy',
install_dir : polkitpolicydir)
install_data('10-systemd-logind-root-ignore-inhibitors.rules.example',
install_dir : polkitrulesdir)

View File

@@ -1,6 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
libmachine_core_sources = files(
if conf.get('ENABLE_MACHINED') != 1
subdir_done()
endif
systemd_machined_sources = files(
'machined.c'
)
systemd_machined_extract_sources = files(
'image.c',
'image-dbus.c',
'image-varlink.c',
@@ -13,29 +20,16 @@ libmachine_core_sources = files(
'operation.c',
)
libmachine_core = static_library(
'machine-core',
libmachine_core_sources,
include_directories : includes,
dependencies : [threads,
userspace],
build_by_default : false)
executables += [
libexec_template + {
'name' : 'systemd-machined',
'dbus' : true,
'conditions' : ['ENABLE_MACHINED'],
'sources' : files('machined.c'),
'link_with' : [
libmachine_core,
libshared,
],
'sources' : [systemd_machined_sources, systemd_machined_extract_sources],
'extract' : systemd_machined_extract_sources,
},
executable_template + {
'name' : 'machinectl',
'public' : true,
'conditions' : ['ENABLE_MACHINED'],
'sources' : files('machinectl.c'),
'dependencies' : [
liblz4_cflags,
@@ -46,19 +40,14 @@ executables += [
},
test_template + {
'sources' : files('test-machine-tables.c'),
'link_with': [
libmachine_core,
libshared
],
'objects' : ['systemd-machined'],
'dependencies': threads,
},
]
if conf.get('ENABLE_MACHINED') == 1
install_data('org.freedesktop.machine1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.machine1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.machine1.policy',
install_dir : polkitpolicydir)
endif
install_data('org.freedesktop.machine1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.machine1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.machine1.policy',
install_dir : polkitpolicydir)

View File

@@ -2,7 +2,10 @@
subdir('bpf/sysctl_monitor')
sources = files(
systemd_networkd_sources = files(
'networkd.c'
)
systemd_networkd_extract_sources = files(
'netdev/bareudp.c',
'netdev/batadv.c',
'netdev/bond.c',
@@ -111,8 +114,6 @@ sources = files(
'tc/teql.c',
)
systemd_networkd_sources = files('networkd.c')
systemd_networkd_wait_online_sources = files(
'wait-online/dns-configuration.c',
'wait-online/link.c',
@@ -136,16 +137,11 @@ networkctl_sources = files(
'networkctl-util.c',
)
network_generator_sources = files(
'generator/main.c',
'generator/network-generator.c',
)
networkd_network_gperf_gperf = files('networkd-network-gperf.gperf')
networkd_netdev_gperf_gperf = files('netdev/netdev-gperf.gperf')
if conf.get('HAVE_VMLINUX_H') == 1
sources += sysctl_monitor_skel_h
systemd_networkd_extract_sources += sysctl_monitor_skel_h
endif
networkd_gperf_c = custom_target(
@@ -167,7 +163,7 @@ netdev_gperf_c = custom_target(
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
generated_sources += [networkd_gperf_c, networkd_network_gperf_c, netdev_gperf_c]
sources += [networkd_gperf_c, networkd_network_gperf_c, netdev_gperf_c]
systemd_networkd_extract_sources += [networkd_gperf_c, networkd_network_gperf_c, netdev_gperf_c]
if get_option('link-networkd-shared')
networkd_link_with = [libshared]
@@ -178,27 +174,23 @@ endif
network_includes = [libsystemd_network_includes, include_directories(['.', 'netdev', 'tc'])]
libnetworkd_core = static_library(
'networkd-core',
sources,
include_directories : network_includes,
dependencies : userspace,
link_with : networkd_link_with,
build_by_default : false)
network_test_template = test_template + {
'conditions' : ['ENABLE_NETWORKD'],
'link_with' : [
libnetworkd_core,
networkd_link_with,
libsystemd_network,
],
'objects' : ['systemd-networkd'],
'include_directories' : network_includes,
}
network_fuzz_template = fuzz_template + {
'conditions' : ['ENABLE_NETWORKD'],
'link_with' : [
libnetworkd_core,
networkd_link_with,
libsystemd_network,
],
'objects' : ['systemd-networkd'],
'dependencies' : threads,
'include_directories' : network_includes,
}
@@ -208,10 +200,10 @@ executables += [
'name' : 'systemd-networkd',
'dbus' : true,
'conditions' : ['ENABLE_NETWORKD'],
'sources' : systemd_networkd_sources,
'sources' : [systemd_networkd_sources, systemd_networkd_extract_sources],
'extract' : systemd_networkd_extract_sources,
'include_directories' : network_includes,
'link_with' : [
libnetworkd_core,
libsystemd_network,
networkd_link_with,
],
@@ -237,14 +229,13 @@ executables += [
},
libexec_template + {
'name' : 'systemd-network-generator',
'sources' : network_generator_sources,
'sources' : files('generator/network-generator.c', 'generator/main.c'),
'extract' : files('generator/network-generator.c'),
'link_with' : networkd_link_with,
},
test_template + {
'sources' : files(
'generator/test-network-generator.c',
'generator/network-generator.c',
),
'sources' : files('generator/test-network-generator.c'),
'objects' : ['systemd-network-generator'],
'suite' : 'network',
},
network_test_template + {

View File

@@ -1,17 +1,25 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
libnspawn_core_sources = files(
if conf.get('ENABLE_NSPAWN') != 1
subdir_done()
endif
nspawn_sources = files(
'nspawn.c',
'nspawn-bind-user.c',
'nspawn-cgroup.c',
'nspawn-network.c',
'nspawn-register.c',
'nspawn-seccomp.c',
'nspawn-setuid.c',
'nspawn-stub-pid1.c',
)
nspawn_extract_sources = files(
'nspawn-expose-ports.c',
'nspawn-mount.c',
'nspawn-network.c',
'nspawn-oci.c',
'nspawn-register.c',
'nspawn-seccomp.c',
'nspawn-settings.c',
'nspawn-setuid.c',
'nspawn-stub-pid1.c',
)
nspawn_gperf_c = custom_target(
@@ -21,26 +29,11 @@ nspawn_gperf_c = custom_target(
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
generated_sources += nspawn_gperf_c
libnspawn_core_sources += nspawn_gperf_c
libnspawn_core = static_library(
'nspawn-core',
libnspawn_core_sources,
include_directories : includes,
dependencies : [libacl,
libseccomp,
libselinux,
userspace],
build_by_default : false)
nspawn_libs = [
libnspawn_core,
libshared,
]
nspawn_extract_sources += nspawn_gperf_c
nspawn_common_template = {
'link_with' : nspawn_libs,
'dependencies' : libseccomp,
'objects' : ['systemd-nspawn'],
}
nspawn_test_template = test_template + nspawn_common_template
nspawn_fuzz_template = fuzz_template + nspawn_common_template
@@ -49,12 +42,16 @@ executables += [
executable_template + {
'name' : 'systemd-nspawn',
'public' : true,
'conditions' : ['ENABLE_NSPAWN'],
'sources' : files('nspawn.c'),
'link_with' : nspawn_libs,
'sources' : [nspawn_sources, nspawn_extract_sources],
'include_directories' : [
executable_template['include_directories'],
include_directories('.')
],
'extract' : nspawn_extract_sources,
'dependencies' : [
libblkid,
libseccomp,
libselinux,
],
},
nspawn_test_template + {

View File

@@ -6,46 +6,45 @@ endif
subdir('bpf/userns_restrict')
systemd_nsresourcework_sources = files(
'nsresourcework.c',
'userns-restrict.c',
'userns-registry.c',
)
systemd_nsresourced_sources = files(
'nsresourced-manager.c',
'nsresourced.c',
)
systemd_nsresourced_extract_sources = files(
'userns-restrict.c',
'userns-registry.c',
)
userns_restrict_include = include_directories('.')
systemd_nsresourcework_sources = files(
'nsresourcework.c'
)
test_userns_restrict_sources = files(
'test-userns-restrict.c'
)
if conf.get('HAVE_VMLINUX_H') == 1
systemd_nsresourcework_sources += userns_restrict_skel_h
systemd_nsresourced_sources += userns_restrict_skel_h
executables += [
test_template + {
'sources' : files('test-userns-restrict.c', 'userns-restrict.c') + userns_restrict_skel_h,
'conditions' : ['HAVE_VMLINUX_H'],
'include_directories' : [ includes, userns_restrict_include ],
},
]
systemd_nsresourcework_sources += userns_restrict_skel_h
test_userns_restrict_sources += userns_restrict_skel_h
endif
executables += [
libexec_template + {
'name' : 'systemd-nsresourced',
'sources' : [systemd_nsresourced_sources, systemd_nsresourced_extract_sources],
'include_directories' : [libexec_template['include_directories'], include_directories('.')],
'extract' : systemd_nsresourced_extract_sources,
'dependencies' : threads,
},
libexec_template + {
'name' : 'systemd-nsresourcework',
'sources' : systemd_nsresourcework_sources,
'dependencies' : threads,
'include_directories' : [ includes, userns_restrict_include ],
'objects' : ['systemd-nsresourced'],
},
libexec_template + {
'name' : 'systemd-nsresourced',
'sources' : systemd_nsresourced_sources,
'dependencies' : threads,
'include_directories' : [ includes, userns_restrict_include ],
test_template + {
'sources' : test_userns_restrict_sources,
'conditions' : ['HAVE_VMLINUX_H'],
'objects' : ['systemd-nsresourced'],
},
]

View File

@@ -1,10 +1,16 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_OOMD') != 1
subdir_done()
endif
systemd_oomd_sources = files(
'oomd.c',
'oomd-conf.c',
'oomd-manager.c',
'oomd-manager-bus.c',
)
systemd_oomd_extract_sources = files(
'oomd-util.c',
)
@@ -12,34 +18,29 @@ executables += [
libexec_template + {
'name' : 'systemd-oomd',
'dbus' : true,
'conditions' : ['ENABLE_OOMD'],
'sources' : systemd_oomd_sources,
'sources' : [systemd_oomd_sources, systemd_oomd_extract_sources],
'extract' : systemd_oomd_extract_sources,
'dependencies' : libatomic,
},
executable_template + {
'name' : 'oomctl',
'public' : true,
'conditions' : ['ENABLE_OOMD'],
'sources' : files('oomctl.c'),
},
test_template + {
'sources' : files(
'test-oomd-util.c',
'oomd-util.c',
),
'sources' : files('test-oomd-util.c'),
'objects' : ['systemd-oomd'],
'dependencies' : libatomic,
},
]
if conf.get('ENABLE_OOMD') == 1
install_data('org.freedesktop.oom1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.oom1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.oom1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.oom1.service',
install_dir : dbussystemservicedir)
if install_sysconfdir_samples
install_data('oomd.conf',
install_dir : pkgconfigfiledir)
endif
if install_sysconfdir_samples
install_data('oomd.conf',
install_dir : pkgconfigfiledir)
endif

View File

@@ -1,6 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_RESOLVE') != 1
subdir_done()
endif
systemd_resolved_sources = files(
'resolved.c',
)
systemd_resolved_extract_sources = files(
'dns-type.c',
'resolved-bus.c',
'resolved-conf.c',
@@ -84,26 +91,15 @@ resolved_dnssd_gperf_c = custom_target(
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
generated_sources += [dns_type_from_name_h, dns_type_to_name_h, resolved_gperf_c, resolved_dnssd_gperf_c]
systemd_resolved_sources += [dns_type_from_name_h, dns_type_to_name_h, resolved_gperf_c, resolved_dnssd_gperf_c]
systemd_resolved_extract_sources += [dns_type_from_name_h, dns_type_to_name_h, resolved_gperf_c, resolved_dnssd_gperf_c]
if conf.get('ENABLE_DNS_OVER_TLS') == 1
systemd_resolved_sources += files(
systemd_resolved_extract_sources += files(
'resolved-dnstls.c',
)
endif
resolved_core = static_library(
'systemd-resolved-core',
systemd_resolved_sources,
include_directories : includes,
dependencies : userspace,
build_by_default : false)
resolve_common_template = {
'link_with' : [
libshared,
resolved_core,
],
'dependencies' : [
libopenssl,
libm,
@@ -111,20 +107,20 @@ resolve_common_template = {
],
}
resolve_test_template = test_template + resolve_common_template
resolve_fuzz_template = fuzz_template + resolve_common_template
resolve_test_template = test_template + resolve_common_template + {'objects' : ['systemd-resolved']}
resolve_fuzz_template = fuzz_template + resolve_common_template + {'objects' : ['systemd-resolved']}
executables += [
libexec_template + resolve_common_template + {
'name' : 'systemd-resolved',
'dbus' : true,
'conditions' : ['ENABLE_RESOLVE'],
'sources' : files('resolved.c'),
'sources' : [systemd_resolved_sources, systemd_resolved_extract_sources],
'include_directories' : [libexec_template['include_directories'], include_directories('.')],
'extract' : systemd_resolved_extract_sources,
},
executable_template + resolve_common_template + {
'name' : 'resolvectl',
'public' : true,
'conditions' : ['ENABLE_RESOLVE'],
'sources' : files(
'resolvconf-compat.c',
'resolvectl.c',
@@ -132,6 +128,7 @@ executables += [
'dependencies' : resolve_common_template['dependencies'] + [
libidn,
],
'objects' : ['systemd-resolved'],
},
resolve_test_template + {
'sources' : files('test-resolve-tables.c'),
@@ -140,10 +137,7 @@ executables += [
'sources' : files('test-dns-answer.c'),
},
resolve_test_template + {
'sources' : files(
'test-dns-cache.c',
'resolved-dns-cache.c'
),
'sources' : files('test-dns-cache.c'),
},
resolve_test_template + {
'sources' : files('test-dns-packet.c'),
@@ -161,10 +155,7 @@ executables += [
'sources' : files('test-dns-question.c'),
},
resolve_test_template + {
'sources' : files(
'test-resolved-etc-hosts.c',
'resolved-etc-hosts.c',
),
'sources' : files('test-resolved-etc-hosts.c'),
},
resolve_test_template + {
'sources' : files('test-resolved-packet.c'),
@@ -203,40 +194,35 @@ executables += [
'sources' : files('fuzz-dns-packet.c'),
},
resolve_fuzz_template + {
'sources' : files(
'fuzz-etc-hosts.c',
'resolved-etc-hosts.c',
),
'sources' : files('fuzz-etc-hosts.c'),
},
resolve_fuzz_template + {
'sources' : files('fuzz-resource-record.c'),
},
]
if conf.get('ENABLE_RESOLVE') == 1
install_data('org.freedesktop.resolve1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.resolve1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.resolve1.policy',
install_dir : polkitpolicydir)
install_data('resolv.conf',
install_dir : libexecdir)
install_data('org.freedesktop.resolve1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.resolve1.service',
install_dir : dbussystemservicedir)
install_data('org.freedesktop.resolve1.policy',
install_dir : polkitpolicydir)
install_data('resolv.conf',
install_dir : libexecdir)
install_symlink('resolvconf',
pointing_to : sbin_to_bin + 'resolvectl',
install_dir : sbindir)
install_symlink('resolvconf',
pointing_to : sbin_to_bin + 'resolvectl',
install_dir : sbindir)
# symlink for backwards compatibility after rename
install_symlink('systemd-resolve',
pointing_to : 'resolvectl',
install_dir : bindir)
endif
# symlink for backwards compatibility after rename
install_symlink('systemd-resolve',
pointing_to : 'resolvectl',
install_dir : bindir)
custom_target(
'resolved.conf',
input : 'resolved.conf.in',
output : 'resolved.conf',
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : conf.get('ENABLE_RESOLVE') == 1 and install_sysconfdir_samples,
install : install_sysconfdir_samples,
install_dir : pkgconfigfiledir)

View File

@@ -4,20 +4,23 @@ systemd_shutdown_sources = files(
'detach-dm.c',
'detach-loopback.c',
'detach-md.c',
'detach-swap.c',
'shutdown.c',
)
systemd_shutdown_extract_sources = files(
'detach-swap.c',
'umount.c',
)
executables += [
libexec_template + {
'name' : 'systemd-shutdown',
'sources' : systemd_shutdown_sources,
'sources' : [systemd_shutdown_sources, systemd_shutdown_extract_sources],
'extract' : systemd_shutdown_extract_sources,
'dependencies' : libmount,
},
libexec_template + {
'name' : 'systemd-shutdown.standalone',
'sources' : systemd_shutdown_sources,
'sources' : [systemd_shutdown_sources, systemd_shutdown_extract_sources],
'c_args' : '-DSTANDALONE',
'link_with' : [
libbasic_static,
@@ -29,11 +32,8 @@ executables += [
'install' : have_standalone_binaries,
},
test_template + {
'sources' : files(
'test-umount.c',
'detach-swap.c',
'umount.c',
),
'sources' : files('test-umount.c'),
'objects' : ['systemd-shutdown'],
'dependencies' : libmount,
},
]

View File

@@ -1,18 +1,22 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
sleep_sources = files(
'sleep.c',
)
sleep_extract_sources = files(
'battery-capacity.c',
)
executables += [
libexec_template + {
'name' : 'systemd-sleep',
'sources' : files(
'sleep.c',
'battery-capacity.c',
),
'sources' : [sleep_sources, sleep_extract_sources],
'include_directories' : [libexec_template['include_directories'], include_directories('.')],
'extract' : sleep_extract_sources,
},
test_template + {
'sources' : files(
'test-battery-capacity.c',
'battery-capacity.c',
),
'sources' : files('test-battery-capacity.c'),
'objects' : ['systemd-sleep'],
},
]

View File

@@ -1,16 +1,19 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
sources = files(
if conf.get('ENABLE_TIMESYNCD') != 1
subdir_done()
endif
timesyncd_sources = files(
'timesyncd.c',
'timesyncd-bus.c',
)
timesyncd_extract_sources = files(
'timesyncd-conf.c',
'timesyncd-manager.c',
'timesyncd-server.c',
)
systemd_timesyncd_sources = files(
'timesyncd.c',
'timesyncd-bus.c',
)
timesyncd_gperf_c = custom_target(
'timesyncd-gperf.c',
input : 'timesyncd-gperf.gperf',
@@ -18,7 +21,7 @@ timesyncd_gperf_c = custom_target(
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
generated_sources += timesyncd_gperf_c
sources += timesyncd_gperf_c
timesyncd_extract_sources += timesyncd_gperf_c
if get_option('link-timesyncd-shared')
timesyncd_link_with = [libshared]
@@ -27,20 +30,13 @@ else
libshared_static]
endif
libtimesyncd_core = static_library(
'timesyncd-core',
sources,
include_directories : includes,
dependencies : userspace,
link_with : timesyncd_link_with,
build_by_default : false)
executables += [
libexec_template + {
'name' : 'systemd-timesyncd',
'conditions' : ['ENABLE_TIMESYNCD'],
'sources' : systemd_timesyncd_sources,
'link_with' : libtimesyncd_core,
'sources' : [timesyncd_sources, timesyncd_extract_sources],
'include_directories' : [libexec_template['include_directories'], include_directories('.')],
'extract' : timesyncd_extract_sources,
'link_with' : timesyncd_link_with,
'dependencies' : [
libm,
threads,
@@ -48,16 +44,13 @@ executables += [
},
libexec_template + {
'name' : 'systemd-time-wait-sync',
'conditions' : ['ENABLE_TIMESYNCD'],
'sources' : files('wait-sync.c'),
'link_with' : libtimesyncd_core,
'objects' : ['systemd-timesyncd'],
'dependencies' : libm,
},
test_template + {
'sources' : files('test-timesync.c'),
'link_with' : [
libshared,
libtimesyncd_core,
],
'objects' : ['systemd-timesyncd'],
'dependencies' : libm,
},
]
@@ -70,13 +63,11 @@ custom_target(
install : conf.get('ENABLE_TIMESYNCD') == 1 and install_sysconfdir_samples,
install_dir : pkgconfigfiledir)
if conf.get('ENABLE_TIMESYNCD') == 1
install_data('org.freedesktop.timesync1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.timesync1.service',
install_dir : dbussystemservicedir)
install_data('80-systemd-timesync.list',
install_dir : ntpservicelistdir)
install_data('org.freedesktop.timesync1.policy',
install_dir : polkitpolicydir)
endif
install_data('org.freedesktop.timesync1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.timesync1.service',
install_dir : dbussystemservicedir)
install_data('80-systemd-timesync.list',
install_dir : ntpservicelistdir)
install_data('org.freedesktop.timesync1.policy',
install_dir : polkitpolicydir)

View File

@@ -1,7 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_TMPFILES') != 1
subdir_done()
endif
systemd_tmpfiles_sources = files(
'tmpfiles.c',
)
systemd_tmpfiles_extract_sources = files(
'offline-passwd.c',
)
@@ -9,15 +15,14 @@ executables += [
executable_template + {
'name' : 'systemd-tmpfiles',
'public' : true,
'conditions' : ['ENABLE_TMPFILES'],
'sources' : systemd_tmpfiles_sources,
'sources' : [systemd_tmpfiles_sources, systemd_tmpfiles_extract_sources],
'extract' : systemd_tmpfiles_extract_sources,
'dependencies' : libacl,
},
executable_template + {
'name' : 'systemd-tmpfiles.standalone',
'public' : have_standalone_binaries,
'conditions' : ['ENABLE_TMPFILES'],
'sources' : systemd_tmpfiles_sources,
'sources' : [systemd_tmpfiles_sources, systemd_tmpfiles_extract_sources],
'c_args' : '-DSTANDALONE',
'link_with' : [
libbasic_static,
@@ -29,9 +34,7 @@ executables += [
'install' : have_standalone_binaries,
},
test_template + {
'sources' : files(
'test-offline-passwd.c',
'offline-passwd.c',
),
'sources' : files('test-offline-passwd.c'),
'objects' : ['systemd-tmpfiles'],
},
]

View File

@@ -17,8 +17,7 @@ udevadm_sources = files(
'udevadm.c',
'udevd.c',
)
libudevd_core_sources = files(
udevadm_extract_sources = files(
'net/link-config.c',
'udev-builtin.c',
'udev-builtin-btrfs.c',
@@ -49,15 +48,15 @@ libudevd_core_sources = files(
)
if conf.get('HAVE_KMOD') == 1
libudevd_core_sources += files('udev-builtin-kmod.c')
udevadm_extract_sources += files('udev-builtin-kmod.c')
endif
if conf.get('HAVE_BLKID') == 1
libudevd_core_sources += files('udev-builtin-blkid.c')
udevadm_extract_sources += files('udev-builtin-blkid.c')
endif
if conf.get('HAVE_ACL') == 1
libudevd_core_sources += files('udev-builtin-uaccess.c')
udevadm_extract_sources += files('udev-builtin-uaccess.c')
endif
############################################################
@@ -104,6 +103,7 @@ link_config_gperf_c = custom_target(
output : 'link-config-gperf.c',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
udevadm_extract_sources += link_config_gperf_c
generated_sources += link_config_gperf_c
############################################################
@@ -119,18 +119,6 @@ endif
############################################################
libudevd_core = static_library(
'udev-core',
libudevd_core_sources,
link_config_gperf_c,
keyboard_keys_from_name_h,
include_directories : includes + include_directories('net'),
link_with : udev_link_with,
dependencies : [libblkid,
libkmod_cflags,
userspace],
build_by_default : false)
udev_dependencies = [
libacl,
libblkid,
@@ -147,12 +135,10 @@ udev_plugin_template = executable_template + {
}
udev_common_template = {
'link_with' : [
libshared,
libudevd_core,
],
'objects' : ['udevadm'],
'dependencies' : [
libacl,
libblkid,
threads,
],
}
@@ -163,11 +149,19 @@ udev_binaries_dict = [
executable_template + {
'name' : 'udevadm',
'public' : true,
'sources' : udevadm_sources,
'link_with' : [libudevd_core],
'sources' : [
udevadm_sources,
udevadm_extract_sources,
keyboard_keys_from_name_h,
],
'include_directories' : [
libexec_template['include_directories'],
include_directories('.', 'net'),
],
'dependencies' : udev_dependencies,
'install_rpath' : udev_rpath,
'install_tag' : 'udev',
'extract' : udevadm_extract_sources,
},
udev_plugin_template + {
'name' : 'ata_id',
@@ -188,6 +182,7 @@ udev_binaries_dict = [
'fido_id/fido_id.c',
'fido_id/fido_id_desc.c',
),
'extract' : files('fido_id/fido_id_desc.c'),
},
udev_plugin_template + {
'name' : 'iocost',
@@ -221,15 +216,12 @@ endforeach
executables += udev_binaries_dict
executables += [
test_template + {
'sources' : files(
'fido_id/test-fido-id-desc.c',
'fido_id/fido_id_desc.c',
),
'sources' : files('fido_id/test-fido-id-desc.c'),
'objects' : ['fido_id'],
'suite' : 'udev',
},
udev_test_template + {
'sources' : files('net/test-link-config-tables.c'),
'include_directories' : includes + include_directories('.'),
'suite' : 'udev',
},
udev_test_template + {
@@ -258,14 +250,11 @@ executables += [
'sources' : files('test-udev-spawn.c'),
},
fuzz_template + {
'sources' : files(
'fido_id/fuzz-fido-id-desc.c',
'fido_id/fido_id_desc.c',
),
'sources' : files('fido_id/fuzz-fido-id-desc.c'),
'objects' : ['fido_id'],
},
udev_fuzz_template + {
'sources' : files('net/fuzz-link-parser.c'),
'include_directories' : includes + include_directories('.'),
},
udev_fuzz_template + {
'sources' : files('fuzz-udev-rule-parse-value.c'),

View File

@@ -4,39 +4,27 @@ if conf.get('ENABLE_VMSPAWN') != 1
subdir_done()
endif
libvmspawn_core_sources = files(
vmspawn_sources = files(
'vmspawn.c',
'vmspawn-settings.c',
'vmspawn-util.c',
'vmspawn-scope.c',
'vmspawn-mount.c',
'vmspawn-register.c',
)
libvmspawn_core = static_library(
'vmspawn-core',
libvmspawn_core_sources,
include_directories : includes,
dependencies : [userspace],
build_by_default : false)
vmspawn_libs = [
libvmspawn_core,
libshared,
]
vmspawn_test_template = test_template + {
'link_with' : [vmspawn_libs],
}
vmspawn_extract_sources = files(
'vmspawn-util.c',
)
executables += [
executable_template + {
'name' : 'systemd-vmspawn',
'public' : true,
'sources' : files('vmspawn.c'),
'link_with' : vmspawn_libs,
'sources' : [vmspawn_sources, vmspawn_extract_sources],
'extract' : vmspawn_extract_sources,
'dependencies' : [libblkid]
},
vmspawn_test_template + {
test_template + {
'sources' : files('test-vmspawn-util.c'),
'objects' : ['systemd-vmspawn'],
},
]

View File

@@ -1,32 +1,36 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('ENABLE_XDG_AUTOSTART') != 1
subdir_done()
endif
systemd_xdg_autostart_generator_sources = files(
'xdg-autostart-generator.c',
)
systemd_xdg_autostart_generator_extract_sources = files(
'xdg-autostart-service.c',
)
executables += [
executable_template + {
'name' : 'systemd-xdg-autostart-generator',
'conditions' : ['ENABLE_XDG_AUTOSTART'],
'sources' : systemd_xdg_autostart_generator_sources,
'sources' : [
systemd_xdg_autostart_generator_sources,
systemd_xdg_autostart_generator_extract_sources,
],
'extract' : systemd_xdg_autostart_generator_extract_sources,
'install_dir' : usergeneratordir,
},
libexec_template + {
'name' : 'systemd-xdg-autostart-condition',
'conditions' : ['ENABLE_XDG_AUTOSTART'],
'sources' : files('xdg-autostart-condition.c'),
},
test_template + {
'sources' : files(
'test-xdg-autostart.c',
'xdg-autostart-service.c',
),
'sources' : files('test-xdg-autostart.c'),
'objects' : ['systemd-xdg-autostart-generator'],
},
fuzz_template + {
'sources' : files(
'fuzz-xdg-desktop.c',
'xdg-autostart-service.c',
),
'sources' : files('fuzz-xdg-desktop.c'),
'objects' : ['systemd-xdg-autostart-generator'],
},
]

View File

@@ -32,7 +32,7 @@ meson_args=("-Db_lundef=false")
if [ -z "$FUZZING_ENGINE" ]; then
meson_args+=("-Dllvm-fuzz=true")
else
meson_args+=("-Doss-fuzz=true" "--auto-features=disabled")
meson_args+=("-Doss-fuzz=true" "--auto-features=disabled" "-Dnspawn=enabled" "-Dresolve=true")
apt-get update
apt-get install -y gperf m4 gettext python3-pip \