]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | # SPDX-License-Identifier: LGPL-2.1-or-later |
3a726fcd | 2 | |
5c23128d | 3 | project('systemd', 'c', |
a1429c64 | 4 | version : '253', |
5c23128d ZJS |
5 | license : 'LGPLv2+', |
6 | default_options: [ | |
2b2dbcbb | 7 | 'c_std=gnu11', |
37efbbd8 ZJS |
8 | 'prefix=/usr', |
9 | 'sysconfdir=/etc', | |
10 | 'localstatedir=/var', | |
827ca909 | 11 | 'warning_level=2', |
5c23128d | 12 | ], |
9247df5a | 13 | meson_version : '>= 0.53.2', |
5c23128d ZJS |
14 | ) |
15 | ||
a1429c64 LB |
16 | libsystemd_version = '0.36.0' |
17 | libudev_version = '1.7.6' | |
56d50ab1 | 18 | |
5c23128d | 19 | conf = configuration_data() |
a8c03388 | 20 | conf.set_quoted('PROJECT_URL', 'https://systemd.io/') |
e11a25ca | 21 | conf.set('PROJECT_VERSION', meson.project_version(), |
6ffeca8c | 22 | description : 'Numerical project version (used where a simple number is expected)') |
5c23128d | 23 | |
1485aacb DC |
24 | # This is to be used instead of meson.source_root(), as the latter will return |
25 | # the wrong result when systemd is being built as a meson subproject | |
26 | project_source_root = meson.current_source_dir() | |
81e06775 | 27 | project_build_root = meson.current_build_dir() |
a0b15b41 | 28 | relative_source_path = run_command('realpath', |
81e06775 | 29 | '--relative-to=@0@'.format(project_build_root), |
e92777d2 ZJS |
30 | project_source_root, |
31 | check : true).stdout().strip() | |
a0b15b41 | 32 | conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) |
1485aacb | 33 | |
47350c5f ZJS |
34 | conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer', |
35 | description : 'tailor build to development or release builds') | |
011a03a3 ZJS |
36 | verification = get_option('log-message-verification') |
37 | if verification == 'auto' | |
38 | verification = conf.get('BUILD_MODE_DEVELOPER') == 1 | |
39 | else | |
40 | verification = verification == 'true' | |
41 | endif | |
42 | conf.set10('LOG_MESSAGE_VERIFICATION', verification) | |
839bdf25 | 43 | |
c09edc79 ZJS |
44 | want_ossfuzz = get_option('oss-fuzz') |
45 | want_libfuzzer = get_option('llvm-fuzz') | |
c29537f3 | 46 | if want_ossfuzz and want_libfuzzer |
6b8d32ea | 47 | error('only one of oss-fuzz or llvm-fuzz can be specified') |
c09edc79 | 48 | endif |
87ac55a1 | 49 | |
678ba020 | 50 | skip_deps = want_ossfuzz or get_option('skip-deps') |
6b8d32ea | 51 | fuzzer_build = want_ossfuzz or want_libfuzzer |
c09edc79 | 52 | |
c4f883b7 ZJS |
53 | # If we're building *not* for actual fuzzing, allow input samples of any size |
54 | # (for testing and for reproduction of issues discovered with previously-higher | |
55 | # limits). | |
56 | conf.set10('FUZZ_USE_SIZE_LIMIT', fuzzer_build) | |
57 | ||
493cd503 ZJS |
58 | # We'll set this to '1' for EFI builds in a different place. |
59 | conf.set10('SD_BOOT', false) | |
60 | ||
3f871f12 ZJS |
61 | # Create a title-less summary section early, so it ends up first in the output. |
62 | # More items are added later after they have been detected. | |
63 | summary({'build mode' : get_option('mode')}) | |
64 | ||
5c23128d ZJS |
65 | ##################################################################### |
66 | ||
003c8879 | 67 | # Try to install the git pre-commit hook |
e2d612a8 ZJS |
68 | add_git_hook_sh = find_program('tools/add-git-hook.sh', required : false) |
69 | if add_git_hook_sh.found() | |
e92777d2 | 70 | git_hook = run_command(add_git_hook_sh, check : false) |
e2d612a8 ZJS |
71 | if git_hook.returncode() == 0 |
72 | message(git_hook.stdout().strip()) | |
73 | endif | |
003c8879 ZJS |
74 | endif |
75 | ||
76 | ##################################################################### | |
77 | ||
4cf8a609 | 78 | fs = import('fs') |
2675413e | 79 | if get_option('split-usr') == 'auto' |
4cf8a609 | 80 | split_usr = not fs.is_symlink('/bin') |
2675413e ZJS |
81 | else |
82 | split_usr = get_option('split-usr') == 'true' | |
83 | endif | |
9afd5e7b ZJS |
84 | if split_usr |
85 | warning('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n' | |
86 | + ' split-usr mode is going to be removed\n' + | |
87 | '\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') | |
88 | endif | |
671f0f8d ZJS |
89 | conf.set10('HAVE_SPLIT_USR', split_usr, |
90 | description : '/usr/bin and /bin directories are separate') | |
9a8e64b0 | 91 | |
157baa87 | 92 | if get_option('split-bin') == 'auto' |
4cf8a609 | 93 | split_bin = not fs.is_symlink('/usr/sbin') |
157baa87 ZJS |
94 | else |
95 | split_bin = get_option('split-bin') == 'true' | |
96 | endif | |
671f0f8d ZJS |
97 | conf.set10('HAVE_SPLIT_BIN', split_bin, |
98 | description : 'bin and sbin directories are separate') | |
157baa87 | 99 | |
74344a17 | 100 | rootprefixdir = get_option('rootprefix') |
74344a17 ZJS |
101 | # Unusual rootprefixdir values are used by some distros |
102 | # (see https://github.com/systemd/systemd/pull/7461). | |
ba7f4ae6 | 103 | rootprefix_default = split_usr ? '/' : '/usr' |
9a8e64b0 ZJS |
104 | if rootprefixdir == '' |
105 | rootprefixdir = rootprefix_default | |
74344a17 | 106 | endif |
23bdba61 | 107 | rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir |
5c23128d | 108 | |
8ef8f3d5 FB |
109 | have_standalone_binaries = get_option('standalone-binaries') |
110 | ||
5c23128d ZJS |
111 | sysvinit_path = get_option('sysvinit-path') |
112 | sysvrcnd_path = get_option('sysvrcnd-path') | |
348b4437 | 113 | conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '', |
349cc4a5 | 114 | description : 'SysV init scripts and rcN.d links are supported') |
6fe23ff3 | 115 | conf.set10('CREATE_LOG_DIRS', get_option('create-log-dirs')) |
5c23128d | 116 | |
cdf7ad38 NL |
117 | if get_option('hibernate') and not get_option('initrd') |
118 | error('hibernate depends on initrd') | |
119 | endif | |
120 | ||
a8b627aa LP |
121 | conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max')) |
122 | conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open')) | |
09dad04c | 123 | conf.set('HIGH_RLIMIT_NOFILE', 512*1024) |
a8b627aa | 124 | |
fce9abb2 ZJS |
125 | # Meson ignores the preceding arguments when joining paths if an absolute |
126 | # component is encountered, so this should canonicalize various paths when they | |
127 | # are absolute or relative. | |
5c23128d ZJS |
128 | prefixdir = get_option('prefix') |
129 | if not prefixdir.startswith('/') | |
37efbbd8 | 130 | error('Prefix is not absolute: "@0@"'.format(prefixdir)) |
5c23128d | 131 | endif |
b2d74870 | 132 | if prefixdir != rootprefixdir and rootprefixdir != '/' and not prefixdir.strip('/').startswith(rootprefixdir.strip('/') + '/') |
d895e10a ZJS |
133 | error('Prefix is not below root prefix (now rootprefix=@0@ prefix=@1@)'.format( |
134 | rootprefixdir, prefixdir)) | |
135 | endif | |
136 | ||
fce9abb2 ZJS |
137 | bindir = prefixdir / get_option('bindir') |
138 | libdir = prefixdir / get_option('libdir') | |
139 | sysconfdir = prefixdir / get_option('sysconfdir') | |
140 | includedir = prefixdir / get_option('includedir') | |
141 | datadir = prefixdir / get_option('datadir') | |
142 | localstatedir = '/' / get_option('localstatedir') | |
5c23128d | 143 | |
fce9abb2 ZJS |
144 | rootbindir = rootprefixdir / 'bin' |
145 | rootsbindir = rootprefixdir / (split_bin ? 'sbin' : 'bin') | |
146 | rootlibexecdir = rootprefixdir / 'lib/systemd' | |
5c23128d ZJS |
147 | |
148 | rootlibdir = get_option('rootlibdir') | |
149 | if rootlibdir == '' | |
e91119c3 MG |
150 | # This will be a relative path if libdir is in prefix. |
151 | rootlibdir = get_option('libdir') | |
152 | endif | |
153 | if not rootlibdir.startswith('/') | |
154 | # If we have a relative path, add rootprefixdir to the front. | |
155 | rootlibdir = rootprefixdir / rootlibdir | |
5c23128d | 156 | endif |
5fb22561 | 157 | rootpkglibdir = rootlibdir / 'systemd' |
5c23128d | 158 | |
225d08b8 JT |
159 | install_sysconfdir = get_option('install-sysconfdir') != 'false' |
160 | install_sysconfdir_samples = get_option('install-sysconfdir') == 'true' | |
5c23128d | 161 | # Dirs of external packages |
fce9abb2 ZJS |
162 | pkgconfigdatadir = get_option('pkgconfigdatadir') != '' ? get_option('pkgconfigdatadir') : datadir / 'pkgconfig' |
163 | pkgconfiglibdir = get_option('pkgconfiglibdir') != '' ? get_option('pkgconfiglibdir') : libdir / 'pkgconfig' | |
164 | polkitpolicydir = datadir / 'polkit-1/actions' | |
165 | polkitrulesdir = datadir / 'polkit-1/rules.d' | |
166 | polkitpkladir = localstatedir / 'lib/polkit-1/localauthority/10-vendor.d' | |
167 | xinitrcdir = get_option('xinitrcdir') != '' ? get_option('xinitrcdir') : sysconfdir / 'X11/xinit/xinitrc.d' | |
8a38aac3 YW |
168 | rpmmacrosdir = get_option('rpmmacrosdir') |
169 | if rpmmacrosdir != 'no' | |
fce9abb2 | 170 | rpmmacrosdir = prefixdir / rpmmacrosdir |
8a38aac3 | 171 | endif |
fce9abb2 | 172 | modprobedir = rootprefixdir / 'lib/modprobe.d' |
5c23128d ZJS |
173 | |
174 | # Our own paths | |
fce9abb2 ZJS |
175 | pkgdatadir = datadir / 'systemd' |
176 | environmentdir = prefixdir / 'lib/environment.d' | |
177 | pkgsysconfdir = sysconfdir / 'systemd' | |
178 | userunitdir = prefixdir / 'lib/systemd/user' | |
179 | userpresetdir = prefixdir / 'lib/systemd/user-preset' | |
180 | tmpfilesdir = prefixdir / 'lib/tmpfiles.d' | |
107795a7 | 181 | usertmpfilesdir = prefixdir / 'share/user-tmpfiles.d' |
fce9abb2 ZJS |
182 | sysusersdir = prefixdir / 'lib/sysusers.d' |
183 | sysctldir = prefixdir / 'lib/sysctl.d' | |
184 | binfmtdir = prefixdir / 'lib/binfmt.d' | |
185 | modulesloaddir = prefixdir / 'lib/modules-load.d' | |
186 | networkdir = rootprefixdir / 'lib/systemd/network' | |
fce9abb2 ZJS |
187 | systemgeneratordir = rootlibexecdir / 'system-generators' |
188 | usergeneratordir = prefixdir / 'lib/systemd/user-generators' | |
189 | systemenvgeneratordir = prefixdir / 'lib/systemd/system-environment-generators' | |
190 | userenvgeneratordir = prefixdir / 'lib/systemd/user-environment-generators' | |
191 | systemshutdowndir = rootlibexecdir / 'system-shutdown' | |
192 | systemsleepdir = rootlibexecdir / 'system-sleep' | |
193 | systemunitdir = rootprefixdir / 'lib/systemd/system' | |
194 | systempresetdir = rootprefixdir / 'lib/systemd/system-preset' | |
195 | udevlibexecdir = rootprefixdir / 'lib/udev' | |
196 | udevrulesdir = udevlibexecdir / 'rules.d' | |
197 | udevhwdbdir = udevlibexecdir / 'hwdb.d' | |
198 | catalogdir = prefixdir / 'lib/systemd/catalog' | |
641e2124 | 199 | kerneldir = prefixdir / 'lib/kernel' |
200 | kernelinstalldir = kerneldir / 'install.d' | |
fce9abb2 ZJS |
201 | factorydir = datadir / 'factory' |
202 | bootlibdir = prefixdir / 'lib/systemd/boot/efi' | |
203 | testsdir = prefixdir / 'lib/systemd/tests' | |
204 | systemdstatedir = localstatedir / 'lib/systemd' | |
205 | catalogstatedir = systemdstatedir / 'catalog' | |
206 | randomseeddir = localstatedir / 'lib/systemd' | |
207 | profiledir = rootlibexecdir / 'portable' / 'profile' | |
208 | ntpservicelistdir = rootprefixdir / 'lib/systemd/ntp-units.d' | |
5c23128d | 209 | |
75aaade1 TB |
210 | docdir = get_option('docdir') |
211 | if docdir == '' | |
fce9abb2 | 212 | docdir = datadir / 'doc/systemd' |
75aaade1 TB |
213 | endif |
214 | ||
5c23128d ZJS |
215 | pamlibdir = get_option('pamlibdir') |
216 | if pamlibdir == '' | |
fce9abb2 | 217 | pamlibdir = rootlibdir / 'security' |
5c23128d ZJS |
218 | endif |
219 | ||
220 | pamconfdir = get_option('pamconfdir') | |
221 | if pamconfdir == '' | |
fce9abb2 | 222 | pamconfdir = prefixdir / 'lib/pam.d' |
5c23128d ZJS |
223 | endif |
224 | ||
d1ae38d8 OK |
225 | libcryptsetup_plugins_dir = get_option('libcryptsetup-plugins-dir') |
226 | if libcryptsetup_plugins_dir == '' | |
fce9abb2 | 227 | libcryptsetup_plugins_dir = rootlibdir / 'cryptsetup' |
d1ae38d8 OK |
228 | endif |
229 | ||
444d5863 | 230 | memory_accounting_default = get_option('memory-accounting-default') |
36cf4507 | 231 | status_unit_format_default = get_option('status-unit-format-default') |
819c0dcb ZJS |
232 | if status_unit_format_default == 'auto' |
233 | status_unit_format_default = conf.get('BUILD_MODE_DEVELOPER') == 1 ? 'name' : 'description' | |
234 | endif | |
444d5863 | 235 | |
491bf10c ZJS |
236 | conf.set_quoted('BINFMT_DIR', binfmtdir) |
237 | conf.set_quoted('BOOTLIBDIR', bootlibdir) | |
fce9abb2 | 238 | conf.set_quoted('CATALOG_DATABASE', catalogstatedir / 'database') |
491bf10c | 239 | conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) |
6fe23ff3 | 240 | conf.set_quoted('DOC_DIR', docdir) |
fce9abb2 | 241 | conf.set_quoted('DOCUMENT_ROOT', pkgdatadir / 'gatewayd') |
491bf10c ZJS |
242 | conf.set_quoted('ENVIRONMENT_DIR', environmentdir) |
243 | conf.set_quoted('INCLUDE_DIR', includedir) | |
244 | conf.set_quoted('LIBDIR', libdir) | |
245 | conf.set_quoted('MODPROBE_DIR', modprobedir) | |
246 | conf.set_quoted('MODULESLOAD_DIR', modulesloaddir) | |
5c23128d | 247 | conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) |
fce9abb2 | 248 | conf.set_quoted('POLKIT_AGENT_BINARY_PATH', bindir / 'pkttyagent') |
491bf10c | 249 | conf.set_quoted('PREFIX', prefixdir) |
fce9abb2 | 250 | conf.set_quoted('RANDOM_SEED', randomseeddir / 'random-seed') |
491bf10c | 251 | conf.set_quoted('RANDOM_SEED_DIR', randomseeddir) |
452d2dfd | 252 | conf.set_quoted('RC_LOCAL_PATH', get_option('rc-local')) |
491bf10c ZJS |
253 | conf.set_quoted('ROOTBINDIR', rootbindir) |
254 | conf.set_quoted('ROOTLIBDIR', rootlibdir) | |
255 | conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir) | |
256 | conf.set_quoted('ROOTPREFIX', rootprefixdir) | |
257 | conf.set_quoted('ROOTPREFIX_NOSLASH', rootprefixdir_noslash) | |
258 | conf.set_quoted('SYSCONF_DIR', sysconfdir) | |
259 | conf.set_quoted('SYSCTL_DIR', sysctldir) | |
fce9abb2 ZJS |
260 | conf.set_quoted('SYSTEMCTL_BINARY_PATH', rootbindir / 'systemctl') |
261 | conf.set_quoted('SYSTEMD_BINARY_PATH', rootlibexecdir / 'systemd') | |
491bf10c | 262 | conf.set_quoted('SYSTEMD_CATALOG_DIR', catalogdir) |
fce9abb2 ZJS |
263 | conf.set_quoted('SYSTEMD_CGROUPS_AGENT_PATH', rootlibexecdir / 'systemd-cgroups-agent') |
264 | conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', rootlibexecdir / 'systemd-cryptsetup') | |
265 | conf.set_quoted('SYSTEMD_EXPORT_PATH', rootlibexecdir / 'systemd-export') | |
266 | conf.set_quoted('SYSTEMD_FSCK_PATH', rootlibexecdir / 'systemd-fsck') | |
267 | conf.set_quoted('SYSTEMD_GROWFS_PATH', rootlibexecdir / 'systemd-growfs') | |
268 | conf.set_quoted('SYSTEMD_HOMEWORK_PATH', rootlibexecdir / 'systemd-homework') | |
269 | conf.set_quoted('SYSTEMD_IMPORT_FS_PATH', rootlibexecdir / 'systemd-import-fs') | |
270 | conf.set_quoted('SYSTEMD_IMPORT_PATH', rootlibexecdir / 'systemd-import') | |
1f1a2243 | 271 | conf.set_quoted('SYSTEMD_INTEGRITYSETUP_PATH', rootlibexecdir / 'systemd-integritysetup') |
fce9abb2 ZJS |
272 | conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', pkgdatadir / 'kbd-model-map') |
273 | conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', pkgdatadir / 'language-fallback-map') | |
274 | conf.set_quoted('SYSTEMD_MAKEFS_PATH', rootlibexecdir / 'systemd-makefs') | |
275 | conf.set_quoted('SYSTEMD_PULL_PATH', rootlibexecdir / 'systemd-pull') | |
276 | conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', rootlibexecdir / 'systemd-shutdown') | |
fce9abb2 ZJS |
277 | conf.set_quoted('SYSTEMD_TEST_DATA', testsdir / 'testdata') |
278 | conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', rootbindir / 'systemd-tty-ask-password-agent') | |
279 | conf.set_quoted('SYSTEMD_UPDATE_HELPER_PATH', rootlibexecdir / 'systemd-update-helper') | |
280 | conf.set_quoted('SYSTEMD_USERWORK_PATH', rootlibexecdir / 'systemd-userwork') | |
281 | conf.set_quoted('SYSTEMD_VERITYSETUP_PATH', rootlibexecdir / 'systemd-veritysetup') | |
282 | conf.set_quoted('SYSTEM_CONFIG_UNIT_DIR', pkgsysconfdir / 'system') | |
491bf10c | 283 | conf.set_quoted('SYSTEM_DATA_UNIT_DIR', systemunitdir) |
96d33e4a | 284 | conf.set_quoted('SYSTEM_ENV_GENERATOR_DIR', systemenvgeneratordir) |
491bf10c ZJS |
285 | conf.set_quoted('SYSTEM_GENERATOR_DIR', systemgeneratordir) |
286 | conf.set_quoted('SYSTEM_PRESET_DIR', systempresetdir) | |
5c23128d ZJS |
287 | conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir) |
288 | conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir) | |
491bf10c ZJS |
289 | conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) |
290 | conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) | |
835cf75a ZJS |
291 | conf.set_quoted('SYSUSERS_DIR', sysusersdir) |
292 | conf.set_quoted('TMPFILES_DIR', tmpfilesdir) | |
107795a7 | 293 | conf.set_quoted('USER_TMPFILES_DIR', usertmpfilesdir) |
5c23128d | 294 | conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir) |
491bf10c ZJS |
295 | conf.set_quoted('UDEV_HWDB_DIR', udevhwdbdir) |
296 | conf.set_quoted('UDEV_RULES_DIR', udevrulesdir) | |
fce9abb2 | 297 | conf.set_quoted('USER_CONFIG_UNIT_DIR', pkgsysconfdir / 'user') |
491bf10c ZJS |
298 | conf.set_quoted('USER_DATA_UNIT_DIR', userunitdir) |
299 | conf.set_quoted('USER_ENV_GENERATOR_DIR', userenvgeneratordir) | |
300 | conf.set_quoted('USER_GENERATOR_DIR', usergeneratordir) | |
fce9abb2 | 301 | conf.set_quoted('USER_KEYRING_PATH', pkgsysconfdir / 'import-pubring.gpg') |
491bf10c | 302 | conf.set_quoted('USER_PRESET_DIR', userpresetdir) |
fce9abb2 | 303 | conf.set_quoted('VENDOR_KEYRING_PATH', rootlibexecdir / 'import-pubring.gpg') |
491bf10c ZJS |
304 | |
305 | conf.set('ANSI_OK_COLOR', 'ANSI_' + get_option('ok-color').underscorify().to_upper()) | |
e5d86ebe | 306 | conf.set10('ENABLE_URLIFY', get_option('urlify')) |
491bf10c | 307 | conf.set10('ENABLE_FEXECVE', get_option('fexecve')) |
30538ff1 | 308 | conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default) |
36cf4507 | 309 | conf.set('STATUS_UNIT_FORMAT_DEFAULT', 'STATUS_UNIT_FORMAT_' + status_unit_format_default.to_upper()) |
e11a25ca | 310 | conf.set_quoted('STATUS_UNIT_FORMAT_DEFAULT_STR', status_unit_format_default) |
5c23128d | 311 | |
e4c7b5f5 ZJS |
312 | conf.set('DEFAULT_TIMEOUT_SEC', get_option('default-timeout-sec')) |
313 | conf.set('DEFAULT_USER_TIMEOUT_SEC', get_option('default-user-timeout-sec')) | |
314 | conf.set('UPDATE_HELPER_USER_TIMEOUT_SEC', get_option('update-helper-user-timeout-sec')) | |
315 | ||
93651582 JL |
316 | conf.set10('FIRST_BOOT_FULL_PRESET', get_option('first-boot-full-preset')) |
317 | ||
5c23128d ZJS |
318 | ##################################################################### |
319 | ||
320 | cc = meson.get_compiler('c') | |
b68dfb9e | 321 | meson_build_sh = find_program('tools/meson-build.sh') |
5c23128d | 322 | |
d3da291e ZJS |
323 | want_tests = get_option('tests') |
324 | slow_tests = want_tests != 'false' and get_option('slow-tests') | |
c56463fd | 325 | fuzz_tests = want_tests != 'false' and get_option('fuzz-tests') |
d3da291e ZJS |
326 | install_tests = get_option('install-tests') |
327 | ||
46e63a2a | 328 | if add_languages('cpp', required : fuzzer_build) |
3b2bdd62 | 329 | # Used only for tests |
e9f4f566 ZJS |
330 | cxx = meson.get_compiler('cpp') |
331 | cxx_cmd = ' '.join(cxx.cmd_array()) | |
1b2acaa7 | 332 | else |
9b0ca019 | 333 | cxx_cmd = '' |
94e2523b ZJS |
334 | endif |
335 | ||
31e57a35 | 336 | if want_libfuzzer |
9c5c4677 EV |
337 | fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer', required : false) |
338 | if fuzzing_engine.found() | |
339 | add_project_arguments('-fsanitize-coverage=trace-pc-guard,trace-cmp', language : 'c') | |
340 | elif cc.has_argument('-fsanitize=fuzzer-no-link') | |
341 | add_project_arguments('-fsanitize=fuzzer-no-link', language : 'c') | |
342 | else | |
343 | error('Looks like neither libFuzzer nor -fsanitize=fuzzer-no-link is supported') | |
344 | endif | |
c09edc79 | 345 | elif want_ossfuzz |
7db7d5b7 JR |
346 | fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine') |
347 | endif | |
348 | ||
e9f4f566 ZJS |
349 | # Those generate many false positives, and we do not want to change the code to |
350 | # avoid them. | |
351 | basic_disabled_warnings = [ | |
e9f4f566 | 352 | '-Wno-missing-field-initializers', |
505ab9dd | 353 | '-Wno-unused-parameter', |
e9f4f566 | 354 | ] |
e9f4f566 | 355 | |
65267363 | 356 | possible_common_cc_flags = [ |
fc568837 ZJS |
357 | '-Warray-bounds', # clang |
358 | '-Warray-bounds=2', | |
505ab9dd YW |
359 | '-Wdate-time', |
360 | '-Wendif-labels', | |
361 | '-Werror=format=2', | |
a4ea5d19 | 362 | '-Werror=format-signedness', |
505ab9dd | 363 | '-Werror=implicit-function-declaration', |
a0d613ec | 364 | '-Werror=implicit-int', |
505ab9dd | 365 | '-Werror=incompatible-pointer-types', |
ebbb1e36 | 366 | '-Werror=int-conversion', |
505ab9dd | 367 | '-Werror=overflow', |
48c67fdf | 368 | '-Werror=override-init', |
505ab9dd YW |
369 | '-Werror=return-type', |
370 | '-Werror=shift-count-overflow', | |
371 | '-Werror=shift-overflow=2', | |
30a4ddff | 372 | '-Werror=undef', |
505ab9dd | 373 | '-Wfloat-equal', |
c0f5d58c JJ |
374 | # gperf prevents us from enabling this because it does not emit fallthrough |
375 | # attribute with clang. | |
376 | #'-Wimplicit-fallthrough', | |
505ab9dd YW |
377 | '-Wimplicit-fallthrough=5', |
378 | '-Winit-self', | |
30a4ddff YW |
379 | '-Wlogical-op', |
380 | '-Wmissing-include-dirs', | |
505ab9dd YW |
381 | '-Wmissing-noreturn', |
382 | '-Wnested-externs', | |
30a4ddff YW |
383 | '-Wold-style-definition', |
384 | '-Wpointer-arith', | |
30a4ddff | 385 | '-Wredundant-decls', |
30a4ddff | 386 | '-Wshadow', |
30a4ddff | 387 | '-Wstrict-aliasing=2', |
505ab9dd YW |
388 | '-Wstrict-prototypes', |
389 | '-Wsuggest-attribute=noreturn', | |
054ed430 | 390 | '-Wunused-function', |
30a4ddff | 391 | '-Wwrite-strings', |
31560245 | 392 | '-Wzero-length-bounds', |
bf7efeb1 FB |
393 | |
394 | # negative arguments are correctly detected starting with meson 0.46. | |
eed33623 ZJS |
395 | '-Wno-error=#warnings', # clang |
396 | '-Wno-string-plus-int', # clang | |
fc568837 ZJS |
397 | |
398 | '-fstrict-flex-arrays', | |
30a4ddff YW |
399 | ] |
400 | ||
b528a628 ZJS |
401 | c_args = get_option('c_args') |
402 | ||
60f97fee | 403 | # Our json library does not support -ffinite-math-only, which is enabled by -Ofast or -ffast-math. |
53403091 | 404 | if (('-Ofast' in c_args or '-ffast-math' in c_args or '-ffinite-math-only' in c_args) and '-fno-finite-math-only' not in c_args) |
60f97fee YW |
405 | error('-Ofast, -ffast-math, or -ffinite-math-only is specified in c_args.') |
406 | endif | |
407 | ||
a17e5478 | 408 | # Disable -Wmaybe-uninitialized when compiling with -Os/-O1/-O3/etc. There are |
68c98a41 ZJS |
409 | # too many false positives with gcc >= 8. Effectively, we only test with -O0 |
410 | # and -O2; this should be enough to catch most important cases without too much | |
411 | # busywork. See https://github.com/systemd/systemd/pull/19226. | |
412 | if cc.get_id() == 'gcc' and (not '02'.contains(get_option('optimization')) or | |
b528a628 ZJS |
413 | cc.version().version_compare('<10') or |
414 | '-Os' in c_args or | |
415 | '-O1' in c_args or | |
416 | '-O3' in c_args or | |
417 | '-Og' in c_args) | |
65267363 | 418 | possible_common_cc_flags += '-Wno-maybe-uninitialized' |
68c98a41 ZJS |
419 | endif |
420 | ||
bc2a4af2 ZJS |
421 | # Disable -Wno-unused-result with gcc, see |
422 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425. | |
423 | if cc.get_id() == 'gcc' | |
424 | possible_common_cc_flags += '-Wno-unused-result' | |
425 | endif | |
426 | ||
30a4ddff | 427 | # --as-needed and --no-undefined are provided by meson by default, |
9247df5a | 428 | # run 'meson configure' to see what is enabled |
30a4ddff | 429 | possible_link_flags = [ |
42e3bb35 | 430 | '-Wl,--fatal-warnings', |
30a4ddff | 431 | '-Wl,-z,now', |
42e3bb35 | 432 | '-Wl,-z,relro', |
68e70ac2 | 433 | '-fstack-protector', |
30a4ddff | 434 | ] |
5c23128d | 435 | |
42e3bb35 JJ |
436 | if get_option('b_sanitize') == 'none' |
437 | possible_link_flags += '-Wl,--warn-common' | |
438 | endif | |
439 | ||
30a4ddff | 440 | if cc.get_id() == 'clang' |
65267363 | 441 | possible_common_cc_flags += [ |
30a4ddff YW |
442 | '-Wno-typedef-redefinition', |
443 | '-Wno-gnu-variable-sized-type-not-at-end', | |
444 | ] | |
445 | endif | |
446 | ||
1a4e3927 JJ |
447 | if get_option('mode') == 'release' |
448 | # We could enable 'pattern' for developer mode, but that can interfere with | |
449 | # valgrind and sanitizer builds. Also, clang does not zero-initialize unions, | |
450 | # breaking some of our code (https://reviews.llvm.org/D68115). | |
451 | possible_common_cc_flags += '-ftrivial-auto-var-init=zero' | |
452 | endif | |
453 | ||
16e09d51 YW |
454 | possible_cc_flags = possible_common_cc_flags + [ |
455 | '-Werror=missing-declarations', | |
456 | '-Werror=missing-prototypes', | |
457 | '-fdiagnostics-show-option', | |
16e09d51 YW |
458 | '-fno-common', |
459 | '-fno-strict-aliasing', | |
460 | '-fstack-protector', | |
461 | '-fstack-protector-strong', | |
afd8e1d9 | 462 | '-fstrict-flex-arrays=1', |
16e09d51 YW |
463 | '-fvisibility=hidden', |
464 | '--param=ssp-buffer-size=4', | |
465 | ] | |
466 | ||
30a4ddff | 467 | if get_option('buildtype') != 'debug' |
16e09d51 | 468 | possible_cc_flags += [ |
30a4ddff YW |
469 | '-ffunction-sections', |
470 | '-fdata-sections', | |
471 | ] | |
472 | ||
473 | possible_link_flags += '-Wl,--gc-sections' | |
474 | endif | |
475 | ||
82390022 DDM |
476 | if get_option('mode') == 'developer' |
477 | possible_cc_flags += '-fno-omit-frame-pointer' | |
478 | endif | |
479 | ||
e9f4f566 | 480 | add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c') |
30a4ddff | 481 | add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c') |
7a6397d2 | 482 | add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c') |
30a4ddff | 483 | |
94c0c5b7 ZJS |
484 | have = cc.has_argument('-Wzero-length-bounds') |
485 | conf.set10('HAVE_ZERO_LENGTH_BOUNDS', have) | |
486 | ||
9e70f2f8 | 487 | if cc.compiles(''' |
5c23128d ZJS |
488 | #include <time.h> |
489 | #include <inttypes.h> | |
490 | typedef uint64_t usec_t; | |
491 | usec_t now(clockid_t clock); | |
492 | int main(void) { | |
493 | struct timespec now; | |
494 | return 0; | |
495 | } | |
38c1c96d | 496 | ''', args: '-Werror=shadow', name : '-Werror=shadow with local shadowing') |
37efbbd8 | 497 | add_project_arguments('-Werror=shadow', language : 'c') |
5c23128d ZJS |
498 | endif |
499 | ||
e9f4f566 ZJS |
500 | if cxx_cmd != '' |
501 | add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp') | |
502 | endif | |
503 | ||
0e3cc902 | 504 | cpp = ' '.join(cc.cmd_array()) + ' -E' |
9cc0e6e9 | 505 | |
6695c200 ZJS |
506 | has_wstringop_truncation = cc.has_argument('-Wstringop-truncation') |
507 | ||
5c23128d ZJS |
508 | ##################################################################### |
509 | # compilation result tests | |
510 | ||
2c201c21 ZJS |
511 | conf.set('_GNU_SOURCE', true) |
512 | conf.set('__SANE_USERSPACE_TYPES__', true) | |
6695c200 | 513 | conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation) |
5c23128d | 514 | |
5c23128d ZJS |
515 | conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>')) |
516 | conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>')) | |
517 | conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>')) | |
518 | conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>')) | |
3112d756 | 519 | conf.set('SIZEOF_TIMEX_MEMBER', cc.sizeof('typeof(((struct timex *)0)->freq)', prefix : '#include <sys/timex.h>')) |
5c23128d | 520 | |
2736a0c6 | 521 | long_max = cc.compute_int( |
522 | 'LONG_MAX', | |
523 | prefix : '#include <limits.h>', | |
524 | guess : 0x7FFFFFFFFFFFFFFF, | |
525 | high : 0x7FFFFFFFFFFFFFFF) | |
a5fac1df ZJS |
526 | assert(long_max > 100000) |
527 | conf.set_quoted('LONG_MAX_STR', '@0@'.format(long_max)) | |
528 | ||
5c23128d ZJS |
529 | decl_headers = ''' |
530 | #include <uchar.h> | |
84e8edec | 531 | #include <sys/mount.h> |
4c2e1b39 | 532 | #include <sys/stat.h> |
5c23128d | 533 | ''' |
5c23128d ZJS |
534 | |
535 | foreach decl : ['char16_t', | |
536 | 'char32_t', | |
84e8edec | 537 | 'struct mount_attr', |
4c2e1b39 | 538 | 'struct statx', |
5c23128d | 539 | ] |
2c201c21 ZJS |
540 | |
541 | # We get -1 if the size cannot be determined | |
9c869d08 ZJS |
542 | have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 |
543 | ||
3657d3a0 RH |
544 | if decl == 'struct mount_attr' |
545 | if have | |
546 | want_linux_fs_h = false | |
547 | else | |
548 | have = cc.sizeof(decl, | |
549 | prefix : decl_headers + '#include <linux/fs.h>', | |
550 | args : '-D_GNU_SOURCE') > 0 | |
551 | want_linux_fs_h = have | |
552 | endif | |
553 | endif | |
554 | ||
9c869d08 ZJS |
555 | if decl == 'struct statx' |
556 | if have | |
557 | want_linux_stat_h = false | |
558 | else | |
559 | have = cc.sizeof(decl, | |
560 | prefix : decl_headers + '#include <linux/stat.h>', | |
561 | args : '-D_GNU_SOURCE') > 0 | |
562 | want_linux_stat_h = have | |
563 | endif | |
564 | endif | |
565 | ||
349cc4a5 | 566 | conf.set10('HAVE_' + decl.underscorify().to_upper(), have) |
5c23128d ZJS |
567 | endforeach |
568 | ||
9c869d08 | 569 | conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) |
3657d3a0 | 570 | conf.set10('WANT_LINUX_FS_H', want_linux_fs_h) |
75720bff | 571 | |
5c23128d | 572 | foreach ident : ['secure_getenv', '__secure_getenv'] |
349cc4a5 | 573 | conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) |
5c23128d ZJS |
574 | endforeach |
575 | ||
576 | foreach ident : [ | |
85db59b7 | 577 | ['memfd_create', '''#include <sys/mman.h>'''], |
7b961e40 LP |
578 | ['gettid', '''#include <sys/types.h> |
579 | #include <unistd.h>'''], | |
3c042add LP |
580 | ['pivot_root', '''#include <stdlib.h> |
581 | #include <unistd.h>'''], # no known header declares pivot_root | |
51fe206f ZJS |
582 | ['ioprio_get', '''#include <sched.h>'''], # no known header declares ioprio_get |
583 | ['ioprio_set', '''#include <sched.h>'''], # no known header declares ioprio_set | |
85db59b7 | 584 | ['name_to_handle_at', '''#include <sys/types.h> |
37efbbd8 ZJS |
585 | #include <sys/stat.h> |
586 | #include <fcntl.h>'''], | |
85db59b7 | 587 | ['setns', '''#include <sched.h>'''], |
2acfd0ff LP |
588 | ['renameat2', '''#include <stdio.h> |
589 | #include <fcntl.h>'''], | |
37efbbd8 ZJS |
590 | ['kcmp', '''#include <linux/kcmp.h>'''], |
591 | ['keyctl', '''#include <sys/types.h> | |
592 | #include <keyutils.h>'''], | |
85db59b7 | 593 | ['copy_file_range', '''#include <sys/syscall.h> |
37efbbd8 | 594 | #include <unistd.h>'''], |
71e5200f DM |
595 | ['bpf', '''#include <sys/syscall.h> |
596 | #include <unistd.h>'''], | |
4c2e1b39 LP |
597 | ['statx', '''#include <sys/types.h> |
598 | #include <sys/stat.h> | |
599 | #include <unistd.h>'''], | |
aa484f35 | 600 | ['explicit_bzero' , '''#include <string.h>'''], |
5bb20fd3 | 601 | ['reallocarray', '''#include <stdlib.h>'''], |
b070c7c0 MS |
602 | ['set_mempolicy', '''#include <stdlib.h> |
603 | #include <unistd.h>'''], | |
604 | ['get_mempolicy', '''#include <stdlib.h> | |
605 | #include <unistd.h>'''], | |
5f152f43 LP |
606 | ['pidfd_send_signal', '''#include <stdlib.h> |
607 | #include <unistd.h> | |
608 | #include <signal.h> | |
609 | #include <sys/wait.h>'''], | |
610 | ['pidfd_open', '''#include <stdlib.h> | |
611 | #include <unistd.h> | |
612 | #include <signal.h> | |
613 | #include <sys/wait.h>'''], | |
5ead4e85 LP |
614 | ['rt_sigqueueinfo', '''#include <stdlib.h> |
615 | #include <unistd.h> | |
616 | #include <signal.h> | |
617 | #include <sys/wait.h>'''], | |
a5421953 DDM |
618 | ['rt_tgsigqueueinfo', '''#include <stdlib.h> |
619 | #include <unistd.h> | |
620 | #include <signal.h> | |
621 | #include <sys/wait.h>'''], | |
4b6f74f5 | 622 | ['mallinfo', '''#include <malloc.h>'''], |
1885169c | 623 | ['mallinfo2', '''#include <malloc.h>'''], |
8939eeae | 624 | ['execveat', '''#include <unistd.h>'''], |
441e0fdb | 625 | ['close_range', '''#include <unistd.h>'''], |
420297c9 | 626 | ['epoll_pwait2', '''#include <sys/epoll.h>'''], |
84e8edec LP |
627 | ['mount_setattr', '''#include <sys/mount.h>'''], |
628 | ['move_mount', '''#include <sys/mount.h>'''], | |
629 | ['open_tree', '''#include <sys/mount.h>'''], | |
1c265fcd DDM |
630 | ['fsopen', '''#include <sys/mount.h>'''], |
631 | ['fsconfig', '''#include <sys/mount.h>'''], | |
aab35b1e | 632 | ['getdents64', '''#include <dirent.h>'''], |
37efbbd8 ZJS |
633 | ] |
634 | ||
85db59b7 | 635 | have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') |
4b9545f1 | 636 | conf.set10('HAVE_' + ident[0].to_upper(), have) |
5c23128d ZJS |
637 | endforeach |
638 | ||
85db59b7 | 639 | if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE') |
349cc4a5 | 640 | conf.set10('USE_SYS_RANDOM_H', true) |
4b9545f1 | 641 | conf.set10('HAVE_GETRANDOM', true) |
4984c8be ZJS |
642 | else |
643 | have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''') | |
349cc4a5 | 644 | conf.set10('USE_SYS_RANDOM_H', false) |
4b9545f1 | 645 | conf.set10('HAVE_GETRANDOM', have) |
4984c8be ZJS |
646 | endif |
647 | ||
5c23128d ZJS |
648 | ##################################################################### |
649 | ||
064b8e2c DDM |
650 | version_tag = get_option('version-tag') |
651 | if version_tag != '' | |
652 | vcs_data = configuration_data() | |
653 | vcs_data.set('VCS_TAG', version_tag) | |
654 | version_h = configure_file(configuration : vcs_data, | |
655 | input : 'src/version/version.h.in', | |
656 | output : 'version.h') | |
657 | else | |
658 | vcs_tagger = [ | |
659 | project_source_root + '/tools/meson-vcs-tag.sh', | |
660 | project_source_root, | |
661 | meson.project_version()] | |
662 | ||
663 | version_h = vcs_tag( | |
664 | input : 'src/version/version.h.in', | |
665 | output : 'version.h', | |
666 | command: vcs_tagger) | |
667 | endif | |
d1084aa2 LT |
668 | |
669 | versiondep = declare_dependency(sources: version_h) | |
670 | ||
a2b0cd3f ZJS |
671 | shared_lib_tag = get_option('shared-lib-tag') |
672 | if shared_lib_tag == '' | |
673 | shared_lib_tag = meson.project_version() | |
674 | endif | |
675 | ||
0f4c4f38 ZJS |
676 | sh = find_program('sh') |
677 | echo = find_program('echo') | |
5c23128d | 678 | sed = find_program('sed') |
5c23128d | 679 | awk = find_program('awk') |
5c23128d | 680 | stat = find_program('stat') |
0f4c4f38 | 681 | ln = find_program('ln') |
d68b342b | 682 | git = find_program('git', required : false) |
b68dfb9e | 683 | env = find_program('env') |
b1ffacb6 | 684 | perl = find_program('perl', required : false) |
0f4c4f38 | 685 | rsync = find_program('rsync', required : false) |
7c22f07c | 686 | meson_make_symlink = project_source_root + '/tools/meson-make-symlink.sh' |
5c23128d | 687 | |
94e75a54 ZJS |
688 | mkdir_p = 'mkdir -p $DESTDIR/@0@' |
689 | ||
9247df5a | 690 | # If -Dxxx-path option is found, use that. Otherwise, check in $PATH, |
5c23128d | 691 | # /usr/sbin, /sbin, and fall back to the default from middle column. |
2fa645f1 | 692 | progs = [['quotaon', '/usr/sbin/quotaon' ], |
5c23128d | 693 | ['quotacheck', '/usr/sbin/quotacheck' ], |
5c23128d ZJS |
694 | ['kmod', '/usr/bin/kmod' ], |
695 | ['kexec', '/usr/sbin/kexec' ], | |
696 | ['sulogin', '/usr/sbin/sulogin' ], | |
697 | ['mount', '/usr/bin/mount', 'MOUNT_PATH'], | |
698 | ['umount', '/usr/bin/umount', 'UMOUNT_PATH'], | |
699 | ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'], | |
700 | ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'], | |
6db90462 | 701 | ['nologin', '/usr/sbin/nologin', ], |
5c23128d ZJS |
702 | ] |
703 | foreach prog : progs | |
37efbbd8 ZJS |
704 | path = get_option(prog[0] + '-path') |
705 | if path != '' | |
706 | message('Using @1@ for @0@'.format(prog[0], path)) | |
707 | else | |
708 | exe = find_program(prog[0], | |
709 | '/usr/sbin/' + prog[0], | |
710 | '/sbin/' + prog[0], | |
711 | required: false) | |
712 | path = exe.found() ? exe.path() : prog[1] | |
713 | endif | |
714 | name = prog.length() > 2 ? prog[2] : prog[0].to_upper() | |
715 | conf.set_quoted(name, path) | |
5c23128d ZJS |
716 | endforeach |
717 | ||
2fa645f1 MG |
718 | conf.set_quoted('TELINIT', get_option('telinit-path')) |
719 | ||
e92777d2 | 720 | if run_command(ln, '--relative', '--help', check : false).returncode() != 0 |
cd001016 | 721 | error('ln does not support --relative (added in coreutils 8.16)') |
1276a9f6 | 722 | endif |
5c23128d ZJS |
723 | |
724 | ############################################################ | |
725 | ||
726 | gperf = find_program('gperf') | |
727 | ||
728 | gperf_test_format = ''' | |
729 | #include <string.h> | |
730 | const char * in_word_set(const char *, @0@); | |
731 | @1@ | |
732 | ''' | |
ac3eda34 | 733 | gperf_snippet = run_command(sh, '-c', 'echo foo,bar | "$1" -L ANSI-C', '_', gperf, |
e92777d2 | 734 | check : true) |
5c23128d ZJS |
735 | gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout()) |
736 | if cc.compiles(gperf_test) | |
37efbbd8 | 737 | gperf_len_type = 'size_t' |
5c23128d | 738 | else |
37efbbd8 ZJS |
739 | gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout()) |
740 | if cc.compiles(gperf_test) | |
741 | gperf_len_type = 'unsigned' | |
742 | else | |
743 | error('unable to determine gperf len type') | |
744 | endif | |
5c23128d ZJS |
745 | endif |
746 | message('gperf len type is @0@'.format(gperf_len_type)) | |
37efbbd8 ZJS |
747 | conf.set('GPERF_LEN_TYPE', gperf_len_type, |
748 | description : 'The type of gperf "len" parameter') | |
5c23128d ZJS |
749 | |
750 | ############################################################ | |
751 | ||
752 | if not cc.has_header('sys/capability.h') | |
37efbbd8 | 753 | error('POSIX caps headers not found') |
5c23128d | 754 | endif |
9f555bba | 755 | foreach header : ['crypt.h', |
5c23128d ZJS |
756 | 'linux/memfd.h', |
757 | 'linux/vm_sockets.h', | |
af8786b1 | 758 | 'sys/auxv.h', |
5c23128d ZJS |
759 | 'valgrind/memcheck.h', |
760 | 'valgrind/valgrind.h', | |
420297c9 | 761 | 'linux/time_types.h', |
b428efa5 | 762 | 'sys/sdt.h', |
5c23128d | 763 | ] |
2c201c21 | 764 | |
349cc4a5 ZJS |
765 | conf.set10('HAVE_' + header.underscorify().to_upper(), |
766 | cc.has_header(header)) | |
5c23128d ZJS |
767 | endforeach |
768 | ||
769 | ############################################################ | |
770 | ||
eef4b800 ZJS |
771 | fallback_hostname = get_option('fallback-hostname') |
772 | if fallback_hostname == '' or fallback_hostname[0] == '.' or fallback_hostname[0] == '-' | |
773 | error('Invalid fallback-hostname configuration') | |
774 | # A more extensive test is done in test-hostname-util. Let's catch | |
775 | # the most obvious errors here so we don't fail with an assert later. | |
776 | endif | |
777 | conf.set_quoted('FALLBACK_HOSTNAME', fallback_hostname) | |
778 | ||
5c23128d ZJS |
779 | default_hierarchy = get_option('default-hierarchy') |
780 | conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy, | |
781 | description : 'default cgroup hierarchy as string') | |
782 | if default_hierarchy == 'legacy' | |
37efbbd8 | 783 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE') |
5c23128d | 784 | elif default_hierarchy == 'hybrid' |
37efbbd8 | 785 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD') |
5c23128d | 786 | else |
37efbbd8 | 787 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL') |
5c23128d ZJS |
788 | endif |
789 | ||
681cb84a ZJS |
790 | extra_net_naming_schemes = [] |
791 | extra_net_naming_map = [] | |
792 | foreach scheme: get_option('extra-net-naming-schemes').split(',') | |
793 | if scheme != '' | |
794 | name = scheme.split('=')[0] | |
795 | value = scheme.split('=')[1] | |
796 | NAME = name.underscorify().to_upper() | |
797 | VALUE = [] | |
798 | foreach field: value.split('+') | |
799 | VALUE += 'NAMING_' + field.underscorify().to_upper() | |
800 | endforeach | |
801 | extra_net_naming_schemes += 'NAMING_@0@ = @1@,'.format(NAME, '|'.join(VALUE)) | |
802 | extra_net_naming_map += '{ "@0@", NAMING_@1@ },'.format(name, NAME) | |
803 | endif | |
804 | endforeach | |
805 | conf.set('EXTRA_NET_NAMING_SCHEMES', ' '.join(extra_net_naming_schemes)) | |
806 | conf.set('EXTRA_NET_NAMING_MAP', ' '.join(extra_net_naming_map)) | |
807 | ||
06da5c63 ZJS |
808 | default_net_naming_scheme = get_option('default-net-naming-scheme') |
809 | conf.set_quoted('DEFAULT_NET_NAMING_SCHEME', default_net_naming_scheme) | |
77faadfd ZJS |
810 | if default_net_naming_scheme != 'latest' |
811 | conf.set('_DEFAULT_NET_NAMING_SCHEME_TEST', | |
812 | 'NAMING_' + default_net_naming_scheme.underscorify().to_upper()) | |
813 | endif | |
06da5c63 | 814 | |
5c23128d | 815 | time_epoch = get_option('time-epoch') |
a36be3e5 | 816 | if time_epoch <= 0 |
e92777d2 | 817 | time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"', check : true).stdout().strip() |
4cf8a609 | 818 | if time_epoch == '' and git.found() and fs.exists('.git') |
bd190899 | 819 | # If we're in a git repository, use the creation time of the latest git tag. |
e92777d2 ZJS |
820 | latest_tag = run_command(git, 'describe', '--abbrev=0', '--tags', |
821 | check : false) | |
822 | if latest_tag.returncode() == 0 | |
823 | time_epoch = run_command( | |
824 | git, 'log', '--no-show-signature', '-1', '--format=%at', | |
825 | latest_tag.stdout().strip(), | |
826 | check : false).stdout() | |
827 | endif | |
0390b094 ZJS |
828 | endif |
829 | if time_epoch == '' | |
6dbf352c | 830 | NEWS = files('NEWS') |
e92777d2 ZJS |
831 | time_epoch = run_command(stat, '-c', '%Y', NEWS, |
832 | check : true).stdout() | |
6dbf352c | 833 | endif |
89cdbe1f | 834 | time_epoch = time_epoch.strip().to_int() |
5c23128d | 835 | endif |
5c23128d ZJS |
836 | conf.set('TIME_EPOCH', time_epoch) |
837 | ||
b10abe4b EI |
838 | conf.set('CLOCK_VALID_RANGE_USEC_MAX', get_option('clock-valid-range-usec-max')) |
839 | ||
53350c7b | 840 | default_user_shell = get_option('default-user-shell') |
841 | conf.set_quoted('DEFAULT_USER_SHELL', default_user_shell) | |
842 | conf.set_quoted('DEFAULT_USER_SHELL_NAME', fs.name(default_user_shell)) | |
843 | ||
fc1a5d1a ZJS |
844 | foreach tuple : [['system-alloc-uid-min', 'SYS_UID_MIN', 1], # Also see login.defs(5). |
845 | ['system-uid-max', 'SYS_UID_MAX', 999], | |
846 | ['system-alloc-gid-min', 'SYS_GID_MIN', 1], | |
847 | ['system-gid-max', 'SYS_GID_MAX', 999]] | |
848 | v = get_option(tuple[0]) | |
a36be3e5 | 849 | if v <= 0 |
fc1a5d1a ZJS |
850 | v = run_command( |
851 | awk, | |
852 | '/^\s*@0@\s+/ { uid=$2 } END { print uid }'.format(tuple[1]), | |
e92777d2 ZJS |
853 | '/etc/login.defs', |
854 | check : false).stdout().strip() | |
fc1a5d1a ZJS |
855 | if v == '' |
856 | v = tuple[2] | |
857 | else | |
858 | v = v.to_int() | |
859 | endif | |
2f62cf35 | 860 | endif |
fc1a5d1a | 861 | conf.set(tuple[0].underscorify().to_upper(), v) |
fc1a5d1a ZJS |
862 | endforeach |
863 | if conf.get('SYSTEM_ALLOC_UID_MIN') >= conf.get('SYSTEM_UID_MAX') | |
864 | error('Invalid uid allocation range') | |
5c23128d | 865 | endif |
fc1a5d1a ZJS |
866 | if conf.get('SYSTEM_ALLOC_GID_MIN') >= conf.get('SYSTEM_GID_MAX') |
867 | error('Invalid gid allocation range') | |
5c23128d | 868 | endif |
5c23128d | 869 | |
ac09340e YW |
870 | dynamic_uid_min = get_option('dynamic-uid-min') |
871 | dynamic_uid_max = get_option('dynamic-uid-max') | |
87d5e4f2 LP |
872 | conf.set('DYNAMIC_UID_MIN', dynamic_uid_min) |
873 | conf.set('DYNAMIC_UID_MAX', dynamic_uid_max) | |
87d5e4f2 | 874 | |
ac09340e YW |
875 | container_uid_base_min = get_option('container-uid-base-min') |
876 | container_uid_base_max = get_option('container-uid-base-max') | |
87d5e4f2 LP |
877 | conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min) |
878 | conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max) | |
87d5e4f2 | 879 | |
afde4574 LP |
880 | nobody_user = get_option('nobody-user') |
881 | nobody_group = get_option('nobody-group') | |
882 | ||
2484bff3 | 883 | if not meson.is_cross_build() |
e92777d2 | 884 | getent_result = run_command('getent', 'passwd', '65534', check : false) |
2484bff3 CQ |
885 | if getent_result.returncode() == 0 |
886 | name = getent_result.stdout().split(':')[0] | |
887 | if name != nobody_user | |
888 | warning('\n' + | |
889 | 'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) + | |
890 | 'Your build will result in an user table setup that is incompatible with the local system.') | |
891 | endif | |
afde4574 | 892 | endif |
e92777d2 | 893 | id_result = run_command('id', '-u', nobody_user, check : false) |
2484bff3 | 894 | if id_result.returncode() == 0 |
89cdbe1f | 895 | id = id_result.stdout().strip().to_int() |
2484bff3 CQ |
896 | if id != 65534 |
897 | warning('\n' + | |
898 | 'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) + | |
899 | 'Your build will result in an user table setup that is incompatible with the local system.') | |
900 | endif | |
afde4574 | 901 | endif |
afde4574 | 902 | |
e92777d2 | 903 | getent_result = run_command('getent', 'group', '65534', check : false) |
2484bff3 CQ |
904 | if getent_result.returncode() == 0 |
905 | name = getent_result.stdout().split(':')[0] | |
906 | if name != nobody_group | |
907 | warning('\n' + | |
908 | 'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) + | |
909 | 'Your build will result in an group table setup that is incompatible with the local system.') | |
910 | endif | |
afde4574 | 911 | endif |
e92777d2 | 912 | id_result = run_command('id', '-g', nobody_group, check : false) |
2484bff3 | 913 | if id_result.returncode() == 0 |
89cdbe1f | 914 | id = id_result.stdout().strip().to_int() |
2484bff3 CQ |
915 | if id != 65534 |
916 | warning('\n' + | |
d5b3e510 | 917 | 'The local group with the configured group name "@0@" of the nobody group does not have GID 65534 (it has @1@).\n'.format(nobody_group, id) + |
2484bff3 CQ |
918 | 'Your build will result in an group table setup that is incompatible with the local system.') |
919 | endif | |
afde4574 LP |
920 | endif |
921 | endif | |
8374cc62 | 922 | if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup') |
8ea9fad7 YW |
923 | warning('\n' + |
924 | 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) + | |
925 | 'Please re-check that both "nobody-user" and "nobody-group" options are correctly set.') | |
8374cc62 | 926 | endif |
afde4574 LP |
927 | |
928 | conf.set_quoted('NOBODY_USER_NAME', nobody_user) | |
929 | conf.set_quoted('NOBODY_GROUP_NAME', nobody_group) | |
87d5e4f2 | 930 | |
9a797ddc ZJS |
931 | static_ugids = [] |
932 | foreach option : ['adm-gid', | |
933 | 'audio-gid', | |
934 | 'cdrom-gid', | |
935 | 'dialout-gid', | |
936 | 'disk-gid', | |
937 | 'input-gid', | |
938 | 'kmem-gid', | |
939 | 'kvm-gid', | |
940 | 'lp-gid', | |
941 | 'render-gid', | |
942 | 'sgx-gid', | |
943 | 'tape-gid', | |
944 | 'tty-gid', | |
945 | 'users-gid', | |
946 | 'utmp-gid', | |
947 | 'video-gid', | |
948 | 'wheel-gid', | |
949 | 'systemd-journal-gid', | |
950 | 'systemd-network-uid', | |
951 | 'systemd-resolve-uid', | |
952 | 'systemd-timesync-uid'] | |
953 | name = option.underscorify().to_upper() | |
954 | val = get_option(option) | |
955 | ||
956 | # Ensure provided GID argument is numeric, otherwise fall back to default assignment | |
a36be3e5 YW |
957 | conf.set(name, val > 0 ? val : '-') |
958 | if val > 0 | |
9a797ddc ZJS |
959 | static_ugids += '@0@:@1@'.format(option, val) |
960 | endif | |
961 | endforeach | |
84786b8e | 962 | |
348b4437 YW |
963 | conf.set10('ENABLE_ADM_GROUP', get_option('adm-group')) |
964 | conf.set10('ENABLE_WHEEL_GROUP', get_option('wheel-group')) | |
5c23128d | 965 | |
ace5e311 | 966 | dev_kvm_mode = get_option('dev-kvm-mode') |
d924a938 | 967 | conf.set_quoted('DEV_KVM_MODE', dev_kvm_mode) # FIXME: convert to 0o… notation |
ace5e311 | 968 | conf.set10('DEV_KVM_UACCESS', dev_kvm_mode != '0666') |
055a083a | 969 | group_render_mode = get_option('group-render-mode') |
8feaea5e | 970 | conf.set_quoted('GROUP_RENDER_MODE', group_render_mode) |
055a083a | 971 | conf.set10('GROUP_RENDER_UACCESS', group_render_mode != '0666') |
5c23128d | 972 | |
2a4c156d ZJS |
973 | kill_user_processes = get_option('default-kill-user-processes') |
974 | conf.set10('KILL_USER_PROCESSES', kill_user_processes) | |
5c23128d | 975 | |
829257d1 ZJS |
976 | dns_servers = get_option('dns-servers') |
977 | conf.set_quoted('DNS_SERVERS', dns_servers) | |
5c23128d | 978 | |
829257d1 ZJS |
979 | ntp_servers = get_option('ntp-servers') |
980 | conf.set_quoted('NTP_SERVERS', ntp_servers) | |
5c23128d | 981 | |
8ca9e92c DR |
982 | default_locale = get_option('default-locale') |
983 | conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale) | |
984 | ||
a22f5186 DDM |
985 | nspawn_locale = get_option('nspawn-locale') |
986 | conf.set_quoted('SYSTEMD_NSPAWN_LOCALE', nspawn_locale) | |
987 | ||
f129d0e7 MY |
988 | default_keymap = get_option('default-keymap') |
989 | conf.set_quoted('SYSTEMD_DEFAULT_KEYMAP', default_keymap) | |
990 | ||
8f20232f | 991 | localegen_path = get_option('localegen-path') |
8f20232f MK |
992 | if localegen_path != '' |
993 | conf.set_quoted('LOCALEGEN_PATH', localegen_path) | |
8f20232f | 994 | endif |
71ae5ce5 | 995 | conf.set10('HAVE_LOCALEGEN', localegen_path != '') |
8f20232f | 996 | |
5c23128d ZJS |
997 | conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) |
998 | ||
21d0dd5a | 999 | service_watchdog = get_option('service-watchdog') |
7bc9ea51 | 1000 | watchdog_value = service_watchdog == '' ? '' : 'WatchdogSec=' + service_watchdog |
059cc610 | 1001 | conf.set_quoted('SERVICE_WATCHDOG', watchdog_value) |
21d0dd5a | 1002 | |
059cc610 | 1003 | conf.set_quoted('SUSHELL', get_option('debug-shell')) |
93912e87 | 1004 | conf.set_quoted('DEBUGTTY', get_option('debug-tty')) |
3131bfe3 | 1005 | |
349cc4a5 ZJS |
1006 | enable_debug_hashmap = false |
1007 | enable_debug_mmap_cache = false | |
d6601495 | 1008 | enable_debug_siphash = false |
8f6b442a | 1009 | foreach name : get_option('debug-extra') |
ad7aa760 YW |
1010 | if name == 'hashmap' |
1011 | enable_debug_hashmap = true | |
1012 | elif name == 'mmap-cache' | |
1013 | enable_debug_mmap_cache = true | |
d6601495 YW |
1014 | elif name == 'siphash' |
1015 | enable_debug_siphash = true | |
ad7aa760 YW |
1016 | else |
1017 | message('unknown debug option "@0@", ignoring'.format(name)) | |
1018 | endif | |
1019 | endforeach | |
349cc4a5 ZJS |
1020 | conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap) |
1021 | conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache) | |
d6601495 | 1022 | conf.set10('ENABLE_DEBUG_SIPHASH', enable_debug_siphash) |
fd5dec9a | 1023 | conf.set10('LOG_TRACE', get_option('log-trace')) |
d18cb393 | 1024 | |
3602ca6f ZJS |
1025 | default_user_path = get_option('user-path') |
1026 | if default_user_path != '' | |
1027 | conf.set_quoted('DEFAULT_USER_PATH', default_user_path) | |
1028 | endif | |
1029 | ||
5bc655cd | 1030 | |
5c23128d ZJS |
1031 | ##################################################################### |
1032 | ||
1033 | threads = dependency('threads') | |
1034 | librt = cc.find_library('rt') | |
1035 | libm = cc.find_library('m') | |
1036 | libdl = cc.find_library('dl') | |
1037 | libcrypt = cc.find_library('crypt') | |
1038 | ||
96f8c636 ZJS |
1039 | # On some architectures, libatomic is required. But on some installations, |
1040 | # it is found, but actual linking fails. So let's try to use it opportunistically. | |
1041 | # If it is installed, but not needed, it will be dropped because of --as-needed. | |
1042 | if cc.links('''int main(int argc, char **argv) { return 0; }''', | |
1043 | args : '-latomic', | |
1044 | name : 'libatomic') | |
1045 | libatomic = declare_dependency(link_args : '-latomic') | |
1046 | else | |
1047 | libatomic = [] | |
1048 | endif | |
1049 | ||
06ca077b | 1050 | crypt_header = conf.get('HAVE_CRYPT_H') == 1 ? '''#include <crypt.h>''' : '''#include <unistd.h>''' |
e8644a41 | 1051 | foreach ident : [ |
feee7f62 LB |
1052 | ['crypt_ra', crypt_header], |
1053 | ['crypt_preferred_method', crypt_header], | |
1054 | ['crypt_gensalt_ra', crypt_header]] | |
e8644a41 ZJS |
1055 | |
1056 | have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE', | |
1057 | dependencies : libcrypt) | |
1058 | conf.set10('HAVE_' + ident[0].to_upper(), have) | |
1059 | endforeach | |
1060 | ||
1800cc85 ZJS |
1061 | libcap = dependency('libcap', required : false) |
1062 | if not libcap.found() | |
1063 | # Compat with Ubuntu 14.04 which ships libcap w/o .pc file | |
1064 | libcap = cc.find_library('cap') | |
1065 | endif | |
1066 | ||
7d861e12 | 1067 | want_bpf_framework = get_option('bpf-framework') |
b88323e4 | 1068 | bpf_compiler = get_option('bpf-compiler') |
7d861e12 JK |
1069 | bpf_framework_required = want_bpf_framework == 'true' |
1070 | ||
87e462f7 | 1071 | libbpf_version_requirement = '>= 0.1.0' |
b88323e4 JH |
1072 | if bpf_compiler == 'gcc' |
1073 | libbpf_version_requirement = '>= 1.0.0' | |
1074 | endif | |
1075 | libbpf = dependency('libbpf', required : bpf_framework_required, version : libbpf_version_requirement) | |
7d861e12 JK |
1076 | conf.set10('HAVE_LIBBPF', libbpf.found()) |
1077 | ||
b88323e4 JH |
1078 | bpftool_strip_version_requirement = '>= 5.13.0' |
1079 | if bpf_compiler == 'gcc' | |
1080 | bpftool_strip_version_requirement = '>= 7.0.0' | |
1081 | endif | |
1082 | ||
3d954ef1 | 1083 | if want_bpf_framework == 'false' or not libbpf.found() or skip_deps |
cf2dc690 | 1084 | conf.set10('BPF_FRAMEWORK', false) |
7d861e12 | 1085 | else |
76abad4d JH |
1086 | clang_found = false |
1087 | clang_supports_bpf = false | |
1088 | bpf_gcc_found = false | |
b88323e4 | 1089 | bpftool_strip = false |
76abad4d JH |
1090 | deps_found = false |
1091 | ||
1092 | if bpf_compiler == 'clang' | |
1093 | # Support 'versioned' clang/llvm-strip binaries, as seen on Debian/Ubuntu | |
1094 | # (like clang-10/llvm-strip-10) | |
1095 | if meson.is_cross_build() or cc.get_id() != 'clang' or cc.cmd_array()[0].contains('afl-clang') or cc.cmd_array()[0].contains('hfuzz-clang') | |
1096 | r = find_program('clang', required : bpf_framework_required, version : '>= 10.0.0') | |
1097 | clang_found = r.found() | |
1098 | if clang_found | |
1099 | clang = r.path() | |
1100 | endif | |
76abad4d JH |
1101 | else |
1102 | clang_found = true | |
1103 | clang = cc.cmd_array() | |
dc7e9c1b | 1104 | endif |
a6ac8b5a | 1105 | |
76abad4d JH |
1106 | if clang_found |
1107 | # Check if 'clang -target bpf' is supported. | |
1108 | clang_supports_bpf = run_command(clang, '-target', 'bpf', '--print-supported-cpus', check : false).returncode() == 0 | |
1109 | endif | |
1110 | elif bpf_compiler == 'gcc' | |
1111 | warning('GCC BPF Compiler support is experimental and not recommended.') | |
1112 | bpf_gcc = find_program('bpf-gcc', | |
1113 | required : true, | |
1114 | version : '>= 12.1.0') | |
1115 | bpf_gcc_found = bpf_gcc.found() | |
a6ac8b5a YW |
1116 | endif |
1117 | ||
76abad4d JH |
1118 | if clang_supports_bpf or bpf_gcc_found |
1119 | # Debian installs this in /usr/sbin/ which is not in $PATH. | |
1120 | # We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian. | |
1121 | # We use 'bpftool gen object' subcommand for bpftool strip, it was added by d80b2fcbe0a023619e0fc73112f2a02c2662f6ab (v5.13). | |
b88323e4 | 1122 | bpftool_strip_required = bpf_framework_required and bpf_compiler == 'gcc' |
e3759ac4 JH |
1123 | bpftool = find_program('bpftool', |
1124 | '/usr/sbin/bpftool', | |
b88323e4 JH |
1125 | required : bpftool_strip_required, |
1126 | version : bpftool_strip_version_requirement) | |
e3759ac4 | 1127 | |
76abad4d JH |
1128 | if bpftool.found() |
1129 | bpftool_strip = true | |
1130 | deps_found = true | |
b88323e4 | 1131 | elif bpf_compiler == 'clang' |
76abad4d JH |
1132 | # We require the 'bpftool gen skeleton' subcommand, it was added by 985ead416df39d6fe8e89580cc1db6aa273e0175 (v5.6). |
1133 | bpftool = find_program('bpftool', | |
1134 | '/usr/sbin/bpftool', | |
1135 | required : bpf_framework_required, | |
1136 | version : '>= 5.6.0') | |
e3759ac4 | 1137 | endif |
68e101da | 1138 | |
76abad4d JH |
1139 | # We use `llvm-strip` as a fallback if `bpftool gen object` strip support is not available. |
1140 | if not bpftool_strip and bpftool.found() and clang_supports_bpf | |
1141 | if not meson.is_cross_build() | |
1142 | llvm_strip_bin = run_command(clang, '--print-prog-name', 'llvm-strip', | |
1143 | check : true).stdout().strip() | |
1144 | else | |
1145 | llvm_strip_bin = 'llvm-strip' | |
1146 | endif | |
1147 | llvm_strip = find_program(llvm_strip_bin, required : bpf_framework_required, version : '>= 10.0.0') | |
1148 | deps_found = llvm_strip.found() | |
1149 | endif | |
1150 | endif | |
68e101da | 1151 | |
7d861e12 | 1152 | # Can build BPF program from source code in restricted C |
d40ce018 | 1153 | conf.set10('BPF_FRAMEWORK', deps_found) |
7d861e12 JK |
1154 | endif |
1155 | ||
5c23128d | 1156 | libmount = dependency('mount', |
c0b4b0f8 | 1157 | version : fuzzer_build ? '>= 0' : '>= 2.30') |
5c23128d | 1158 | |
e594a3b1 LP |
1159 | want_libfdisk = get_option('fdisk') |
1160 | if want_libfdisk != 'false' and not skip_deps | |
1161 | libfdisk = dependency('fdisk', | |
baec7d78 | 1162 | version : '>= 2.32', |
e594a3b1 LP |
1163 | required : want_libfdisk == 'true') |
1164 | have = libfdisk.found() | |
1165 | else | |
1166 | have = false | |
1167 | libfdisk = [] | |
1168 | endif | |
1169 | conf.set10('HAVE_LIBFDISK', have) | |
1170 | ||
70a5db58 LP |
1171 | want_pwquality = get_option('pwquality') |
1172 | if want_pwquality != 'false' and not skip_deps | |
1173 | libpwquality = dependency('pwquality', required : want_pwquality == 'true') | |
1174 | have = libpwquality.found() | |
1175 | else | |
1176 | have = false | |
1177 | libpwquality = [] | |
1178 | endif | |
1179 | conf.set10('HAVE_PWQUALITY', have) | |
1180 | ||
5c23128d | 1181 | want_seccomp = get_option('seccomp') |
87ac55a1 | 1182 | if want_seccomp != 'false' and not skip_deps |
37efbbd8 | 1183 | libseccomp = dependency('libseccomp', |
9f0e9c01 | 1184 | version : '>= 2.3.1', |
37efbbd8 | 1185 | required : want_seccomp == 'true') |
349cc4a5 | 1186 | have = libseccomp.found() |
5c23128d | 1187 | else |
349cc4a5 | 1188 | have = false |
37efbbd8 | 1189 | libseccomp = [] |
5c23128d | 1190 | endif |
349cc4a5 | 1191 | conf.set10('HAVE_SECCOMP', have) |
5c23128d ZJS |
1192 | |
1193 | want_selinux = get_option('selinux') | |
87ac55a1 | 1194 | if want_selinux != 'false' and not skip_deps |
37efbbd8 ZJS |
1195 | libselinux = dependency('libselinux', |
1196 | version : '>= 2.1.9', | |
1197 | required : want_selinux == 'true') | |
349cc4a5 | 1198 | have = libselinux.found() |
5c23128d | 1199 | else |
349cc4a5 | 1200 | have = false |
37efbbd8 | 1201 | libselinux = [] |
5c23128d | 1202 | endif |
349cc4a5 | 1203 | conf.set10('HAVE_SELINUX', have) |
5c23128d ZJS |
1204 | |
1205 | want_apparmor = get_option('apparmor') | |
87ac55a1 | 1206 | if want_apparmor != 'false' and not skip_deps |
37efbbd8 | 1207 | libapparmor = dependency('libapparmor', |
2ffadd3c | 1208 | version : '>= 2.13', |
37efbbd8 | 1209 | required : want_apparmor == 'true') |
349cc4a5 | 1210 | have = libapparmor.found() |
5c23128d | 1211 | else |
349cc4a5 | 1212 | have = false |
37efbbd8 | 1213 | libapparmor = [] |
5c23128d | 1214 | endif |
349cc4a5 | 1215 | conf.set10('HAVE_APPARMOR', have) |
5c23128d | 1216 | |
07b382cc ZJS |
1217 | have = get_option('smack') and get_option('smack-run-label') != '' |
1218 | conf.set10('HAVE_SMACK_RUN_LABEL', have) | |
1219 | if have | |
1220 | conf.set_quoted('SMACK_RUN_LABEL', get_option('smack-run-label')) | |
1221 | endif | |
5c23128d | 1222 | |
aa5ae971 ŁS |
1223 | have = get_option('smack') and get_option('smack-default-process-label') != '' |
1224 | if have | |
1225 | conf.set_quoted('SMACK_DEFAULT_PROCESS_LABEL', get_option('smack-default-process-label')) | |
1226 | endif | |
1227 | ||
3ca0cb73 ZJS |
1228 | want_polkit = get_option('polkit') |
1229 | install_polkit = false | |
1230 | install_polkit_pkla = false | |
87ac55a1 | 1231 | if want_polkit != 'false' and not skip_deps |
37efbbd8 | 1232 | install_polkit = true |
3ca0cb73 | 1233 | |
37efbbd8 ZJS |
1234 | libpolkit = dependency('polkit-gobject-1', |
1235 | required : false) | |
1236 | if libpolkit.found() and libpolkit.version().version_compare('< 0.106') | |
1237 | message('Old polkit detected, will install pkla files') | |
1238 | install_polkit_pkla = true | |
1239 | endif | |
3ca0cb73 | 1240 | endif |
349cc4a5 | 1241 | conf.set10('ENABLE_POLKIT', install_polkit) |
3ca0cb73 | 1242 | |
36f0387e | 1243 | want_acl = get_option('acl') |
87ac55a1 | 1244 | if want_acl != 'false' and not skip_deps |
36f0387e | 1245 | libacl = cc.find_library('acl', required : want_acl == 'true') |
349cc4a5 | 1246 | have = libacl.found() |
36f0387e | 1247 | else |
349cc4a5 | 1248 | have = false |
36f0387e ZJS |
1249 | libacl = [] |
1250 | endif | |
349cc4a5 | 1251 | conf.set10('HAVE_ACL', have) |
36f0387e | 1252 | |
5c23128d | 1253 | want_audit = get_option('audit') |
87ac55a1 | 1254 | if want_audit != 'false' and not skip_deps |
37efbbd8 | 1255 | libaudit = dependency('audit', required : want_audit == 'true') |
349cc4a5 | 1256 | have = libaudit.found() |
5c23128d | 1257 | else |
349cc4a5 | 1258 | have = false |
37efbbd8 | 1259 | libaudit = [] |
5c23128d | 1260 | endif |
349cc4a5 | 1261 | conf.set10('HAVE_AUDIT', have) |
5c23128d ZJS |
1262 | |
1263 | want_blkid = get_option('blkid') | |
87ac55a1 | 1264 | if want_blkid != 'false' and not skip_deps |
37efbbd8 | 1265 | libblkid = dependency('blkid', required : want_blkid == 'true') |
349cc4a5 | 1266 | have = libblkid.found() |
4fcc033b KZ |
1267 | |
1268 | conf.set10('HAVE_BLKID_PROBE_SET_HINT', | |
1269 | have and cc.has_function('blkid_probe_set_hint', dependencies : libblkid)) | |
5c23128d | 1270 | else |
349cc4a5 | 1271 | have = false |
37efbbd8 | 1272 | libblkid = [] |
5c23128d | 1273 | endif |
349cc4a5 | 1274 | conf.set10('HAVE_BLKID', have) |
5c23128d ZJS |
1275 | |
1276 | want_kmod = get_option('kmod') | |
87ac55a1 | 1277 | if want_kmod != 'false' and not skip_deps |
37efbbd8 ZJS |
1278 | libkmod = dependency('libkmod', |
1279 | version : '>= 15', | |
1280 | required : want_kmod == 'true') | |
349cc4a5 | 1281 | have = libkmod.found() |
5c23128d | 1282 | else |
349cc4a5 | 1283 | have = false |
37efbbd8 | 1284 | libkmod = [] |
5c23128d | 1285 | endif |
349cc4a5 | 1286 | conf.set10('HAVE_KMOD', have) |
5c23128d | 1287 | |
ede5a78f ST |
1288 | want_xenctrl = get_option('xenctrl') |
1289 | if want_xenctrl != 'false' and not skip_deps | |
1290 | libxenctrl = dependency('xencontrol', | |
1291 | version : '>= 4.9', | |
1292 | required : want_xenctrl == 'true') | |
1293 | have = libxenctrl.found() | |
1294 | else | |
1295 | have = false | |
1296 | libxenctrl = [] | |
1297 | endif | |
1298 | conf.set10('HAVE_XENCTRL', have) | |
1299 | ||
5c23128d | 1300 | want_pam = get_option('pam') |
87ac55a1 | 1301 | if want_pam != 'false' and not skip_deps |
37efbbd8 ZJS |
1302 | libpam = cc.find_library('pam', required : want_pam == 'true') |
1303 | libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true') | |
349cc4a5 | 1304 | have = libpam.found() and libpam_misc.found() |
5c23128d | 1305 | else |
349cc4a5 | 1306 | have = false |
37efbbd8 ZJS |
1307 | libpam = [] |
1308 | libpam_misc = [] | |
5c23128d | 1309 | endif |
349cc4a5 | 1310 | conf.set10('HAVE_PAM', have) |
5c23128d ZJS |
1311 | |
1312 | want_microhttpd = get_option('microhttpd') | |
87ac55a1 | 1313 | if want_microhttpd != 'false' and not skip_deps |
37efbbd8 ZJS |
1314 | libmicrohttpd = dependency('libmicrohttpd', |
1315 | version : '>= 0.9.33', | |
1316 | required : want_microhttpd == 'true') | |
349cc4a5 | 1317 | have = libmicrohttpd.found() |
5c23128d | 1318 | else |
349cc4a5 | 1319 | have = false |
37efbbd8 | 1320 | libmicrohttpd = [] |
5c23128d | 1321 | endif |
349cc4a5 | 1322 | conf.set10('HAVE_MICROHTTPD', have) |
5c23128d ZJS |
1323 | |
1324 | want_libcryptsetup = get_option('libcryptsetup') | |
d1ae38d8 OK |
1325 | want_libcryptsetup_plugins = get_option('libcryptsetup-plugins') |
1326 | ||
1327 | if want_libcryptsetup_plugins == 'true' and want_libcryptsetup == 'false' | |
1328 | error('libcryptsetup-plugins can not be requested without libcryptsetup') | |
1329 | endif | |
1330 | ||
87ac55a1 | 1331 | if want_libcryptsetup != 'false' and not skip_deps |
37efbbd8 | 1332 | libcryptsetup = dependency('libcryptsetup', |
d1ae38d8 OK |
1333 | version : want_libcryptsetup_plugins == 'true' ? '>= 2.4.0' : '>= 2.0.1', |
1334 | required : want_libcryptsetup == 'true' or want_libcryptsetup_plugins == 'true') | |
349cc4a5 | 1335 | have = libcryptsetup.found() |
70a5db58 | 1336 | |
aac80717 ZJS |
1337 | foreach ident : ['crypt_set_metadata_size', |
1338 | 'crypt_activate_by_signed_key', | |
48a09a8f DDM |
1339 | 'crypt_token_max', |
1340 | 'crypt_reencrypt_init_by_passphrase', | |
1341 | 'crypt_reencrypt', | |
1342 | 'crypt_set_data_offset'] | |
aac80717 ZJS |
1343 | have_ident = have and cc.has_function( |
1344 | ident, | |
1345 | prefix : '#include <libcryptsetup.h>', | |
1346 | dependencies : libcryptsetup) | |
1347 | conf.set10('HAVE_' + ident.to_upper(), have_ident) | |
1348 | endforeach | |
5c23128d | 1349 | else |
349cc4a5 | 1350 | have = false |
37efbbd8 | 1351 | libcryptsetup = [] |
5c23128d | 1352 | endif |
349cc4a5 | 1353 | conf.set10('HAVE_LIBCRYPTSETUP', have) |
5c23128d | 1354 | |
d1ae38d8 | 1355 | if want_libcryptsetup_plugins != 'false' and not skip_deps |
aac80717 ZJS |
1356 | have = (cc.has_function( |
1357 | 'crypt_activate_by_token_pin', | |
1358 | prefix : '#include <libcryptsetup.h>', | |
1359 | dependencies : libcryptsetup) and | |
1360 | cc.has_function( | |
1361 | 'crypt_token_external_path', | |
1362 | prefix : '#include <libcryptsetup.h>', | |
1363 | dependencies : libcryptsetup)) | |
d1ae38d8 OK |
1364 | else |
1365 | have = false | |
1366 | endif | |
1367 | conf.set10('HAVE_LIBCRYPTSETUP_PLUGINS', have) | |
1368 | ||
5c23128d | 1369 | want_libcurl = get_option('libcurl') |
87ac55a1 | 1370 | if want_libcurl != 'false' and not skip_deps |
37efbbd8 ZJS |
1371 | libcurl = dependency('libcurl', |
1372 | version : '>= 7.32.0', | |
1373 | required : want_libcurl == 'true') | |
349cc4a5 | 1374 | have = libcurl.found() |
5c23128d | 1375 | else |
349cc4a5 | 1376 | have = false |
37efbbd8 | 1377 | libcurl = [] |
5c23128d | 1378 | endif |
349cc4a5 | 1379 | conf.set10('HAVE_LIBCURL', have) |
47350c5f | 1380 | conf.set10('CURL_NO_OLDIES', conf.get('BUILD_MODE_DEVELOPER') == 1) |
5c23128d ZJS |
1381 | |
1382 | want_libidn = get_option('libidn') | |
87057e24 ZJS |
1383 | want_libidn2 = get_option('libidn2') |
1384 | if want_libidn == 'true' and want_libidn2 == 'true' | |
1385 | error('libidn and libidn2 cannot be requested simultaneously') | |
1386 | endif | |
1387 | ||
1b931399 YW |
1388 | if want_libidn2 != 'false' and want_libidn != 'true' and not skip_deps |
1389 | libidn = dependency('libidn2', | |
1390 | required : want_libidn2 == 'true') | |
349cc4a5 | 1391 | have = libidn.found() |
87057e24 | 1392 | else |
349cc4a5 | 1393 | have = false |
87057e24 ZJS |
1394 | libidn = [] |
1395 | endif | |
1b931399 YW |
1396 | conf.set10('HAVE_LIBIDN2', have) |
1397 | if not have and want_libidn != 'false' and not skip_deps | |
7f7ab228 | 1398 | # libidn is used for both libidn and libidn2 objects |
1b931399 YW |
1399 | libidn = dependency('libidn', |
1400 | required : want_libidn == 'true') | |
349cc4a5 ZJS |
1401 | have = libidn.found() |
1402 | else | |
1403 | have = false | |
5c23128d | 1404 | endif |
1b931399 | 1405 | conf.set10('HAVE_LIBIDN', have) |
5c23128d ZJS |
1406 | |
1407 | want_libiptc = get_option('libiptc') | |
87ac55a1 | 1408 | if want_libiptc != 'false' and not skip_deps |
37efbbd8 ZJS |
1409 | libiptc = dependency('libiptc', |
1410 | required : want_libiptc == 'true') | |
349cc4a5 | 1411 | have = libiptc.found() |
5c23128d | 1412 | else |
349cc4a5 | 1413 | have = false |
37efbbd8 | 1414 | libiptc = [] |
5c23128d | 1415 | endif |
349cc4a5 | 1416 | conf.set10('HAVE_LIBIPTC', have) |
5c23128d ZJS |
1417 | |
1418 | want_qrencode = get_option('qrencode') | |
87ac55a1 | 1419 | if want_qrencode != 'false' and not skip_deps |
37efbbd8 | 1420 | libqrencode = dependency('libqrencode', |
3f5225d7 | 1421 | version : '>= 3', |
37efbbd8 | 1422 | required : want_qrencode == 'true') |
349cc4a5 | 1423 | have = libqrencode.found() |
5c23128d | 1424 | else |
349cc4a5 | 1425 | have = false |
37efbbd8 | 1426 | libqrencode = [] |
5c23128d | 1427 | endif |
349cc4a5 | 1428 | conf.set10('HAVE_QRENCODE', have) |
5c23128d | 1429 | |
a44fb601 | 1430 | want_gcrypt = get_option('gcrypt') |
87ac55a1 | 1431 | if want_gcrypt != 'false' and not skip_deps |
a44fb601 ZJS |
1432 | libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true') |
1433 | libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true') | |
349cc4a5 | 1434 | have = libgcrypt.found() and libgpg_error.found() |
a44fb601 | 1435 | else |
349cc4a5 ZJS |
1436 | have = false |
1437 | endif | |
1438 | if not have | |
1439 | # link to neither of the libs if one is not found | |
a44fb601 ZJS |
1440 | libgcrypt = [] |
1441 | libgpg_error = [] | |
1442 | endif | |
349cc4a5 | 1443 | conf.set10('HAVE_GCRYPT', have) |
a44fb601 | 1444 | |
5c23128d | 1445 | want_gnutls = get_option('gnutls') |
87ac55a1 | 1446 | if want_gnutls != 'false' and not skip_deps |
37efbbd8 ZJS |
1447 | libgnutls = dependency('gnutls', |
1448 | version : '>= 3.1.4', | |
1449 | required : want_gnutls == 'true') | |
349cc4a5 | 1450 | have = libgnutls.found() |
5c23128d | 1451 | else |
349cc4a5 | 1452 | have = false |
37efbbd8 | 1453 | libgnutls = [] |
5c23128d | 1454 | endif |
349cc4a5 | 1455 | conf.set10('HAVE_GNUTLS', have) |
5c23128d | 1456 | |
096cbdce | 1457 | want_openssl = get_option('openssl') |
87ac55a1 | 1458 | if want_openssl != 'false' and not skip_deps |
096cbdce IT |
1459 | libopenssl = dependency('openssl', |
1460 | version : '>= 1.1.0', | |
1461 | required : want_openssl == 'true') | |
1462 | have = libopenssl.found() | |
1463 | else | |
1464 | have = false | |
1465 | libopenssl = [] | |
1466 | endif | |
1467 | conf.set10('HAVE_OPENSSL', have) | |
1468 | ||
839fddbe LP |
1469 | want_p11kit = get_option('p11kit') |
1470 | if want_p11kit != 'false' and not skip_deps | |
1471 | libp11kit = dependency('p11-kit-1', | |
6164ec4c ZJS |
1472 | version : '>= 0.23.3', |
1473 | required : want_p11kit == 'true') | |
839fddbe | 1474 | have = libp11kit.found() |
da035a3a | 1475 | libp11kit_cflags = libp11kit.partial_dependency(includes: true, compile_args: true) |
839fddbe LP |
1476 | else |
1477 | have = false | |
da035a3a | 1478 | libp11kit_cflags = [] |
839fddbe LP |
1479 | libp11kit = [] |
1480 | endif | |
1481 | conf.set10('HAVE_P11KIT', have) | |
1482 | ||
af4fbd46 LP |
1483 | want_libfido2 = get_option('libfido2') |
1484 | if want_libfido2 != 'false' and not skip_deps | |
e0f435f9 YW |
1485 | if conf.get('HAVE_OPENSSL') == 1 |
1486 | libfido2 = dependency('libfido2', | |
1487 | required : want_libfido2 == 'true') | |
1488 | have = libfido2.found() | |
1489 | elif want_libfido2 == 'true' | |
1490 | error('libfido2=true requires openssl') | |
1491 | else | |
1492 | have = false | |
1493 | libfido2 = [] | |
1494 | endif | |
af4fbd46 LP |
1495 | else |
1496 | have = false | |
1497 | libfido2 = [] | |
1498 | endif | |
1499 | conf.set10('HAVE_LIBFIDO2', have) | |
1500 | ||
5e521624 LP |
1501 | want_tpm2 = get_option('tpm2') |
1502 | if want_tpm2 != 'false' and not skip_deps | |
1503 | tpm2 = dependency('tss2-esys tss2-rc tss2-mu', | |
ba081955 | 1504 | required : want_tpm2 == 'true') |
5e521624 | 1505 | have = tpm2.found() |
155c5129 | 1506 | have_esys3 = tpm2.version().version_compare('>= 3.0.0') |
5e521624 LP |
1507 | else |
1508 | have = false | |
155c5129 | 1509 | have_esys3 = false |
5e521624 LP |
1510 | tpm2 = [] |
1511 | endif | |
1512 | conf.set10('HAVE_TPM2', have) | |
155c5129 | 1513 | conf.set10('HAVE_TSS2_ESYS3', have_esys3) |
5e521624 | 1514 | |
5c23128d | 1515 | want_elfutils = get_option('elfutils') |
87ac55a1 | 1516 | if want_elfutils != 'false' and not skip_deps |
37efbbd8 ZJS |
1517 | libdw = dependency('libdw', |
1518 | required : want_elfutils == 'true') | |
349cc4a5 | 1519 | have = libdw.found() |
d48c2721 LB |
1520 | |
1521 | # New in elfutils 0.177 | |
1522 | conf.set10('HAVE_DWELF_ELF_E_MACHINE_STRING', | |
1523 | have and cc.has_function('dwelf_elf_e_machine_string', dependencies : libdw)) | |
5c23128d | 1524 | else |
349cc4a5 | 1525 | have = false |
37efbbd8 | 1526 | libdw = [] |
5c23128d | 1527 | endif |
349cc4a5 | 1528 | conf.set10('HAVE_ELFUTILS', have) |
5c23128d ZJS |
1529 | |
1530 | want_zlib = get_option('zlib') | |
87ac55a1 | 1531 | if want_zlib != 'false' and not skip_deps |
37efbbd8 ZJS |
1532 | libz = dependency('zlib', |
1533 | required : want_zlib == 'true') | |
349cc4a5 | 1534 | have = libz.found() |
5c23128d | 1535 | else |
349cc4a5 | 1536 | have = false |
37efbbd8 | 1537 | libz = [] |
5c23128d | 1538 | endif |
349cc4a5 | 1539 | conf.set10('HAVE_ZLIB', have) |
5c23128d ZJS |
1540 | |
1541 | want_bzip2 = get_option('bzip2') | |
87ac55a1 | 1542 | if want_bzip2 != 'false' and not skip_deps |
37efbbd8 ZJS |
1543 | libbzip2 = cc.find_library('bz2', |
1544 | required : want_bzip2 == 'true') | |
349cc4a5 | 1545 | have = libbzip2.found() |
5c23128d | 1546 | else |
349cc4a5 | 1547 | have = false |
37efbbd8 | 1548 | libbzip2 = [] |
5c23128d | 1549 | endif |
349cc4a5 | 1550 | conf.set10('HAVE_BZIP2', have) |
5c23128d ZJS |
1551 | |
1552 | want_xz = get_option('xz') | |
87ac55a1 | 1553 | if want_xz != 'false' and not skip_deps |
37efbbd8 ZJS |
1554 | libxz = dependency('liblzma', |
1555 | required : want_xz == 'true') | |
d80b051c | 1556 | have_xz = libxz.found() |
5c23128d | 1557 | else |
d80b051c | 1558 | have_xz = false |
37efbbd8 | 1559 | libxz = [] |
5c23128d | 1560 | endif |
d80b051c | 1561 | conf.set10('HAVE_XZ', have_xz) |
5c23128d ZJS |
1562 | |
1563 | want_lz4 = get_option('lz4') | |
87ac55a1 | 1564 | if want_lz4 != 'false' and not skip_deps |
37efbbd8 | 1565 | liblz4 = dependency('liblz4', |
e0a1d4b0 | 1566 | version : '>= 1.3.0', |
37efbbd8 | 1567 | required : want_lz4 == 'true') |
d80b051c | 1568 | have_lz4 = liblz4.found() |
5c23128d | 1569 | else |
d80b051c | 1570 | have_lz4 = false |
37efbbd8 | 1571 | liblz4 = [] |
5c23128d | 1572 | endif |
d80b051c | 1573 | conf.set10('HAVE_LZ4', have_lz4) |
5c23128d | 1574 | |
ef5924aa NL |
1575 | want_zstd = get_option('zstd') |
1576 | if want_zstd != 'false' and not skip_deps | |
1577 | libzstd = dependency('libzstd', | |
1578 | required : want_zstd == 'true', | |
1579 | version : '>= 1.4.0') | |
d80b051c | 1580 | have_zstd = libzstd.found() |
ef5924aa | 1581 | else |
d80b051c | 1582 | have_zstd = false |
ef5924aa NL |
1583 | libzstd = [] |
1584 | endif | |
d80b051c LP |
1585 | conf.set10('HAVE_ZSTD', have_zstd) |
1586 | ||
1587 | conf.set10('HAVE_COMPRESSION', have_xz or have_lz4 or have_zstd) | |
ef5924aa | 1588 | |
cd3c6322 LB |
1589 | compression = get_option('default-compression') |
1590 | if compression == 'auto' | |
1591 | if have_zstd | |
1592 | compression = 'zstd' | |
1593 | elif have_lz4 | |
1594 | compression = 'lz4' | |
1595 | elif have_xz | |
1596 | compression = 'xz' | |
1597 | else | |
1598 | compression = 'none' | |
1599 | endif | |
1600 | elif compression == 'zstd' and not have_zstd | |
1601 | error('default-compression=zstd requires zstd') | |
1602 | elif compression == 'lz4' and not have_lz4 | |
1603 | error('default-compression=lz4 requires lz4') | |
1604 | elif compression == 'xz' and not have_xz | |
1605 | error('default-compression=xz requires xz') | |
1606 | endif | |
1788c6f3 | 1607 | conf.set('DEFAULT_COMPRESSION', 'COMPRESSION_@0@'.format(compression.to_upper())) |
cd3c6322 | 1608 | |
a44fb601 | 1609 | want_xkbcommon = get_option('xkbcommon') |
87ac55a1 | 1610 | if want_xkbcommon != 'false' and not skip_deps |
a44fb601 ZJS |
1611 | libxkbcommon = dependency('xkbcommon', |
1612 | version : '>= 0.3.0', | |
1613 | required : want_xkbcommon == 'true') | |
349cc4a5 | 1614 | have = libxkbcommon.found() |
a44fb601 | 1615 | else |
349cc4a5 | 1616 | have = false |
a44fb601 ZJS |
1617 | libxkbcommon = [] |
1618 | endif | |
349cc4a5 | 1619 | conf.set10('HAVE_XKBCOMMON', have) |
a44fb601 | 1620 | |
c4c978a0 | 1621 | want_pcre2 = get_option('pcre2') |
8739f309 | 1622 | if want_pcre2 != 'false' and not skip_deps |
c4c978a0 ZJS |
1623 | libpcre2 = dependency('libpcre2-8', |
1624 | required : want_pcre2 == 'true') | |
1625 | have = libpcre2.found() | |
1626 | else | |
1627 | have = false | |
1628 | libpcre2 = [] | |
1629 | endif | |
1630 | conf.set10('HAVE_PCRE2', have) | |
1631 | ||
69e96427 | 1632 | want_glib = get_option('glib') |
87ac55a1 | 1633 | if want_glib != 'false' and not skip_deps |
37efbbd8 ZJS |
1634 | libglib = dependency('glib-2.0', |
1635 | version : '>= 2.22.0', | |
1636 | required : want_glib == 'true') | |
1637 | libgobject = dependency('gobject-2.0', | |
1638 | version : '>= 2.22.0', | |
1639 | required : want_glib == 'true') | |
1640 | libgio = dependency('gio-2.0', | |
1641 | required : want_glib == 'true') | |
2c201c21 | 1642 | have = libglib.found() and libgobject.found() and libgio.found() |
69e96427 | 1643 | else |
349cc4a5 | 1644 | have = false |
37efbbd8 ZJS |
1645 | libglib = [] |
1646 | libgobject = [] | |
1647 | libgio = [] | |
69e96427 | 1648 | endif |
349cc4a5 | 1649 | conf.set10('HAVE_GLIB', have) |
69e96427 ZJS |
1650 | |
1651 | want_dbus = get_option('dbus') | |
87ac55a1 | 1652 | if want_dbus != 'false' and not skip_deps |
37efbbd8 ZJS |
1653 | libdbus = dependency('dbus-1', |
1654 | version : '>= 1.3.2', | |
1655 | required : want_dbus == 'true') | |
349cc4a5 | 1656 | have = libdbus.found() |
69e96427 | 1657 | else |
349cc4a5 | 1658 | have = false |
37efbbd8 | 1659 | libdbus = [] |
69e96427 | 1660 | endif |
349cc4a5 | 1661 | conf.set10('HAVE_DBUS', have) |
69e96427 | 1662 | |
1bd0cc45 YW |
1663 | dbusdatadir = datadir / 'dbus-1' |
1664 | if conf.get('HAVE_DBUS') == 1 | |
1665 | dbusdatadir = libdbus.get_variable(pkgconfig: 'datadir', default_value: datadir) / 'dbus-1' | |
1666 | endif | |
1667 | ||
1668 | dbuspolicydir = get_option('dbuspolicydir') | |
1669 | if dbuspolicydir == '' | |
1670 | dbuspolicydir = dbusdatadir / 'system.d' | |
1671 | endif | |
1672 | ||
1673 | dbussessionservicedir = get_option('dbussessionservicedir') | |
1674 | if dbussessionservicedir == '' | |
1675 | dbussessionservicedir = dbusdatadir / 'services' | |
1676 | if conf.get('HAVE_DBUS') == 1 | |
1677 | dbussessionservicedir = libdbus.get_variable(pkgconfig: 'session_bus_services_dir', default_value: dbussessionservicedir) | |
1678 | endif | |
1679 | endif | |
1680 | ||
1681 | dbussystemservicedir = get_option('dbussystemservicedir') | |
1682 | if dbussystemservicedir == '' | |
1683 | dbussystemservicedir = dbusdatadir / 'system-services' | |
1684 | if conf.get('HAVE_DBUS') == 1 | |
1685 | dbussystemservicedir = libdbus.get_variable(pkgconfig: 'system_bus_services_dir', default_value: dbussystemservicedir) | |
1686 | endif | |
1687 | endif | |
1688 | ||
1689 | dbus_interfaces_dir = get_option('dbus-interfaces-dir') | |
1690 | if dbus_interfaces_dir == '' or dbus_interfaces_dir == 'yes' | |
1691 | if meson.is_cross_build() and dbus_interfaces_dir != 'yes' | |
1692 | dbus_interfaces_dir = 'no' | |
1693 | warning('Exporting D-Bus interface XML files is disabled during cross build. Pass path or "yes" to force enable.') | |
1694 | else | |
1695 | dbus_interfaces_dir = dbusdatadir / 'interfaces' | |
1696 | if conf.get('HAVE_DBUS') == 1 | |
1697 | dbus_interfaces_dir = libdbus.get_variable(pkgconfig: 'interfaces_dir', default_value: dbus_interfaces_dir) | |
1698 | endif | |
1699 | endif | |
1700 | endif | |
1bd0cc45 | 1701 | |
e37ad765 ZJS |
1702 | # We support one or the other. If gcrypt is available, we assume it's there to |
1703 | # be used, and use it in preference. | |
1704 | opt = get_option('cryptolib') | |
1705 | if opt == 'openssl' and conf.get('HAVE_OPENSSL') == 0 | |
1706 | error('openssl requested as the default cryptolib, but not available') | |
1707 | endif | |
1708 | conf.set10('PREFER_OPENSSL', | |
1709 | opt == 'openssl' or (opt == 'auto' and conf.get('HAVE_OPENSSL') == 1 and conf.get('HAVE_GCRYPT') == 0)) | |
1710 | conf.set10('HAVE_OPENSSL_OR_GCRYPT', | |
1711 | conf.get('HAVE_OPENSSL') == 1 or conf.get('HAVE_GCRYPT') == 1) | |
9bcf483b | 1712 | lib_openssl_or_gcrypt = conf.get('PREFER_OPENSSL') == 1 ? [libopenssl] : [libgcrypt, libgpg_error] |
42303dcb | 1713 | |
56ddbf10 YW |
1714 | dns_over_tls = get_option('dns-over-tls') |
1715 | if dns_over_tls != 'false' | |
e37ad765 ZJS |
1716 | if dns_over_tls == 'gnutls' and conf.get('PREFER_OPENSSL') == 1 |
1717 | error('Sorry, -Ddns-over-tls=gnutls is not supported when openssl is used as the cryptolib') | |
1718 | endif | |
1719 | ||
1f9aa3d2 LB |
1720 | if dns_over_tls == 'gnutls' |
1721 | have_openssl = false | |
096cbdce | 1722 | else |
1f9aa3d2 LB |
1723 | have_openssl = conf.get('HAVE_OPENSSL') == 1 |
1724 | if dns_over_tls == 'openssl' and not have_openssl | |
1725 | error('DNS-over-TLS support was requested with openssl, but dependencies are not available') | |
096cbdce | 1726 | endif |
56ddbf10 | 1727 | endif |
1f9aa3d2 LB |
1728 | if dns_over_tls == 'openssl' or have_openssl |
1729 | have_gnutls = false | |
096cbdce | 1730 | else |
1f9aa3d2 LB |
1731 | have_gnutls = conf.get('HAVE_GNUTLS') == 1 and libgnutls.version().version_compare('>= 3.6.0') |
1732 | if dns_over_tls != 'auto' and not have_gnutls | |
1733 | str = dns_over_tls == 'gnutls' ? ' with gnutls' : '' | |
b349bc59 | 1734 | error('DNS-over-TLS support was requested@0@, but dependencies are not available'.format(str)) |
096cbdce IT |
1735 | endif |
1736 | endif | |
1737 | have = have_gnutls or have_openssl | |
56ddbf10 | 1738 | else |
be5536a6 MO |
1739 | have = false |
1740 | have_gnutls = false | |
1741 | have_openssl = false | |
56ddbf10 YW |
1742 | endif |
1743 | conf.set10('ENABLE_DNS_OVER_TLS', have) | |
096cbdce IT |
1744 | conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls) |
1745 | conf.set10('DNS_OVER_TLS_USE_OPENSSL', have_openssl) | |
56ddbf10 | 1746 | |
c9299be2 | 1747 | default_dns_over_tls = get_option('default-dns-over-tls') |
87ac55a1 | 1748 | if skip_deps |
c9299be2 | 1749 | default_dns_over_tls = 'no' |
5d67a7ae | 1750 | endif |
56ddbf10 | 1751 | if default_dns_over_tls != 'no' and conf.get('ENABLE_DNS_OVER_TLS') == 0 |
4310bfc2 | 1752 | message('default-dns-over-tls cannot be enabled or set to opportunistic when DNS-over-TLS support is disabled. Setting default-dns-over-tls to no.') |
c9299be2 | 1753 | default_dns_over_tls = 'no' |
5d67a7ae | 1754 | endif |
c9299be2 IT |
1755 | conf.set('DEFAULT_DNS_OVER_TLS_MODE', |
1756 | 'DNS_OVER_TLS_' + default_dns_over_tls.underscorify().to_upper()) | |
411d1f4c | 1757 | conf.set_quoted('DEFAULT_DNS_OVER_TLS_MODE_STR', default_dns_over_tls) |
5d67a7ae | 1758 | |
3614df05 ZJS |
1759 | default_mdns = get_option('default-mdns') |
1760 | conf.set('DEFAULT_MDNS_MODE', | |
1761 | 'RESOLVE_SUPPORT_' + default_mdns.to_upper()) | |
411d1f4c | 1762 | conf.set_quoted('DEFAULT_MDNS_MODE_STR', default_mdns) |
3614df05 ZJS |
1763 | |
1764 | default_llmnr = get_option('default-llmnr') | |
1765 | conf.set('DEFAULT_LLMNR_MODE', | |
1766 | 'RESOLVE_SUPPORT_' + default_llmnr.to_upper()) | |
411d1f4c | 1767 | conf.set_quoted('DEFAULT_LLMNR_MODE_STR', default_llmnr) |
3614df05 | 1768 | |
e594a3b1 LP |
1769 | want_repart = get_option('repart') |
1770 | if want_repart != 'false' | |
6b12086e | 1771 | have = conf.get('HAVE_LIBFDISK') == 1 |
e594a3b1 LP |
1772 | if want_repart == 'true' and not have |
1773 | error('repart support was requested, but dependencies are not available') | |
1774 | endif | |
1775 | else | |
1776 | have = false | |
1777 | endif | |
1778 | conf.set10('ENABLE_REPART', have) | |
1779 | ||
7e8facb3 ZJS |
1780 | default_dnssec = get_option('default-dnssec') |
1781 | if skip_deps | |
1782 | default_dnssec = 'no' | |
1783 | endif | |
1784 | if default_dnssec != 'no' and conf.get('HAVE_OPENSSL_OR_GCRYPT') == 0 | |
1785 | message('default-dnssec cannot be set to yes or allow-downgrade openssl and gcrypt are disabled. Setting default-dnssec to no.') | |
1786 | default_dnssec = 'no' | |
1787 | endif | |
1788 | conf.set('DEFAULT_DNSSEC_MODE', | |
1789 | 'DNSSEC_' + default_dnssec.underscorify().to_upper()) | |
1790 | conf.set_quoted('DEFAULT_DNSSEC_MODE_STR', default_dnssec) | |
1791 | ||
43cc7a3e LP |
1792 | want_sysupdate = get_option('sysupdate') |
1793 | if want_sysupdate != 'false' | |
1794 | have = (conf.get('HAVE_OPENSSL') == 1 and | |
1795 | conf.get('HAVE_LIBFDISK') == 1) | |
1796 | if want_sysupdate == 'true' and not have | |
1797 | error('sysupdate support was requested, but dependencies are not available') | |
1798 | endif | |
1799 | else | |
1800 | have = false | |
1801 | endif | |
1802 | conf.set10('ENABLE_SYSUPDATE', have) | |
1803 | ||
5c23128d | 1804 | want_importd = get_option('importd') |
4390be30 | 1805 | if want_importd != 'false' |
349cc4a5 | 1806 | have = (conf.get('HAVE_LIBCURL') == 1 and |
6214d42b | 1807 | conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1 and |
349cc4a5 | 1808 | conf.get('HAVE_ZLIB') == 1 and |
6214d42b | 1809 | conf.get('HAVE_XZ') == 1) |
349cc4a5 | 1810 | if want_importd == 'true' and not have |
37efbbd8 ZJS |
1811 | error('importd support was requested, but dependencies are not available') |
1812 | endif | |
349cc4a5 ZJS |
1813 | else |
1814 | have = false | |
5c23128d | 1815 | endif |
349cc4a5 | 1816 | conf.set10('ENABLE_IMPORTD', have) |
5c23128d | 1817 | |
f887eab1 FB |
1818 | want_kernel_install = get_option('kernel-install') |
1819 | conf.set10('ENABLE_KERNEL_INSTALL', want_kernel_install) | |
1820 | ||
70a5db58 LP |
1821 | want_homed = get_option('homed') |
1822 | if want_homed != 'false' | |
1823 | have = (conf.get('HAVE_OPENSSL') == 1 and | |
1824 | conf.get('HAVE_LIBFDISK') == 1 and | |
1825 | conf.get('HAVE_LIBCRYPTSETUP') == 1) | |
1826 | if want_homed == 'true' and not have | |
1827 | error('homed support was requested, but dependencies are not available') | |
1828 | endif | |
1829 | else | |
1830 | have = false | |
1831 | endif | |
1832 | conf.set10('ENABLE_HOMED', have) | |
1833 | ||
af06ddf5 YW |
1834 | have = have and conf.get('HAVE_PAM') == 1 |
1835 | conf.set10('ENABLE_PAM_HOME', have) | |
1836 | ||
d58c5f0f | 1837 | have = get_option('oomd') |
c199dd3f AZ |
1838 | conf.set10('ENABLE_OOMD', have) |
1839 | ||
5c23128d | 1840 | want_remote = get_option('remote') |
4390be30 | 1841 | if want_remote != 'false' |
349cc4a5 ZJS |
1842 | have_deps = [conf.get('HAVE_MICROHTTPD') == 1, |
1843 | conf.get('HAVE_LIBCURL') == 1] | |
37efbbd8 ZJS |
1844 | # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so |
1845 | # it's possible to build one without the other. Complain only if | |
5238e957 | 1846 | # support was explicitly requested. The auxiliary files like sysusers |
37efbbd8 ZJS |
1847 | # config should be installed when any of the programs are built. |
1848 | if want_remote == 'true' and not (have_deps[0] and have_deps[1]) | |
1849 | error('remote support was requested, but dependencies are not available') | |
1850 | endif | |
349cc4a5 ZJS |
1851 | have = have_deps[0] or have_deps[1] |
1852 | else | |
1853 | have = false | |
5c23128d | 1854 | endif |
349cc4a5 | 1855 | conf.set10('ENABLE_REMOTE', have) |
5c23128d | 1856 | |
b3259a6e ZJS |
1857 | foreach term : ['analyze', |
1858 | 'backlight', | |
a9149d87 ZJS |
1859 | 'binfmt', |
1860 | 'coredump', | |
b3259a6e ZJS |
1861 | 'efi', |
1862 | 'environment-d', | |
1863 | 'firstboot', | |
1864 | 'gshadow', | |
1865 | 'hibernate', | |
a9149d87 | 1866 | 'hostnamed', |
b3259a6e ZJS |
1867 | 'hwdb', |
1868 | 'idn', | |
1869 | 'ima', | |
1870 | 'initrd', | |
53393c89 | 1871 | 'compat-mutable-uid-boundaries', |
7e0079f9 | 1872 | 'nscd', |
b3259a6e | 1873 | 'ldconfig', |
a9149d87 | 1874 | 'localed', |
b3259a6e | 1875 | 'logind', |
a9149d87 ZJS |
1876 | 'machined', |
1877 | 'networkd', | |
b3259a6e ZJS |
1878 | 'nss-myhostname', |
1879 | 'nss-systemd', | |
1880 | 'portabled', | |
9bca4ae4 | 1881 | 'sysext', |
b3259a6e | 1882 | 'pstore', |
a9149d87 | 1883 | 'quotacheck', |
b3259a6e ZJS |
1884 | 'randomseed', |
1885 | 'resolve', | |
1886 | 'rfkill', | |
1887 | 'smack', | |
a9149d87 | 1888 | 'sysusers', |
b3259a6e ZJS |
1889 | 'timedated', |
1890 | 'timesyncd', | |
a9149d87 | 1891 | 'tmpfiles', |
a9149d87 | 1892 | 'tpm', |
b3259a6e ZJS |
1893 | 'userdb', |
1894 | 'utmp', | |
1895 | 'vconsole', | |
1896 | 'xdg-autostart'] | |
a9149d87 ZJS |
1897 | have = get_option(term) |
1898 | name = 'ENABLE_' + term.underscorify().to_upper() | |
1899 | conf.set10(name, have) | |
5c23128d ZJS |
1900 | endforeach |
1901 | ||
bd7e6aa7 ZJS |
1902 | enable_sysusers = conf.get('ENABLE_SYSUSERS') == 1 |
1903 | ||
08540a95 YW |
1904 | foreach tuple : [['nss-mymachines', 'machined'], |
1905 | ['nss-resolve', 'resolve']] | |
1906 | want = get_option(tuple[0]) | |
1907 | if want != 'false' | |
1908 | have = get_option(tuple[1]) | |
1909 | if want == 'true' and not have | |
1910 | error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1])) | |
1911 | endif | |
1912 | else | |
1913 | have = false | |
1914 | endif | |
1915 | name = 'ENABLE_' + tuple[0].underscorify().to_upper() | |
1916 | conf.set10(name, have) | |
1917 | endforeach | |
1918 | ||
1919 | enable_nss = false | |
1920 | foreach term : ['ENABLE_NSS_MYHOSTNAME', | |
1921 | 'ENABLE_NSS_MYMACHINES', | |
1922 | 'ENABLE_NSS_RESOLVE', | |
1923 | 'ENABLE_NSS_SYSTEMD'] | |
1924 | if conf.get(term) == 1 | |
1925 | enable_nss = true | |
1926 | endif | |
1927 | endforeach | |
1928 | conf.set10('ENABLE_NSS', enable_nss) | |
1929 | ||
348b4437 | 1930 | conf.set10('ENABLE_TIMEDATECTL', get_option('timedated') or get_option('timesyncd')) |
6129ec85 | 1931 | |
b68dfb9e | 1932 | conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests) |
00d82c81 | 1933 | |
db7f5ab6 JJ |
1934 | ############################################################ |
1935 | ||
1936 | tests = [] | |
c12e10d7 | 1937 | simple_tests = [] |
db7f5ab6 | 1938 | fuzzers = [] |
a9a7153c | 1939 | simple_fuzzers = [] |
e93ada98 | 1940 | catalogs = [] |
db7f5ab6 JJ |
1941 | |
1942 | ############################################################ | |
5c23128d | 1943 | |
db7f5ab6 | 1944 | # Include these now as they provide gnu-efi detection. |
34357545 MS |
1945 | subdir('src/fundamental') |
1946 | subdir('src/boot/efi') | |
34357545 | 1947 | |
f6fe732f YW |
1948 | ############################################################ |
1949 | ||
9c45bfb2 FS |
1950 | pymod = import('python') |
1951 | python = pymod.find_installation('python3', required : true, modules : ['jinja2']) | |
1952 | python_39 = python.language_version().version_compare('>=3.9') | |
1953 | ||
1954 | if get_option('ukify') == 'auto' | |
1955 | want_ukify = python_39 and conf.get('HAVE_GNU_EFI') == 1 | |
1956 | elif get_option('ukify') == 'true' and (not python_39 or conf.get('HAVE_GNU_EFI') != 1) | |
1957 | error('ukify requires Python >= 3.9 and GNU EFI') | |
1958 | else | |
1959 | want_ukify = get_option('ukify') == 'true' | |
1960 | endif | |
1961 | conf.set10('ENABLE_UKIFY', want_ukify) | |
1962 | ||
1963 | ############################################################ | |
1964 | # | |
d3821a33 | 1965 | generate_gperfs = find_program('tools/generate-gperfs.py') |
f6fe732f YW |
1966 | make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py') |
1967 | make_directive_index_py = find_program('tools/make-directive-index.py') | |
1968 | make_man_index_py = find_program('tools/make-man-index.py') | |
6b1aac3c | 1969 | meson_render_jinja2 = find_program('tools/meson-render-jinja2.py') |
d3821a33 | 1970 | update_dbus_docs_py = find_program('tools/update-dbus-docs.py') |
77d45f1f | 1971 | update_man_rules_py = find_program('tools/update-man-rules.py') |
d3821a33 ZJS |
1972 | update_hwdb_sh = find_program('tools/update-hwdb.sh') |
1973 | update_hwdb_autosuspend_sh = find_program('tools/update-hwdb-autosuspend.sh') | |
1974 | update_syscall_tables_sh = find_program('tools/update-syscall-tables.sh') | |
1975 | xml_helper_py = find_program('tools/xml_helper.py') | |
e3c68924 | 1976 | export_dbus_interfaces_py = find_program('tools/dbus_exporter.py') |
f6fe732f | 1977 | |
db7f5ab6 | 1978 | ############################################################ |
5c23128d | 1979 | |
7e43be7d FS |
1980 | if get_option('b_coverage') |
1981 | add_project_arguments('-include', 'src/basic/coverage.h', language : 'c') | |
1982 | endif | |
1983 | ||
1984 | ############################################################ | |
1985 | ||
5c23128d | 1986 | config_h = configure_file( |
37efbbd8 ZJS |
1987 | output : 'config.h', |
1988 | configuration : conf) | |
5c23128d | 1989 | |
f6fe732f YW |
1990 | add_project_arguments('-include', 'config.h', language : 'c') |
1991 | ||
8f04a1ca ZJS |
1992 | jinja2_cmdline = [meson_render_jinja2, config_h, version_h] |
1993 | ||
f6fe732f | 1994 | ############################################################ |
348b4437 | 1995 | |
b61016f2 YW |
1996 | # binaries that have --help and are intended for use by humans, |
1997 | # usually, but not always, installed in /bin. | |
1998 | public_programs = [] | |
1999 | ||
e3c68924 | 2000 | # D-Bus introspection XML export |
2001 | dbus_programs = [] | |
e3c68924 | 2002 | |
8d40961c YW |
2003 | basic_includes = include_directories( |
2004 | 'src/basic', | |
e5bc5f1f | 2005 | 'src/fundamental', |
8d40961c YW |
2006 | 'src/systemd', |
2007 | '.') | |
2008 | ||
2009 | libsystemd_includes = [basic_includes, include_directories( | |
2010 | 'src/libsystemd/sd-bus', | |
2011 | 'src/libsystemd/sd-device', | |
2012 | 'src/libsystemd/sd-event', | |
2013 | 'src/libsystemd/sd-hwdb', | |
2014 | 'src/libsystemd/sd-id128', | |
2015 | 'src/libsystemd/sd-journal', | |
2016 | 'src/libsystemd/sd-netlink', | |
2017 | 'src/libsystemd/sd-network', | |
2018 | 'src/libsystemd/sd-resolve')] | |
2019 | ||
2020 | includes = [libsystemd_includes, include_directories('src/shared')] | |
5c23128d | 2021 | |
5c23128d ZJS |
2022 | subdir('po') |
2023 | subdir('catalog') | |
5c23128d ZJS |
2024 | subdir('src/basic') |
2025 | subdir('src/libsystemd') | |
3976f372 YW |
2026 | subdir('src/shared') |
2027 | subdir('src/udev') | |
2028 | subdir('src/libudev') | |
d1ae38d8 | 2029 | subdir('src/cryptsetup/cryptsetup-tokens') |
5c23128d | 2030 | |
039f1673 LB |
2031 | alias_target('devel', libsystemd_pc, libudev_pc) |
2032 | ||
5c23128d | 2033 | libsystemd = shared_library( |
37efbbd8 | 2034 | 'systemd', |
56d50ab1 | 2035 | version : libsystemd_version, |
8d40961c | 2036 | include_directories : libsystemd_includes, |
37efbbd8 ZJS |
2037 | link_args : ['-shared', |
2038 | '-Wl,--version-script=' + libsystemd_sym_path], | |
34e221a5 | 2039 | link_with : [libbasic, |
acc50c92 LP |
2040 | libbasic_gcrypt, |
2041 | libbasic_compress], | |
99b9f8fd | 2042 | link_whole : [libsystemd_static], |
37efbbd8 | 2043 | dependencies : [threads, |
acc50c92 | 2044 | librt], |
37efbbd8 ZJS |
2045 | link_depends : libsystemd_sym, |
2046 | install : true, | |
0a5e638c | 2047 | install_tag: 'libsystemd', |
37efbbd8 | 2048 | install_dir : rootlibdir) |
5c23128d | 2049 | |
039f1673 LB |
2050 | alias_target('libsystemd', libsystemd) |
2051 | ||
70848ecf DC |
2052 | install_libsystemd_static = static_library( |
2053 | 'systemd', | |
2054 | libsystemd_sources, | |
975464e0 ZJS |
2055 | basic_sources, |
2056 | basic_gcrypt_sources, | |
acc50c92 | 2057 | basic_compress_sources, |
e5bc5f1f | 2058 | fundamental_sources, |
8d40961c | 2059 | include_directories : libsystemd_includes, |
70848ecf DC |
2060 | build_by_default : static_libsystemd != 'false', |
2061 | install : static_libsystemd != 'false', | |
0a5e638c | 2062 | install_tag: 'libsystemd', |
70848ecf | 2063 | install_dir : rootlibdir, |
40dbce36 | 2064 | pic : static_libsystemd_pic, |
70848ecf DC |
2065 | dependencies : [threads, |
2066 | librt, | |
2067 | libxz, | |
ef5924aa | 2068 | libzstd, |
70848ecf | 2069 | liblz4, |
c5fd89ad | 2070 | libdl, |
975464e0 ZJS |
2071 | libcap, |
2072 | libblkid, | |
2073 | libmount, | |
011d129c | 2074 | libgcrypt, |
c47511da ZJS |
2075 | libopenssl, |
2076 | versiondep], | |
70848ecf DC |
2077 | c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC'])) |
2078 | ||
3976f372 YW |
2079 | libudev = shared_library( |
2080 | 'udev', | |
3976f372 YW |
2081 | version : libudev_version, |
2082 | include_directories : includes, | |
2083 | link_args : ['-shared', | |
2084 | '-Wl,--version-script=' + libudev_sym_path], | |
2085 | link_with : [libsystemd_static, libshared_static], | |
2086 | link_whole : libudev_basic, | |
2087 | dependencies : [threads], | |
2088 | link_depends : libudev_sym, | |
2089 | install : true, | |
0a5e638c | 2090 | install_tag: 'libudev', |
3976f372 YW |
2091 | install_dir : rootlibdir) |
2092 | ||
039f1673 LB |
2093 | alias_target('libudev', libudev) |
2094 | ||
3976f372 YW |
2095 | install_libudev_static = static_library( |
2096 | 'udev', | |
2097 | basic_sources, | |
e5bc5f1f | 2098 | fundamental_sources, |
3976f372 YW |
2099 | shared_sources, |
2100 | libsystemd_sources, | |
2101 | libudev_sources, | |
3976f372 YW |
2102 | include_directories : includes, |
2103 | build_by_default : static_libudev != 'false', | |
2104 | install : static_libudev != 'false', | |
0a5e638c | 2105 | install_tag: 'libudev', |
3976f372 YW |
2106 | install_dir : rootlibdir, |
2107 | link_depends : libudev_sym, | |
c47511da ZJS |
2108 | dependencies : [libshared_deps, |
2109 | libmount, | |
2110 | versiondep], | |
3976f372 YW |
2111 | c_args : static_libudev_pic ? [] : ['-fno-PIC'], |
2112 | pic : static_libudev_pic) | |
2113 | ||
d1ae38d8 OK |
2114 | if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1 |
2115 | if conf.get('HAVE_TPM2') == 1 | |
6249face | 2116 | shared_library( |
d1ae38d8 | 2117 | 'cryptsetup-token-systemd-tpm2', |
c01543fd ZJS |
2118 | cryptsetup_token_systemd_tpm2_sources, |
2119 | include_directories : includes, | |
d1ae38d8 OK |
2120 | link_args : ['-shared', |
2121 | '-Wl,--version-script=' + cryptsetup_token_sym_path], | |
c01543fd ZJS |
2122 | link_with : [lib_cryptsetup_token_common, |
2123 | libshared], | |
2124 | dependencies : [libcryptsetup, | |
2125 | tpm2, | |
2126 | versiondep], | |
d1ae38d8 | 2127 | link_depends : cryptsetup_token_sym, |
5fb22561 | 2128 | install_rpath : rootpkglibdir, |
d1ae38d8 OK |
2129 | install : true, |
2130 | install_dir : libcryptsetup_plugins_dir) | |
2131 | endif | |
351716e1 OK |
2132 | |
2133 | if conf.get('HAVE_LIBFIDO2') == 1 | |
6249face | 2134 | shared_library( |
351716e1 | 2135 | 'cryptsetup-token-systemd-fido2', |
c01543fd ZJS |
2136 | cryptsetup_token_systemd_fido2_sources, |
2137 | include_directories : includes, | |
351716e1 OK |
2138 | link_args : ['-shared', |
2139 | '-Wl,--version-script=' + cryptsetup_token_sym_path], | |
c01543fd ZJS |
2140 | link_with : [lib_cryptsetup_token_common, |
2141 | libshared], | |
2142 | dependencies : [libcryptsetup, | |
2143 | libfido2, | |
2144 | versiondep], | |
351716e1 | 2145 | link_depends : cryptsetup_token_sym, |
5fb22561 | 2146 | install_rpath : rootpkglibdir, |
351716e1 OK |
2147 | install : true, |
2148 | install_dir : libcryptsetup_plugins_dir) | |
2149 | endif | |
8186022c OK |
2150 | |
2151 | if conf.get('HAVE_P11KIT') == 1 | |
6249face | 2152 | shared_library( |
8186022c | 2153 | 'cryptsetup-token-systemd-pkcs11', |
c01543fd ZJS |
2154 | cryptsetup_token_systemd_pkcs11_sources, |
2155 | include_directories : includes, | |
8186022c OK |
2156 | link_args : ['-shared', |
2157 | '-Wl,--version-script=' + cryptsetup_token_sym_path], | |
c01543fd ZJS |
2158 | link_with : [lib_cryptsetup_token_common, |
2159 | libshared], | |
2160 | dependencies : [libcryptsetup, | |
2161 | libp11kit, | |
2162 | versiondep], | |
8186022c | 2163 | link_depends : cryptsetup_token_sym, |
5fb22561 | 2164 | install_rpath : rootpkglibdir, |
8186022c OK |
2165 | install : true, |
2166 | install_dir : libcryptsetup_plugins_dir) | |
2167 | endif | |
d1ae38d8 OK |
2168 | endif |
2169 | ||
47354b44 ZJS |
2170 | ############################################################ |
2171 | ||
b61016f2 | 2172 | # systemd-analyze requires 'libcore' |
83b6af36 | 2173 | subdir('src/core') |
b61016f2 YW |
2174 | # systemd-journal-remote requires 'libjournal_core' |
2175 | subdir('src/journal') | |
2176 | # systemd-networkd requires 'libsystemd_network' | |
2177 | subdir('src/libsystemd-network') | |
83b6af36 ZJS |
2178 | |
2179 | subdir('src/analyze') | |
cd4300f3 | 2180 | subdir('src/boot') |
f98df767 | 2181 | subdir('src/busctl') |
b61016f2 | 2182 | subdir('src/coredump') |
2ad279cf | 2183 | subdir('src/cryptenroll') |
b4d1892a | 2184 | subdir('src/cryptsetup') |
b61016f2 | 2185 | subdir('src/home') |
83b6af36 ZJS |
2186 | subdir('src/hostname') |
2187 | subdir('src/import') | |
b61016f2 | 2188 | subdir('src/journal-remote') |
83b6af36 ZJS |
2189 | subdir('src/kernel-install') |
2190 | subdir('src/locale') | |
b61016f2 | 2191 | subdir('src/login') |
83b6af36 | 2192 | subdir('src/machine') |
b61016f2 | 2193 | subdir('src/network') |
83b6af36 | 2194 | subdir('src/nspawn') |
b61016f2 YW |
2195 | subdir('src/oom') |
2196 | subdir('src/partition') | |
2197 | subdir('src/portable') | |
2198 | subdir('src/pstore') | |
83b6af36 | 2199 | subdir('src/resolve') |
2a9b4bbe | 2200 | subdir('src/rpm') |
b61016f2 | 2201 | subdir('src/shutdown') |
9bca4ae4 | 2202 | subdir('src/sysext') |
c3512573 | 2203 | subdir('src/systemctl') |
43cc7a3e | 2204 | subdir('src/sysupdate') |
83b6af36 ZJS |
2205 | subdir('src/timedate') |
2206 | subdir('src/timesync') | |
db64ba81 | 2207 | subdir('src/tmpfiles') |
b61016f2 | 2208 | subdir('src/userdb') |
0275e918 | 2209 | subdir('src/xdg-autostart-generator') |
83b6af36 | 2210 | |
3976f372 YW |
2211 | subdir('src/systemd') |
2212 | ||
83b6af36 | 2213 | subdir('src/test') |
7db7d5b7 | 2214 | subdir('src/fuzz') |
ef2ad30a | 2215 | subdir('rules.d') |
83b6af36 | 2216 | subdir('test') |
a1d6dbb1 | 2217 | subdir('src/ukify/test') # needs to be last for test_env variable |
83b6af36 ZJS |
2218 | |
2219 | ############################################################ | |
2220 | ||
2221 | # only static linking apart from libdl, to make sure that the | |
2222 | # module is linked to all libraries that it uses. | |
2223 | test_dlopen = executable( | |
37efbbd8 ZJS |
2224 | 'test-dlopen', |
2225 | test_dlopen_c, | |
2226 | include_directories : includes, | |
2227 | link_with : [libbasic], | |
fd1939fb YW |
2228 | dependencies : [libdl], |
2229 | build_by_default : want_tests != 'false') | |
83b6af36 | 2230 | |
08540a95 | 2231 | foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'], |
cbaaf7b9 | 2232 | ['systemd', 'ENABLE_NSS_SYSTEMD', ['nss-systemd.h', 'userdb-glue.c', 'userdb-glue.h']], |
08540a95 | 2233 | ['mymachines', 'ENABLE_NSS_MYMACHINES'], |
8d40961c | 2234 | ['resolve', 'ENABLE_NSS_RESOLVE', [], resolve_includes]] |
5c23128d | 2235 | |
349cc4a5 | 2236 | condition = tuple[1] == '' or conf.get(tuple[1]) == 1 |
37efbbd8 ZJS |
2237 | if condition |
2238 | module = tuple[0] | |
37efbbd8 ZJS |
2239 | |
2240 | sym = 'src/nss-@0@/nss-@0@.sym'.format(module) | |
fce9abb2 | 2241 | version_script_arg = project_source_root / sym |
37efbbd8 | 2242 | |
1684c56f LP |
2243 | sources = ['src/nss-@0@/nss-@0@.c'.format(module)] |
2244 | if tuple.length() > 2 | |
cbaaf7b9 YW |
2245 | foreach s : tuple[2] |
2246 | sources += ['src/nss-@0@/@1@'.format(module, s)] | |
2247 | endforeach | |
1684c56f LP |
2248 | endif |
2249 | ||
8d40961c YW |
2250 | incs = tuple.length() > 3 ? tuple[3] : includes |
2251 | ||
37efbbd8 ZJS |
2252 | nss = shared_library( |
2253 | 'nss_' + module, | |
1684c56f | 2254 | sources, |
37efbbd8 | 2255 | version : '2', |
8d40961c | 2256 | include_directories : incs, |
b4b36f44 LP |
2257 | # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned |
2258 | link_args : ['-Wl,-z,nodelete', | |
2259 | '-shared', | |
700805f6 | 2260 | '-Wl,--version-script=' + version_script_arg], |
37e4d7a8 | 2261 | link_with : [libsystemd_static, |
733cbd00 | 2262 | libshared_static, |
37efbbd8 ZJS |
2263 | libbasic], |
2264 | dependencies : [threads, | |
5486a31d | 2265 | librt], |
37efbbd8 ZJS |
2266 | link_depends : sym, |
2267 | install : true, | |
35d17e15 | 2268 | install_tag : 'nss', |
37efbbd8 ZJS |
2269 | install_dir : rootlibdir) |
2270 | ||
2271 | # We cannot use shared_module because it does not support version suffix. | |
2272 | # Unfortunately shared_library insists on creating the symlink… | |
7c22f07c | 2273 | meson.add_install_script('sh', '-c', |
37efbbd8 | 2274 | 'rm $DESTDIR@0@/libnss_@1@.so' |
35d17e15 MG |
2275 | .format(rootlibdir, module), |
2276 | install_tag : 'nss' | |
2277 | ) | |
37efbbd8 | 2278 | |
938be089 ZJS |
2279 | if want_tests != 'false' |
2280 | test('dlopen-nss_' + module, | |
2281 | test_dlopen, | |
2282 | # path to dlopen must include a slash | |
e93ada98 DDM |
2283 | args : nss.full_path(), |
2284 | depends : nss) | |
938be089 | 2285 | endif |
37efbbd8 | 2286 | endif |
5c23128d ZJS |
2287 | endforeach |
2288 | ||
2289 | ############################################################ | |
2290 | ||
3761002e | 2291 | exe = executable( |
6164ec4c ZJS |
2292 | 'systemd', |
2293 | systemd_sources, | |
2294 | include_directories : includes, | |
2295 | link_with : [libcore, | |
2296 | libshared], | |
c47511da ZJS |
2297 | dependencies : [libseccomp, |
2298 | versiondep], | |
5fb22561 | 2299 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2300 | install : true, |
2301 | install_dir : rootlibexecdir) | |
3761002e ZJS |
2302 | dbus_programs += exe |
2303 | public_programs += exe | |
5c23128d | 2304 | |
ba7f4ae6 | 2305 | meson.add_install_script(meson_make_symlink, |
fce9abb2 ZJS |
2306 | rootlibexecdir / 'systemd', |
2307 | rootsbindir / 'init') | |
ba7f4ae6 | 2308 | |
4e8295f4 | 2309 | exe = executable( |
6164ec4c ZJS |
2310 | 'systemd-analyze', |
2311 | systemd_analyze_sources, | |
8d40961c | 2312 | include_directories : core_includes, |
6164ec4c ZJS |
2313 | link_with : [libcore, |
2314 | libshared], | |
c47511da ZJS |
2315 | dependencies : [libseccomp, |
2316 | versiondep], | |
5fb22561 | 2317 | install_rpath : rootpkglibdir, |
9e4a50bc | 2318 | install : conf.get('ENABLE_ANALYZE') == 1) |
4e8295f4 ZJS |
2319 | public_programs += exe |
2320 | ||
2321 | if want_tests != 'false' | |
2322 | test('test-compare-versions', | |
2323 | test_compare_versions_sh, | |
2324 | args : exe.full_path()) | |
2325 | endif | |
5c23128d | 2326 | |
6164ec4c ZJS |
2327 | executable( |
2328 | 'systemd-journald', | |
2329 | systemd_journald_sources, | |
2330 | include_directories : includes, | |
2331 | link_with : [libjournal_core, | |
2332 | libshared], | |
2333 | dependencies : [threads, | |
2334 | libxz, | |
2335 | liblz4, | |
ef5924aa | 2336 | libselinux, |
c47511da ZJS |
2337 | libzstd, |
2338 | versiondep], | |
5fb22561 | 2339 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2340 | install : true, |
2341 | install_dir : rootlibexecdir) | |
5c23128d | 2342 | |
6164ec4c ZJS |
2343 | public_programs += executable( |
2344 | 'systemd-cat', | |
2345 | systemd_cat_sources, | |
2346 | include_directories : includes, | |
2347 | link_with : [libjournal_core, | |
2348 | libshared], | |
3a21c554 FS |
2349 | dependencies : [threads, |
2350 | versiondep], | |
5fb22561 | 2351 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2352 | install : true) |
2353 | ||
0a0d4899 | 2354 | if get_option('link-journalctl-shared') |
46fb302f | 2355 | journalctl_link_with = [libshared] |
0a0d4899 JH |
2356 | else |
2357 | journalctl_link_with = [libsystemd_static, | |
2358 | libshared_static, | |
46fb302f | 2359 | libbasic_gcrypt] |
0a0d4899 JH |
2360 | endif |
2361 | ||
6164ec4c ZJS |
2362 | public_programs += executable( |
2363 | 'journalctl', | |
2364 | journalctl_sources, | |
2365 | include_directories : includes, | |
0a0d4899 | 2366 | link_with : [journalctl_link_with], |
6164ec4c | 2367 | dependencies : [threads, |
e44b5004 | 2368 | libdl, |
6164ec4c ZJS |
2369 | libxz, |
2370 | liblz4, | |
9200bb30 | 2371 | libzstd, |
c47511da ZJS |
2372 | libdl, |
2373 | versiondep], | |
5fb22561 | 2374 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2375 | install : true, |
2376 | install_dir : rootbindir) | |
35a1ff4c | 2377 | |
6164ec4c ZJS |
2378 | executable( |
2379 | 'systemd-getty-generator', | |
2380 | 'src/getty-generator/getty-generator.c', | |
2381 | include_directories : includes, | |
2382 | link_with : [libshared], | |
5fb22561 | 2383 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2384 | install : true, |
2385 | install_dir : systemgeneratordir) | |
5c23128d | 2386 | |
6164ec4c ZJS |
2387 | executable( |
2388 | 'systemd-debug-generator', | |
2389 | 'src/debug-generator/debug-generator.c', | |
2390 | include_directories : includes, | |
2391 | link_with : [libshared], | |
5fb22561 | 2392 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2393 | install : true, |
2394 | install_dir : systemgeneratordir) | |
2395 | ||
2396 | executable( | |
2397 | 'systemd-run-generator', | |
2398 | 'src/run-generator/run-generator.c', | |
2399 | include_directories : includes, | |
2400 | link_with : [libshared], | |
5fb22561 | 2401 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2402 | install : true, |
2403 | install_dir : systemgeneratordir) | |
2404 | ||
8cc8a073 | 2405 | exe = executable( |
6164ec4c ZJS |
2406 | 'systemd-fstab-generator', |
2407 | 'src/fstab-generator/fstab-generator.c', | |
2408 | include_directories : includes, | |
bac11cd6 | 2409 | link_with : [libshared], |
5fb22561 | 2410 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2411 | install : true, |
2412 | install_dir : systemgeneratordir) | |
5c23128d | 2413 | |
028a981c ZJS |
2414 | meson.add_install_script(meson_make_symlink, |
2415 | systemgeneratordir / 'systemd-fstab-generator', | |
2416 | rootlibexecdir / 'systemd-sysroot-fstab-check') | |
2417 | ||
8cc8a073 YW |
2418 | if want_tests != 'false' |
2419 | test('test-fstab-generator', | |
2420 | test_fstab_generator_sh, | |
2421 | # https://github.com/mesonbuild/meson/issues/2681 | |
e93ada98 DDM |
2422 | args : exe.full_path(), |
2423 | depends : exe) | |
8cc8a073 YW |
2424 | endif |
2425 | ||
349cc4a5 | 2426 | if conf.get('ENABLE_ENVIRONMENT_D') == 1 |
6164ec4c ZJS |
2427 | executable( |
2428 | '30-systemd-environment-d-generator', | |
2429 | 'src/environment-d-generator/environment-d-generator.c', | |
2430 | include_directories : includes, | |
2431 | link_with : [libshared], | |
5fb22561 | 2432 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2433 | install : true, |
2434 | install_dir : userenvgeneratordir) | |
7b76fce1 | 2435 | |
37efbbd8 | 2436 | meson.add_install_script(meson_make_symlink, |
fce9abb2 ZJS |
2437 | sysconfdir / 'environment', |
2438 | environmentdir / '99-environment.conf') | |
5c23128d ZJS |
2439 | endif |
2440 | ||
349cc4a5 | 2441 | if conf.get('ENABLE_HIBERNATE') == 1 |
6164ec4c ZJS |
2442 | executable( |
2443 | 'systemd-hibernate-resume-generator', | |
2444 | 'src/hibernate-resume/hibernate-resume-generator.c', | |
2445 | include_directories : includes, | |
2446 | link_with : [libshared], | |
5fb22561 | 2447 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2448 | install : true, |
2449 | install_dir : systemgeneratordir) | |
2450 | ||
2451 | executable( | |
2452 | 'systemd-hibernate-resume', | |
2453 | 'src/hibernate-resume/hibernate-resume.c', | |
2454 | include_directories : includes, | |
2455 | link_with : [libshared], | |
5fb22561 | 2456 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2457 | install : true, |
2458 | install_dir : rootlibexecdir) | |
37efbbd8 ZJS |
2459 | endif |
2460 | ||
349cc4a5 | 2461 | if conf.get('HAVE_BLKID') == 1 |
6164ec4c ZJS |
2462 | executable( |
2463 | 'systemd-gpt-auto-generator', | |
2464 | 'src/gpt-auto-generator/gpt-auto-generator.c', | |
6164ec4c ZJS |
2465 | include_directories : includes, |
2466 | link_with : [libshared], | |
2467 | dependencies : libblkid, | |
5fb22561 | 2468 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2469 | install : true, |
2470 | install_dir : systemgeneratordir) | |
2471 | ||
2472 | public_programs += executable( | |
2473 | 'systemd-dissect', | |
2474 | 'src/dissect/dissect.c', | |
2475 | include_directories : includes, | |
2476 | link_with : [libshared], | |
3a21c554 | 2477 | dependencies : [versiondep], |
5fb22561 | 2478 | install_rpath : rootpkglibdir, |
5a151082 | 2479 | install : true) |
5c23128d ZJS |
2480 | endif |
2481 | ||
1ec57f33 | 2482 | if conf.get('ENABLE_RESOLVE') == 1 |
e3c68924 | 2483 | dbus_programs += executable( |
6164ec4c ZJS |
2484 | 'systemd-resolved', |
2485 | systemd_resolved_sources, | |
8d40961c | 2486 | include_directories : resolve_includes, |
6164ec4c ZJS |
2487 | link_with : [libshared, |
2488 | libbasic_gcrypt, | |
2489 | libsystemd_resolve_core], | |
2490 | dependencies : systemd_resolved_dependencies, | |
5fb22561 | 2491 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2492 | install : true, |
2493 | install_dir : rootlibexecdir) | |
2494 | ||
2495 | public_programs += executable( | |
2496 | 'resolvectl', | |
2497 | resolvectl_sources, | |
2498 | include_directories : includes, | |
2499 | link_with : [libshared, | |
2500 | libbasic_gcrypt, | |
2501 | libsystemd_resolve_core], | |
2502 | dependencies : [threads, | |
0351cbb9 | 2503 | lib_openssl_or_gcrypt, |
6164ec4c | 2504 | libm, |
c47511da ZJS |
2505 | libidn, |
2506 | versiondep], | |
5fb22561 | 2507 | install_rpath : rootpkglibdir, |
6164ec4c | 2508 | install : true) |
088c1363 LP |
2509 | |
2510 | meson.add_install_script(meson_make_symlink, | |
fce9abb2 ZJS |
2511 | bindir / 'resolvectl', |
2512 | rootsbindir / 'resolvconf') | |
c2e84cab YW |
2513 | |
2514 | meson.add_install_script(meson_make_symlink, | |
fce9abb2 ZJS |
2515 | bindir / 'resolvectl', |
2516 | bindir / 'systemd-resolve') | |
5c23128d ZJS |
2517 | endif |
2518 | ||
349cc4a5 | 2519 | if conf.get('ENABLE_LOGIND') == 1 |
e3c68924 | 2520 | dbus_programs += executable( |
6164ec4c ZJS |
2521 | 'systemd-logind', |
2522 | systemd_logind_sources, | |
2523 | include_directories : includes, | |
2524 | link_with : [liblogind_core, | |
2525 | libshared], | |
2526 | dependencies : [threads, | |
c47511da ZJS |
2527 | libacl, |
2528 | versiondep], | |
5fb22561 | 2529 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2530 | install : true, |
2531 | install_dir : rootlibexecdir) | |
2532 | ||
2533 | public_programs += executable( | |
2534 | 'loginctl', | |
2535 | loginctl_sources, | |
2536 | include_directories : includes, | |
2537 | link_with : [libshared], | |
2538 | dependencies : [threads, | |
2539 | liblz4, | |
ef5924aa | 2540 | libxz, |
c47511da ZJS |
2541 | libzstd, |
2542 | versiondep], | |
5fb22561 | 2543 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2544 | install : true, |
2545 | install_dir : rootbindir) | |
2546 | ||
2547 | public_programs += executable( | |
2548 | 'systemd-inhibit', | |
2549 | 'src/login/inhibit.c', | |
2550 | include_directories : includes, | |
2551 | link_with : [libshared], | |
3a21c554 | 2552 | dependencies : [versiondep], |
5fb22561 | 2553 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2554 | install : true, |
2555 | install_dir : rootbindir) | |
37efbbd8 | 2556 | |
349cc4a5 | 2557 | if conf.get('HAVE_PAM') == 1 |
fce9abb2 | 2558 | version_script_arg = project_source_root / pam_systemd_sym |
37efbbd8 ZJS |
2559 | pam_systemd = shared_library( |
2560 | 'pam_systemd', | |
2561 | pam_systemd_c, | |
2562 | name_prefix : '', | |
2563 | include_directories : includes, | |
2564 | link_args : ['-shared', | |
2565 | '-Wl,--version-script=' + version_script_arg], | |
37e4d7a8 | 2566 | link_with : [libsystemd_static, |
37efbbd8 ZJS |
2567 | libshared_static], |
2568 | dependencies : [threads, | |
2569 | libpam, | |
c47511da ZJS |
2570 | libpam_misc, |
2571 | versiondep], | |
37efbbd8 ZJS |
2572 | link_depends : pam_systemd_sym, |
2573 | install : true, | |
48139c7c | 2574 | install_tag : 'pam', |
37efbbd8 ZJS |
2575 | install_dir : pamlibdir) |
2576 | ||
938be089 ZJS |
2577 | if want_tests != 'false' |
2578 | test('dlopen-pam_systemd', | |
2579 | test_dlopen, | |
2580 | # path to dlopen must include a slash | |
e93ada98 DDM |
2581 | args : pam_systemd.full_path(), |
2582 | depends : pam_systemd) | |
938be089 | 2583 | endif |
37efbbd8 | 2584 | endif |
005a29f2 | 2585 | |
6164ec4c ZJS |
2586 | executable( |
2587 | 'systemd-user-runtime-dir', | |
2588 | user_runtime_dir_sources, | |
2589 | include_directories : includes, | |
2590 | link_with : [libshared], | |
5fb22561 | 2591 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2592 | install : true, |
2593 | install_dir : rootlibexecdir) | |
07ee5adb | 2594 | endif |
a9f0f5e5 | 2595 | |
349cc4a5 | 2596 | if conf.get('HAVE_PAM') == 1 |
6164ec4c ZJS |
2597 | executable( |
2598 | 'systemd-user-sessions', | |
2599 | 'src/user-sessions/user-sessions.c', | |
2600 | include_directories : includes, | |
2601 | link_with : [libshared], | |
5fb22561 | 2602 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2603 | install : true, |
2604 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
2605 | endif |
2606 | ||
34357545 | 2607 | if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1 |
79647020 RS |
2608 | if get_option('link-boot-shared') |
2609 | boot_link_with = [libshared] | |
2610 | else | |
2611 | boot_link_with = [libsystemd_static, libshared_static] | |
2612 | endif | |
2613 | ||
50f2c32c | 2614 | exe = executable( |
6164ec4c | 2615 | 'bootctl', |
cd4300f3 | 2616 | bootctl_sources, |
6164ec4c | 2617 | include_directories : includes, |
79647020 | 2618 | link_with : [boot_link_with], |
c47511da ZJS |
2619 | dependencies : [libblkid, |
2620 | versiondep], | |
5fb22561 | 2621 | install_rpath : rootpkglibdir, |
6164ec4c | 2622 | install : true) |
50f2c32c ZJS |
2623 | public_programs += exe |
2624 | ||
2625 | if want_tests != 'false' | |
2626 | test('test-bootctl-json', | |
2627 | test_bootctl_json_sh, | |
2628 | args : exe.full_path(), | |
2629 | depends : exe) | |
2630 | endif | |
6164ec4c ZJS |
2631 | |
2632 | public_programs += executable( | |
2633 | 'systemd-bless-boot', | |
2634 | 'src/boot/bless-boot.c', | |
2635 | include_directories : includes, | |
79647020 | 2636 | link_with : [boot_link_with], |
c47511da ZJS |
2637 | dependencies : [libblkid, |
2638 | versiondep], | |
5fb22561 | 2639 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2640 | install : true, |
2641 | install_dir : rootlibexecdir) | |
2642 | ||
2643 | executable( | |
2644 | 'systemd-bless-boot-generator', | |
2645 | 'src/boot/bless-boot-generator.c', | |
2646 | include_directories : includes, | |
79647020 | 2647 | link_with : [boot_link_with], |
5fb22561 | 2648 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2649 | install : true, |
2650 | install_dir : systemgeneratordir) | |
ca1092dc | 2651 | |
3286770d | 2652 | if conf.get('HAVE_OPENSSL') == 1 and conf.get('HAVE_TPM2') == 1 |
ca1092dc LP |
2653 | executable( |
2654 | 'systemd-measure', | |
2655 | 'src/boot/measure.c', | |
2656 | include_directories : includes, | |
2657 | link_with : [libshared], | |
c47511da ZJS |
2658 | dependencies : [libopenssl, |
2659 | versiondep], | |
ca1092dc LP |
2660 | install_rpath : rootpkglibdir, |
2661 | install : true, | |
2662 | install_dir : rootlibexecdir) | |
708d7524 LP |
2663 | executable( |
2664 | 'systemd-pcrphase', | |
2665 | 'src/boot/pcrphase.c', | |
2666 | include_directories : includes, | |
2667 | link_with : [libshared], | |
c47511da ZJS |
2668 | dependencies : [libopenssl, |
2669 | tpm2, | |
17984c55 | 2670 | libblkid, |
c47511da | 2671 | versiondep], |
708d7524 LP |
2672 | install_rpath : rootpkglibdir, |
2673 | install : true, | |
2674 | install_dir : rootlibexecdir) | |
ca1092dc | 2675 | endif |
6164ec4c ZJS |
2676 | endif |
2677 | ||
2678 | executable( | |
2679 | 'systemd-boot-check-no-failures', | |
2680 | 'src/boot/boot-check-no-failures.c', | |
2681 | include_directories : includes, | |
2682 | link_with : [libshared], | |
c47511da ZJS |
2683 | dependencies : [libblkid, |
2684 | versiondep], | |
5fb22561 | 2685 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2686 | install : true, |
2687 | install_dir : rootlibexecdir) | |
005a29f2 | 2688 | |
6164ec4c ZJS |
2689 | public_programs += executable( |
2690 | 'systemd-socket-activate', | |
2691 | 'src/activate/activate.c', | |
2692 | include_directories : includes, | |
2693 | link_with : [libshared], | |
c47511da ZJS |
2694 | dependencies : [threads, |
2695 | versiondep], | |
5fb22561 | 2696 | install_rpath : rootpkglibdir, |
6164ec4c | 2697 | install : true) |
f3794366 | 2698 | |
2a2d002f | 2699 | systemctl = executable( |
6164ec4c | 2700 | 'systemctl', |
c3512573 | 2701 | systemctl_sources, |
6164ec4c ZJS |
2702 | include_directories : includes, |
2703 | link_with : systemctl_link_with, | |
2704 | dependencies : [threads, | |
2705 | libcap, | |
2706 | libselinux, | |
2707 | libxz, | |
ef5924aa | 2708 | liblz4, |
c47511da ZJS |
2709 | libzstd, |
2710 | versiondep], | |
5fb22561 | 2711 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2712 | install : true, |
2713 | install_dir : rootbindir) | |
2a2d002f | 2714 | public_programs += systemctl |
5c23128d | 2715 | |
61d0578b | 2716 | if conf.get('ENABLE_PORTABLED') == 1 |
e3c68924 | 2717 | dbus_programs += executable( |
6164ec4c ZJS |
2718 | 'systemd-portabled', |
2719 | systemd_portabled_sources, | |
2720 | include_directories : includes, | |
2721 | link_with : [libshared], | |
c47511da ZJS |
2722 | dependencies : [threads, |
2723 | libselinux, | |
2724 | versiondep], | |
5fb22561 | 2725 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2726 | install : true, |
2727 | install_dir : rootlibexecdir) | |
2728 | ||
2729 | public_programs += executable( | |
2730 | 'portablectl', | |
2731 | 'src/portable/portablectl.c', | |
2732 | include_directories : includes, | |
2733 | link_with : [libshared], | |
c47511da ZJS |
2734 | dependencies : [threads, |
2735 | versiondep], | |
5fb22561 | 2736 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2737 | install : true, |
2738 | install_dir : rootbindir) | |
61d0578b LP |
2739 | endif |
2740 | ||
9bca4ae4 LP |
2741 | if conf.get('ENABLE_SYSEXT') == 1 |
2742 | public_programs += executable( | |
2743 | 'systemd-sysext', | |
2744 | systemd_sysext_sources, | |
2745 | include_directories : includes, | |
2746 | link_with : [libshared], | |
3a21c554 | 2747 | dependencies : [versiondep], |
5fb22561 | 2748 | install_rpath : rootpkglibdir, |
9bca4ae4 | 2749 | install : true, |
aac5fbff | 2750 | install_dir : rootbindir) |
9bca4ae4 LP |
2751 | endif |
2752 | ||
d093b62c | 2753 | if conf.get('ENABLE_USERDB') == 1 |
6164ec4c ZJS |
2754 | executable( |
2755 | 'systemd-userwork', | |
2756 | systemd_userwork_sources, | |
2757 | include_directories : includes, | |
2758 | link_with : [libshared], | |
c47511da ZJS |
2759 | dependencies : [threads, |
2760 | versiondep], | |
5fb22561 | 2761 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2762 | install : true, |
2763 | install_dir : rootlibexecdir) | |
2764 | ||
2765 | executable( | |
2766 | 'systemd-userdbd', | |
2767 | systemd_userdbd_sources, | |
2768 | include_directories : includes, | |
2769 | link_with : [libshared], | |
c47511da ZJS |
2770 | dependencies : [threads, |
2771 | versiondep], | |
5fb22561 | 2772 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2773 | install : true, |
2774 | install_dir : rootlibexecdir) | |
2775 | ||
460e5af0 | 2776 | public_programs += executable( |
6164ec4c ZJS |
2777 | 'userdbctl', |
2778 | userdbctl_sources, | |
2779 | include_directories : includes, | |
2780 | link_with : [libshared], | |
c47511da ZJS |
2781 | dependencies : [threads, |
2782 | versiondep], | |
5fb22561 | 2783 | install_rpath : rootpkglibdir, |
003a6761 | 2784 | install : true) |
d093b62c LP |
2785 | endif |
2786 | ||
70a5db58 | 2787 | if conf.get('ENABLE_HOMED') == 1 |
6164ec4c ZJS |
2788 | executable( |
2789 | 'systemd-homework', | |
2790 | systemd_homework_sources, | |
2791 | include_directories : includes, | |
f8cf3d19 LP |
2792 | link_with : [libshared, |
2793 | libshared_fdisk], | |
6164ec4c | 2794 | dependencies : [threads, |
6164ec4c ZJS |
2795 | libblkid, |
2796 | libcrypt, | |
2797 | libopenssl, | |
2798 | libfdisk, | |
c47511da ZJS |
2799 | libp11kit, |
2800 | versiondep], | |
5fb22561 | 2801 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2802 | install : true, |
2803 | install_dir : rootlibexecdir) | |
2804 | ||
e3c68924 | 2805 | dbus_programs += executable( |
6164ec4c ZJS |
2806 | 'systemd-homed', |
2807 | systemd_homed_sources, | |
8d40961c | 2808 | include_directories : home_includes, |
6164ec4c ZJS |
2809 | link_with : [libshared], |
2810 | dependencies : [threads, | |
2811 | libcrypt, | |
d357b80d | 2812 | libopenssl, |
c47511da ZJS |
2813 | libm, |
2814 | versiondep], | |
5fb22561 | 2815 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2816 | install : true, |
2817 | install_dir : rootlibexecdir) | |
2818 | ||
460e5af0 | 2819 | public_programs += executable( |
6164ec4c ZJS |
2820 | 'homectl', |
2821 | homectl_sources, | |
2822 | include_directories : includes, | |
2823 | link_with : [libshared], | |
2824 | dependencies : [threads, | |
2825 | libcrypt, | |
2826 | libopenssl, | |
2827 | libp11kit, | |
c47511da ZJS |
2828 | libdl, |
2829 | versiondep], | |
5fb22561 | 2830 | install_rpath : rootpkglibdir, |
003a6761 | 2831 | install : true) |
26cf9fb7 LP |
2832 | |
2833 | if conf.get('HAVE_PAM') == 1 | |
fce9abb2 | 2834 | version_script_arg = project_source_root / pam_systemd_home_sym |
a7127884 | 2835 | pam_systemd_home = shared_library( |
26cf9fb7 LP |
2836 | 'pam_systemd_home', |
2837 | pam_systemd_home_c, | |
2838 | name_prefix : '', | |
2839 | include_directories : includes, | |
2840 | link_args : ['-shared', | |
2841 | '-Wl,--version-script=' + version_script_arg], | |
2842 | link_with : [libsystemd_static, | |
2843 | libshared_static], | |
2844 | dependencies : [threads, | |
2845 | libpam, | |
2846 | libpam_misc, | |
c47511da ZJS |
2847 | libcrypt, |
2848 | versiondep], | |
26cf9fb7 LP |
2849 | link_depends : pam_systemd_home_sym, |
2850 | install : true, | |
48139c7c | 2851 | install_tag : 'pam', |
26cf9fb7 | 2852 | install_dir : pamlibdir) |
a7127884 YW |
2853 | |
2854 | if want_tests != 'false' | |
2855 | test('dlopen-pam_systemd_home', | |
2856 | test_dlopen, | |
2857 | # path to dlopen must include a slash | |
2858 | args : pam_systemd_home.full_path(), | |
2859 | depends : pam_systemd_home) | |
2860 | endif | |
26cf9fb7 | 2861 | endif |
70a5db58 LP |
2862 | endif |
2863 | ||
6589a569 | 2864 | foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] + |
ba081955 | 2865 | (conf.get('HAVE_SYSV_COMPAT') == 1 ? ['runlevel', 'telinit'] : [])) |
ba7f4ae6 | 2866 | meson.add_install_script(meson_make_symlink, |
fce9abb2 ZJS |
2867 | rootbindir / 'systemctl', |
2868 | rootsbindir / alias) | |
ba7f4ae6 ZJS |
2869 | endforeach |
2870 | ||
63e2d171 | 2871 | meson.add_install_script(meson_make_symlink, |
fce9abb2 ZJS |
2872 | rootbindir / 'udevadm', |
2873 | rootlibexecdir / 'systemd-udevd') | |
63e2d171 | 2874 | |
349cc4a5 | 2875 | if conf.get('ENABLE_BACKLIGHT') == 1 |
6164ec4c ZJS |
2876 | executable( |
2877 | 'systemd-backlight', | |
2878 | 'src/backlight/backlight.c', | |
2879 | include_directories : includes, | |
2880 | link_with : [libshared], | |
5fb22561 | 2881 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2882 | install : true, |
2883 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
2884 | endif |
2885 | ||
349cc4a5 | 2886 | if conf.get('ENABLE_RFKILL') == 1 |
6164ec4c ZJS |
2887 | executable( |
2888 | 'systemd-rfkill', | |
2889 | 'src/rfkill/rfkill.c', | |
2890 | include_directories : includes, | |
2891 | link_with : [libshared], | |
5fb22561 | 2892 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2893 | install : true, |
2894 | install_dir : rootlibexecdir) | |
2895 | endif | |
2896 | ||
2897 | executable( | |
2898 | 'systemd-system-update-generator', | |
2899 | 'src/system-update-generator/system-update-generator.c', | |
2900 | include_directories : includes, | |
2901 | link_with : [libshared], | |
5fb22561 | 2902 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2903 | install : true, |
2904 | install_dir : systemgeneratordir) | |
5c23128d | 2905 | |
349cc4a5 | 2906 | if conf.get('HAVE_LIBCRYPTSETUP') == 1 |
6164ec4c ZJS |
2907 | executable( |
2908 | 'systemd-cryptsetup', | |
2909 | systemd_cryptsetup_sources, | |
2910 | include_directories : includes, | |
2911 | link_with : [libshared], | |
2912 | dependencies : [libcryptsetup, | |
c47511da | 2913 | libp11kit, |
94c0c85e LP |
2914 | versiondep, |
2915 | libopenssl], | |
5fb22561 | 2916 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2917 | install : true, |
2918 | install_dir : rootlibexecdir) | |
2919 | ||
2920 | executable( | |
2921 | 'systemd-cryptsetup-generator', | |
2922 | 'src/cryptsetup/cryptsetup-generator.c', | |
2923 | include_directories : includes, | |
2924 | link_with : [libshared], | |
5fb22561 | 2925 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2926 | install : true, |
2927 | install_dir : systemgeneratordir) | |
2928 | ||
2929 | executable( | |
2930 | 'systemd-veritysetup', | |
2931 | 'src/veritysetup/veritysetup.c', | |
2932 | include_directories : includes, | |
2933 | link_with : [libshared], | |
c47511da ZJS |
2934 | dependencies : [libcryptsetup, |
2935 | versiondep], | |
5fb22561 | 2936 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2937 | install : true, |
2938 | install_dir : rootlibexecdir) | |
2939 | ||
2940 | executable( | |
2941 | 'systemd-veritysetup-generator', | |
2942 | 'src/veritysetup/veritysetup-generator.c', | |
2943 | include_directories : includes, | |
2944 | link_with : [libshared], | |
c47511da | 2945 | dependencies : [versiondep], |
5fb22561 | 2946 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2947 | install : true, |
2948 | install_dir : systemgeneratordir) | |
8710a681 | 2949 | |
3761002e | 2950 | public_programs += executable( |
8710a681 LP |
2951 | 'systemd-cryptenroll', |
2952 | systemd_cryptenroll_sources, | |
2953 | include_directories : includes, | |
2954 | link_with : [libshared], | |
2955 | dependencies : [libcryptsetup, | |
5e521624 | 2956 | libdl, |
8710a681 | 2957 | libopenssl, |
c47511da ZJS |
2958 | libp11kit, |
2959 | versiondep], | |
5fb22561 | 2960 | install_rpath : rootpkglibdir, |
a1fd722b | 2961 | install : true) |
1f1a2243 TA |
2962 | |
2963 | executable( | |
2964 | 'systemd-integritysetup', | |
2965 | ['src/integritysetup/integritysetup.c', 'src/integritysetup/integrity-util.c'], | |
2966 | include_directories : includes, | |
2967 | link_with : [libshared], | |
c47511da ZJS |
2968 | dependencies : [libcryptsetup, |
2969 | versiondep], | |
5fb22561 | 2970 | install_rpath : rootpkglibdir, |
1f1a2243 TA |
2971 | install : true, |
2972 | install_dir : rootlibexecdir) | |
2973 | ||
2974 | executable( | |
2975 | 'systemd-integritysetup-generator', | |
2976 | ['src/integritysetup/integritysetup-generator.c', 'src/integritysetup/integrity-util.c'], | |
2977 | include_directories : includes, | |
2978 | link_with : [libshared], | |
5fb22561 | 2979 | install_rpath : rootpkglibdir, |
1f1a2243 TA |
2980 | install : true, |
2981 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
2982 | endif |
2983 | ||
349cc4a5 | 2984 | if conf.get('HAVE_SYSV_COMPAT') == 1 |
e93ada98 | 2985 | exe = executable( |
6164ec4c ZJS |
2986 | 'systemd-sysv-generator', |
2987 | 'src/sysv-generator/sysv-generator.c', | |
2988 | include_directories : includes, | |
2989 | link_with : [libshared], | |
5fb22561 | 2990 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
2991 | install : true, |
2992 | install_dir : systemgeneratordir) | |
2993 | ||
e93ada98 DDM |
2994 | sysv_generator_test_py = find_program('test/sysv-generator-test.py') |
2995 | if want_tests != 'false' | |
2996 | test('sysv-generator-test', | |
2997 | sysv_generator_test_py, | |
2998 | depends : exe) | |
2999 | endif | |
3000 | ||
6164ec4c ZJS |
3001 | executable( |
3002 | 'systemd-rc-local-generator', | |
3003 | 'src/rc-local-generator/rc-local-generator.c', | |
3004 | include_directories : includes, | |
3005 | link_with : [libshared], | |
5fb22561 | 3006 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3007 | install : true, |
3008 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
3009 | endif |
3010 | ||
8feca247 BB |
3011 | if conf.get('ENABLE_XDG_AUTOSTART') == 1 |
3012 | executable( | |
3013 | 'systemd-xdg-autostart-generator', | |
0275e918 | 3014 | systemd_xdg_autostart_generator_sources, |
8feca247 BB |
3015 | include_directories : includes, |
3016 | link_with : [libshared], | |
5fb22561 | 3017 | install_rpath : rootpkglibdir, |
8feca247 BB |
3018 | install : true, |
3019 | install_dir : usergeneratordir) | |
3020 | ||
3021 | executable( | |
3022 | 'systemd-xdg-autostart-condition', | |
3023 | 'src/xdg-autostart-generator/xdg-autostart-condition.c', | |
3024 | include_directories : includes, | |
3025 | link_with : [libshared], | |
5fb22561 | 3026 | install_rpath : rootpkglibdir, |
8feca247 BB |
3027 | install : true, |
3028 | install_dir : rootlibexecdir) | |
3029 | endif | |
3030 | ||
349cc4a5 | 3031 | if conf.get('ENABLE_HOSTNAMED') == 1 |
e3c68924 | 3032 | dbus_programs += executable( |
6164ec4c ZJS |
3033 | 'systemd-hostnamed', |
3034 | 'src/hostname/hostnamed.c', | |
3035 | include_directories : includes, | |
3036 | link_with : [libshared], | |
5fb22561 | 3037 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3038 | install : true, |
3039 | install_dir : rootlibexecdir) | |
3040 | ||
3041 | public_programs += executable( | |
3042 | 'hostnamectl', | |
3043 | 'src/hostname/hostnamectl.c', | |
3044 | include_directories : includes, | |
3045 | link_with : [libshared], | |
3a21c554 | 3046 | dependencies : [versiondep], |
5fb22561 | 3047 | install_rpath : rootpkglibdir, |
6164ec4c | 3048 | install : true) |
5c23128d ZJS |
3049 | endif |
3050 | ||
349cc4a5 ZJS |
3051 | if conf.get('ENABLE_LOCALED') == 1 |
3052 | if conf.get('HAVE_XKBCOMMON') == 1 | |
bfa0ade9 AK |
3053 | # logind will load libxkbcommon.so dynamically on its own, but we still |
3054 | # need to specify where the headers are | |
c47511da ZJS |
3055 | deps = [libdl, |
3056 | libxkbcommon.partial_dependency(compile_args: true), | |
3057 | versiondep] | |
37efbbd8 | 3058 | else |
c47511da | 3059 | deps = [versiondep] |
37efbbd8 ZJS |
3060 | endif |
3061 | ||
e3c68924 | 3062 | dbus_programs += executable( |
6164ec4c ZJS |
3063 | 'systemd-localed', |
3064 | systemd_localed_sources, | |
bfa0ade9 | 3065 | include_directories : includes, |
6164ec4c ZJS |
3066 | link_with : [libshared], |
3067 | dependencies : deps, | |
5fb22561 | 3068 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3069 | install : true, |
3070 | install_dir : rootlibexecdir) | |
3071 | ||
3072 | public_programs += executable( | |
3073 | 'localectl', | |
3074 | localectl_sources, | |
3075 | include_directories : includes, | |
3076 | link_with : [libshared], | |
3a21c554 | 3077 | dependencies : [versiondep], |
5fb22561 | 3078 | install_rpath : rootpkglibdir, |
6164ec4c | 3079 | install : true) |
5c23128d ZJS |
3080 | endif |
3081 | ||
349cc4a5 | 3082 | if conf.get('ENABLE_TIMEDATED') == 1 |
e3c68924 | 3083 | dbus_programs += executable( |
6164ec4c ZJS |
3084 | 'systemd-timedated', |
3085 | 'src/timedate/timedated.c', | |
3086 | include_directories : includes, | |
3087 | link_with : [libshared], | |
5fb22561 | 3088 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3089 | install : true, |
3090 | install_dir : rootlibexecdir) | |
6129ec85 | 3091 | endif |
5c23128d | 3092 | |
6129ec85 | 3093 | if conf.get('ENABLE_TIMEDATECTL') == 1 |
6164ec4c ZJS |
3094 | public_programs += executable( |
3095 | 'timedatectl', | |
3096 | 'src/timedate/timedatectl.c', | |
3097 | include_directories : includes, | |
5fb22561 | 3098 | install_rpath : rootpkglibdir, |
6164ec4c | 3099 | link_with : [libshared], |
c47511da ZJS |
3100 | dependencies : [libm, |
3101 | versiondep], | |
6164ec4c | 3102 | install : true) |
5c23128d ZJS |
3103 | endif |
3104 | ||
349cc4a5 | 3105 | if conf.get('ENABLE_TIMESYNCD') == 1 |
6164ec4c ZJS |
3106 | executable( |
3107 | 'systemd-timesyncd', | |
3108 | systemd_timesyncd_sources, | |
3109 | include_directories : includes, | |
f5a5284e | 3110 | link_with : [libtimesyncd_core], |
6164ec4c | 3111 | dependencies : [threads, |
c47511da ZJS |
3112 | libm, |
3113 | versiondep], | |
5fb22561 | 3114 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3115 | install : true, |
3116 | install_dir : rootlibexecdir) | |
3117 | ||
3118 | executable( | |
3119 | 'systemd-time-wait-sync', | |
cf242350 | 3120 | 'src/timesync/wait-sync.c', |
6164ec4c | 3121 | include_directories : includes, |
f5a5284e | 3122 | link_with : [libtimesyncd_core], |
5fb22561 | 3123 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3124 | install : true, |
3125 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
3126 | endif |
3127 | ||
349cc4a5 | 3128 | if conf.get('ENABLE_MACHINED') == 1 |
e3c68924 | 3129 | dbus_programs += executable( |
6164ec4c ZJS |
3130 | 'systemd-machined', |
3131 | systemd_machined_sources, | |
3132 | include_directories : includes, | |
3133 | link_with : [libmachine_core, | |
3134 | libshared], | |
5fb22561 | 3135 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3136 | install : true, |
3137 | install_dir : rootlibexecdir) | |
3138 | ||
3139 | public_programs += executable( | |
3140 | 'machinectl', | |
3141 | 'src/machine/machinectl.c', | |
3142 | include_directories : includes, | |
3143 | link_with : [libshared], | |
3144 | dependencies : [threads, | |
3145 | libxz, | |
ef5924aa | 3146 | liblz4, |
c47511da ZJS |
3147 | libzstd, |
3148 | versiondep], | |
5fb22561 | 3149 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3150 | install : true, |
3151 | install_dir : rootbindir) | |
5c23128d ZJS |
3152 | endif |
3153 | ||
349cc4a5 | 3154 | if conf.get('ENABLE_IMPORTD') == 1 |
e3c68924 | 3155 | dbus_programs += executable( |
6164ec4c ZJS |
3156 | 'systemd-importd', |
3157 | systemd_importd_sources, | |
3158 | include_directories : includes, | |
3159 | link_with : [libshared], | |
c47511da ZJS |
3160 | dependencies : [threads, |
3161 | versiondep], | |
5fb22561 | 3162 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3163 | install : true, |
3164 | install_dir : rootlibexecdir) | |
3165 | ||
3166 | systemd_pull = executable( | |
3167 | 'systemd-pull', | |
3168 | systemd_pull_sources, | |
3169 | include_directories : includes, | |
b93f018f ZJS |
3170 | link_with : [libshared, |
3171 | lib_import_common], | |
c47511da | 3172 | dependencies : [libcurl, |
6214d42b | 3173 | lib_openssl_or_gcrypt, |
6164ec4c ZJS |
3174 | libz, |
3175 | libbzip2, | |
c47511da ZJS |
3176 | libxz, |
3177 | versiondep], | |
5fb22561 | 3178 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3179 | install : true, |
3180 | install_dir : rootlibexecdir) | |
3181 | ||
3182 | systemd_import = executable( | |
3183 | 'systemd-import', | |
3184 | systemd_import_sources, | |
3185 | include_directories : includes, | |
b93f018f ZJS |
3186 | link_with : [libshared, |
3187 | lib_import_common], | |
6164ec4c ZJS |
3188 | dependencies : [libcurl, |
3189 | libz, | |
3190 | libbzip2, | |
c47511da ZJS |
3191 | libxz, |
3192 | versiondep], | |
5fb22561 | 3193 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3194 | install : true, |
3195 | install_dir : rootlibexecdir) | |
3196 | ||
3197 | systemd_import_fs = executable( | |
3198 | 'systemd-import-fs', | |
3199 | systemd_import_fs_sources, | |
3200 | include_directories : includes, | |
b93f018f ZJS |
3201 | link_with : [libshared, |
3202 | lib_import_common], | |
3a21c554 | 3203 | dependencies : [versiondep], |
5fb22561 | 3204 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3205 | install : true, |
3206 | install_dir : rootlibexecdir) | |
3207 | ||
3208 | systemd_export = executable( | |
3209 | 'systemd-export', | |
3210 | systemd_export_sources, | |
3211 | include_directories : includes, | |
b93f018f ZJS |
3212 | link_with : [libshared, |
3213 | lib_import_common], | |
6164ec4c ZJS |
3214 | dependencies : [libcurl, |
3215 | libz, | |
3216 | libbzip2, | |
c47511da ZJS |
3217 | libxz, |
3218 | versiondep], | |
5fb22561 | 3219 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3220 | install : true, |
3221 | install_dir : rootlibexecdir) | |
1d7579c4 LP |
3222 | |
3223 | public_programs += [systemd_pull, systemd_import, systemd_import_fs, systemd_export] | |
37efbbd8 ZJS |
3224 | endif |
3225 | ||
349cc4a5 | 3226 | if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1 |
6164ec4c ZJS |
3227 | public_programs += executable( |
3228 | 'systemd-journal-upload', | |
3229 | systemd_journal_upload_sources, | |
3230 | include_directories : includes, | |
3231 | link_with : [libshared], | |
c47511da | 3232 | dependencies : [threads, |
6164ec4c ZJS |
3233 | libcurl, |
3234 | libgnutls, | |
3235 | libxz, | |
ef5924aa | 3236 | liblz4, |
c47511da ZJS |
3237 | libzstd, |
3238 | versiondep], | |
5fb22561 | 3239 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3240 | install : true, |
3241 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
3242 | endif |
3243 | ||
349cc4a5 | 3244 | if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 |
6164ec4c ZJS |
3245 | public_programs += executable( |
3246 | 'systemd-journal-remote', | |
3247 | systemd_journal_remote_sources, | |
035b0f8f | 3248 | include_directories : journal_includes, |
6164ec4c ZJS |
3249 | link_with : [libshared, |
3250 | libsystemd_journal_remote], | |
3251 | dependencies : [threads, | |
3252 | libmicrohttpd, | |
3253 | libgnutls, | |
3254 | libxz, | |
ef5924aa | 3255 | liblz4, |
c47511da ZJS |
3256 | libzstd, |
3257 | versiondep], | |
5fb22561 | 3258 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3259 | install : true, |
3260 | install_dir : rootlibexecdir) | |
3261 | ||
3262 | public_programs += executable( | |
3263 | 'systemd-journal-gatewayd', | |
3264 | systemd_journal_gatewayd_sources, | |
035b0f8f | 3265 | include_directories : journal_includes, |
6164ec4c ZJS |
3266 | link_with : [libshared], |
3267 | dependencies : [threads, | |
3268 | libmicrohttpd, | |
3269 | libgnutls, | |
3270 | libxz, | |
ef5924aa | 3271 | liblz4, |
c47511da ZJS |
3272 | libzstd, |
3273 | versiondep], | |
5fb22561 | 3274 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3275 | install : true, |
3276 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
3277 | endif |
3278 | ||
349cc4a5 | 3279 | if conf.get('ENABLE_COREDUMP') == 1 |
6164ec4c ZJS |
3280 | executable( |
3281 | 'systemd-coredump', | |
3282 | systemd_coredump_sources, | |
3283 | include_directories : includes, | |
acc50c92 LP |
3284 | link_with : [libshared, |
3285 | libbasic_compress], | |
6164ec4c ZJS |
3286 | dependencies : [threads, |
3287 | libacl, | |
6164ec4c | 3288 | libxz, |
ef5924aa | 3289 | liblz4, |
c47511da ZJS |
3290 | libzstd, |
3291 | versiondep], | |
5fb22561 | 3292 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3293 | install : true, |
3294 | install_dir : rootlibexecdir) | |
3295 | ||
3296 | public_programs += executable( | |
3297 | 'coredumpctl', | |
3298 | coredumpctl_sources, | |
3299 | include_directories : includes, | |
acc50c92 LP |
3300 | link_with : [libshared, |
3301 | libbasic_compress], | |
6164ec4c ZJS |
3302 | dependencies : [threads, |
3303 | libxz, | |
ef5924aa | 3304 | liblz4, |
c47511da ZJS |
3305 | libzstd, |
3306 | versiondep], | |
5fb22561 | 3307 | install_rpath : rootpkglibdir, |
6164ec4c | 3308 | install : true) |
5c23128d ZJS |
3309 | endif |
3310 | ||
9b4abc69 | 3311 | if conf.get('ENABLE_PSTORE') == 1 |
6164ec4c ZJS |
3312 | executable( |
3313 | 'systemd-pstore', | |
3314 | systemd_pstore_sources, | |
3315 | include_directories : includes, | |
3316 | link_with : [libshared], | |
3317 | dependencies : [threads, | |
3318 | libacl, | |
6164ec4c | 3319 | libxz, |
ef5924aa | 3320 | liblz4, |
c47511da ZJS |
3321 | libzstd, |
3322 | versiondep], | |
5fb22561 | 3323 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3324 | install : true, |
3325 | install_dir : rootlibexecdir) | |
9b4abc69 ED |
3326 | endif |
3327 | ||
9de5e321 | 3328 | if conf.get('ENABLE_OOMD') == 1 |
e3c68924 | 3329 | dbus_programs += executable('systemd-oomd', |
9de5e321 AZ |
3330 | systemd_oomd_sources, |
3331 | include_directories : includes, | |
3332 | link_with : [libshared], | |
c47511da ZJS |
3333 | dependencies : [libatomic, |
3334 | versiondep], | |
5fb22561 | 3335 | install_rpath : rootpkglibdir, |
9de5e321 AZ |
3336 | install : true, |
3337 | install_dir : rootlibexecdir) | |
5c616ecf AZ |
3338 | |
3339 | public_programs += executable( | |
ba081955 ZJS |
3340 | 'oomctl', |
3341 | oomctl_sources, | |
3342 | include_directories : includes, | |
3343 | link_with : [libshared], | |
c47511da | 3344 | dependencies : [versiondep], |
5fb22561 | 3345 | install_rpath : rootpkglibdir, |
cfd4c84a | 3346 | install : true) |
9de5e321 AZ |
3347 | endif |
3348 | ||
349cc4a5 | 3349 | if conf.get('ENABLE_BINFMT') == 1 |
6164ec4c ZJS |
3350 | public_programs += executable( |
3351 | 'systemd-binfmt', | |
3352 | 'src/binfmt/binfmt.c', | |
3353 | include_directories : includes, | |
3354 | link_with : [libshared], | |
3a21c554 | 3355 | dependencies : [versiondep], |
5fb22561 | 3356 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3357 | install : true, |
3358 | install_dir : rootlibexecdir) | |
37efbbd8 | 3359 | |
7c22f07c ZJS |
3360 | meson.add_install_script('sh', '-c', |
3361 | mkdir_p.format(binfmtdir)) | |
d7aa78c3 | 3362 | if install_sysconfdir |
7c22f07c | 3363 | meson.add_install_script('sh', '-c', |
fce9abb2 | 3364 | mkdir_p.format(sysconfdir / 'binfmt.d')) |
d7aa78c3 | 3365 | endif |
37efbbd8 ZJS |
3366 | endif |
3367 | ||
43cc7a3e LP |
3368 | if conf.get('ENABLE_SYSUPDATE') == 1 |
3369 | exe = executable( | |
3370 | 'systemd-sysupdate', | |
3371 | systemd_sysupdate_sources, | |
3372 | include_directories : includes, | |
f8cf3d19 LP |
3373 | link_with : [libshared, |
3374 | libshared_fdisk], | |
43cc7a3e LP |
3375 | dependencies : [threads, |
3376 | libblkid, | |
3377 | libfdisk, | |
c47511da ZJS |
3378 | libopenssl, |
3379 | versiondep], | |
5fb22561 | 3380 | install_rpath : rootpkglibdir, |
43cc7a3e LP |
3381 | install : true, |
3382 | install_dir : rootlibexecdir) | |
3383 | public_programs += exe | |
3384 | endif | |
3385 | ||
349cc4a5 | 3386 | if conf.get('ENABLE_VCONSOLE') == 1 |
6164ec4c ZJS |
3387 | executable( |
3388 | 'systemd-vconsole-setup', | |
3389 | 'src/vconsole/vconsole-setup.c', | |
3390 | include_directories : includes, | |
3391 | link_with : [libshared], | |
5fb22561 | 3392 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3393 | install : true, |
3394 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
3395 | endif |
3396 | ||
349cc4a5 | 3397 | if conf.get('ENABLE_RANDOMSEED') == 1 |
6164ec4c ZJS |
3398 | executable( |
3399 | 'systemd-random-seed', | |
3400 | 'src/random-seed/random-seed.c', | |
3401 | include_directories : includes, | |
3402 | link_with : [libshared], | |
3a21c554 | 3403 | dependencies : [versiondep], |
5fb22561 | 3404 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3405 | install : true, |
3406 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
3407 | endif |
3408 | ||
349cc4a5 | 3409 | if conf.get('ENABLE_FIRSTBOOT') == 1 |
3761002e | 3410 | public_programs += executable( |
6164ec4c ZJS |
3411 | 'systemd-firstboot', |
3412 | 'src/firstboot/firstboot.c', | |
3413 | include_directories : includes, | |
3414 | link_with : [libshared], | |
c47511da ZJS |
3415 | dependencies : [libcrypt, |
3416 | versiondep], | |
5fb22561 | 3417 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3418 | install : true, |
3419 | install_dir : rootbindir) | |
3420 | endif | |
3421 | ||
3422 | executable( | |
3423 | 'systemd-remount-fs', | |
3424 | 'src/remount-fs/remount-fs.c', | |
3425 | include_directories : includes, | |
bac11cd6 | 3426 | link_with : [libshared], |
c47511da | 3427 | dependencies : [versiondep], |
5fb22561 | 3428 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3429 | install : true, |
3430 | install_dir : rootlibexecdir) | |
5c23128d | 3431 | |
6164ec4c ZJS |
3432 | executable( |
3433 | 'systemd-machine-id-setup', | |
3434 | 'src/machine-id-setup/machine-id-setup-main.c', | |
3435 | include_directories : includes, | |
bac11cd6 | 3436 | link_with : [libshared], |
c47511da | 3437 | dependencies : [versiondep], |
5fb22561 | 3438 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3439 | install : true, |
3440 | install_dir : rootbindir) | |
5c23128d | 3441 | |
6164ec4c ZJS |
3442 | executable( |
3443 | 'systemd-fsck', | |
3444 | 'src/fsck/fsck.c', | |
3445 | include_directories : includes, | |
3446 | link_with : [libshared], | |
c47511da | 3447 | dependencies : [versiondep], |
5fb22561 | 3448 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3449 | install : true, |
3450 | install_dir : rootlibexecdir) | |
5c23128d | 3451 | |
c47511da ZJS |
3452 | executable( |
3453 | 'systemd-growfs', | |
3454 | 'src/partition/growfs.c', | |
3455 | include_directories : includes, | |
3456 | link_with : [libshared], | |
3457 | dependencies : [versiondep], | |
3458 | install_rpath : rootpkglibdir, | |
3459 | install : true, | |
3460 | install_dir : rootlibexecdir) | |
80750adb | 3461 | |
6164ec4c ZJS |
3462 | executable( |
3463 | 'systemd-makefs', | |
3464 | 'src/partition/makefs.c', | |
3465 | include_directories : includes, | |
3466 | link_with : [libshared], | |
c47511da | 3467 | dependencies : [versiondep], |
5fb22561 | 3468 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3469 | install : true, |
3470 | install_dir : rootlibexecdir) | |
b7f28ac5 | 3471 | |
6164ec4c ZJS |
3472 | executable( |
3473 | 'systemd-sleep', | |
3474 | 'src/sleep/sleep.c', | |
3475 | include_directories : includes, | |
3476 | link_with : [libshared], | |
c47511da | 3477 | dependencies : [versiondep], |
5fb22561 | 3478 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3479 | install : true, |
3480 | install_dir : rootlibexecdir) | |
5c23128d | 3481 | |
225d08b8 | 3482 | if install_sysconfdir_samples |
d7aa78c3 JT |
3483 | install_data('src/sleep/sleep.conf', |
3484 | install_dir : pkgsysconfdir) | |
3485 | endif | |
d25e127d | 3486 | |
6164ec4c ZJS |
3487 | public_programs += executable( |
3488 | 'systemd-sysctl', | |
3489 | 'src/sysctl/sysctl.c', | |
3490 | include_directories : includes, | |
3491 | link_with : [libshared], | |
c47511da | 3492 | dependencies : [versiondep], |
5fb22561 | 3493 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3494 | install : true, |
3495 | install_dir : rootlibexecdir) | |
5c23128d | 3496 | |
251dc2f1 | 3497 | public_programs += executable( |
6164ec4c ZJS |
3498 | 'systemd-ac-power', |
3499 | 'src/ac-power/ac-power.c', | |
3500 | include_directories : includes, | |
3501 | link_with : [libshared], | |
c47511da | 3502 | dependencies : [versiondep], |
5fb22561 | 3503 | install_rpath : rootpkglibdir, |
251dc2f1 | 3504 | install : true) |
5c23128d | 3505 | |
6164ec4c ZJS |
3506 | public_programs += executable( |
3507 | 'systemd-detect-virt', | |
3508 | 'src/detect-virt/detect-virt.c', | |
3509 | include_directories : includes, | |
3510 | link_with : [libshared], | |
c47511da | 3511 | dependencies : [versiondep], |
5fb22561 | 3512 | install_rpath : rootpkglibdir, |
6164ec4c | 3513 | install : true) |
5c23128d | 3514 | |
6164ec4c ZJS |
3515 | public_programs += executable( |
3516 | 'systemd-delta', | |
3517 | 'src/delta/delta.c', | |
3518 | include_directories : includes, | |
3519 | link_with : [libshared], | |
c47511da | 3520 | dependencies : [versiondep], |
5fb22561 | 3521 | install_rpath : rootpkglibdir, |
6164ec4c | 3522 | install : true) |
5c23128d | 3523 | |
6164ec4c ZJS |
3524 | public_programs += executable( |
3525 | 'systemd-escape', | |
3526 | 'src/escape/escape.c', | |
3527 | include_directories : includes, | |
3528 | link_with : [libshared], | |
c47511da | 3529 | dependencies : [versiondep], |
5fb22561 | 3530 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3531 | install : true, |
3532 | install_dir : rootbindir) | |
3533 | ||
3534 | public_programs += executable( | |
3535 | 'systemd-notify', | |
3536 | 'src/notify/notify.c', | |
3537 | include_directories : includes, | |
3538 | link_with : [libshared], | |
c47511da | 3539 | dependencies : [versiondep], |
5fb22561 | 3540 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3541 | install : true, |
3542 | install_dir : rootbindir) | |
3543 | ||
5945640e LP |
3544 | public_programs += executable( |
3545 | 'systemd-creds', | |
3546 | 'src/creds/creds.c', | |
3547 | include_directories : includes, | |
3548 | link_with : [libshared], | |
3549 | dependencies : [threads, | |
c47511da ZJS |
3550 | libopenssl, |
3551 | versiondep], | |
5fb22561 | 3552 | install_rpath : rootpkglibdir, |
5945640e LP |
3553 | install : true, |
3554 | install_dir : rootbindir) | |
3555 | ||
6164ec4c ZJS |
3556 | executable( |
3557 | 'systemd-volatile-root', | |
3558 | 'src/volatile-root/volatile-root.c', | |
3559 | include_directories : includes, | |
3560 | link_with : [libshared], | |
5fb22561 | 3561 | install_rpath : rootpkglibdir, |
cdf7ad38 | 3562 | install : conf.get('ENABLE_INITRD') == 1, |
6164ec4c ZJS |
3563 | install_dir : rootlibexecdir) |
3564 | ||
3565 | executable( | |
3566 | 'systemd-cgroups-agent', | |
3567 | 'src/cgroups-agent/cgroups-agent.c', | |
3568 | include_directories : includes, | |
3569 | link_with : [libshared], | |
5fb22561 | 3570 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3571 | install : true, |
3572 | install_dir : rootlibexecdir) | |
3573 | ||
2a2d002f | 3574 | systemd_id128 = executable( |
6164ec4c ZJS |
3575 | 'systemd-id128', |
3576 | 'src/id128/id128.c', | |
3577 | include_directories : includes, | |
3578 | link_with : [libshared], | |
3a21c554 | 3579 | dependencies : [versiondep], |
5fb22561 | 3580 | install_rpath : rootpkglibdir, |
6164ec4c | 3581 | install : true) |
2a2d002f ZJS |
3582 | public_programs += systemd_id128 |
3583 | ||
3584 | if want_tests != 'false' | |
3585 | test('test-systemctl-enable', | |
3586 | test_systemctl_enable_sh, | |
3587 | # https://github.com/mesonbuild/meson/issues/2681 | |
3588 | args : [systemctl.full_path(), | |
3589 | systemd_id128.full_path()]) | |
3590 | endif | |
6164ec4c ZJS |
3591 | |
3592 | public_programs += executable( | |
3593 | 'systemd-path', | |
3594 | 'src/path/path.c', | |
3595 | include_directories : includes, | |
3596 | link_with : [libshared], | |
3a21c554 | 3597 | dependencies : [versiondep], |
5fb22561 | 3598 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3599 | install : true) |
3600 | ||
3601 | public_programs += executable( | |
3602 | 'systemd-ask-password', | |
3603 | 'src/ask-password/ask-password.c', | |
3604 | include_directories : includes, | |
3605 | link_with : [libshared], | |
3a21c554 | 3606 | dependencies : [versiondep], |
5fb22561 | 3607 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3608 | install : true, |
3609 | install_dir : rootbindir) | |
3610 | ||
3611 | executable( | |
3612 | 'systemd-reply-password', | |
3613 | 'src/reply-password/reply-password.c', | |
3614 | include_directories : includes, | |
3615 | link_with : [libshared], | |
5fb22561 | 3616 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3617 | install : true, |
3618 | install_dir : rootlibexecdir) | |
3619 | ||
3620 | public_programs += executable( | |
3621 | 'systemd-tty-ask-password-agent', | |
3622 | 'src/tty-ask-password-agent/tty-ask-password-agent.c', | |
3623 | include_directories : includes, | |
3624 | link_with : [libshared], | |
3a21c554 | 3625 | dependencies : [versiondep], |
5fb22561 | 3626 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3627 | install : true, |
3628 | install_dir : rootbindir) | |
3629 | ||
3630 | public_programs += executable( | |
3631 | 'systemd-cgls', | |
3632 | 'src/cgls/cgls.c', | |
3633 | include_directories : includes, | |
3634 | link_with : [libshared], | |
3a21c554 | 3635 | dependencies : [versiondep], |
5fb22561 | 3636 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3637 | install : true) |
3638 | ||
3639 | public_programs += executable( | |
3640 | 'systemd-cgtop', | |
3641 | 'src/cgtop/cgtop.c', | |
3642 | include_directories : includes, | |
3643 | link_with : [libshared], | |
3a21c554 | 3644 | dependencies : [versiondep], |
5fb22561 | 3645 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3646 | install : true) |
3647 | ||
3648 | executable( | |
3649 | 'systemd-initctl', | |
3650 | 'src/initctl/initctl.c', | |
3651 | include_directories : includes, | |
3652 | link_with : [libshared], | |
5fb22561 | 3653 | install_rpath : rootpkglibdir, |
6589a569 | 3654 | install : (conf.get('HAVE_SYSV_COMPAT') == 1), |
6164ec4c | 3655 | install_dir : rootlibexecdir) |
5c23128d | 3656 | |
6164ec4c ZJS |
3657 | public_programs += executable( |
3658 | 'systemd-mount', | |
3659 | 'src/mount/mount-tool.c', | |
3660 | include_directories : includes, | |
3661 | link_with : [libshared], | |
c47511da ZJS |
3662 | dependencies: [libmount, |
3663 | versiondep], | |
5fb22561 | 3664 | install_rpath : rootpkglibdir, |
6164ec4c | 3665 | install : true) |
5c23128d | 3666 | |
7b76fce1 | 3667 | meson.add_install_script(meson_make_symlink, |
fce9abb2 | 3668 | 'systemd-mount', bindir / 'systemd-umount') |
7b76fce1 | 3669 | |
6164ec4c ZJS |
3670 | public_programs += executable( |
3671 | 'systemd-run', | |
3672 | 'src/run/run.c', | |
3673 | include_directories : includes, | |
3674 | link_with : [libshared], | |
c47511da | 3675 | dependencies : [versiondep], |
5fb22561 | 3676 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3677 | install : true) |
3678 | ||
3679 | public_programs += executable( | |
3680 | 'systemd-stdio-bridge', | |
3681 | 'src/stdio-bridge/stdio-bridge.c', | |
3682 | include_directories : includes, | |
3683 | link_with : [libshared], | |
c47511da ZJS |
3684 | dependencies : [versiondep, |
3685 | versiondep], | |
5fb22561 | 3686 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3687 | install : true) |
3688 | ||
3689 | public_programs += executable( | |
3690 | 'busctl', | |
f98df767 | 3691 | busctl_sources, |
6164ec4c ZJS |
3692 | include_directories : includes, |
3693 | link_with : [libshared], | |
7c4bd9ac | 3694 | dependencies : [versiondep], |
5fb22561 | 3695 | install_rpath : rootpkglibdir, |
6164ec4c | 3696 | install : true) |
5c23128d | 3697 | |
bd7e6aa7 ZJS |
3698 | if enable_sysusers |
3699 | exe = executable( | |
6164ec4c ZJS |
3700 | 'systemd-sysusers', |
3701 | 'src/sysusers/sysusers.c', | |
3702 | include_directories : includes, | |
3703 | link_with : [libshared], | |
c47511da | 3704 | dependencies : [versiondep], |
5fb22561 | 3705 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3706 | install : true, |
3707 | install_dir : rootbindir) | |
bd7e6aa7 ZJS |
3708 | public_programs += exe |
3709 | ||
3710 | if want_tests != 'false' | |
3711 | test('test-sysusers', | |
3712 | test_sysusers_sh, | |
3713 | # https://github.com/mesonbuild/meson/issues/2681 | |
3714 | args : exe.full_path()) | |
3715 | endif | |
8ef8f3d5 FB |
3716 | |
3717 | if have_standalone_binaries | |
bd7e6aa7 | 3718 | exe = executable( |
8ef8f3d5 FB |
3719 | 'systemd-sysusers.standalone', |
3720 | 'src/sysusers/sysusers.c', | |
3721 | include_directories : includes, | |
3537577c | 3722 | c_args : '-DSTANDALONE', |
8ef8f3d5 FB |
3723 | link_with : [libshared_static, |
3724 | libbasic, | |
3725 | libbasic_gcrypt, | |
99b9f8fd | 3726 | libsystemd_static], |
c47511da | 3727 | dependencies : [versiondep], |
8ef8f3d5 FB |
3728 | install : true, |
3729 | install_dir : rootbindir) | |
bd7e6aa7 ZJS |
3730 | public_programs += exe |
3731 | ||
3732 | if want_tests != 'false' | |
3733 | test('test-sysusers.standalone', | |
3734 | test_sysusers_sh, | |
3735 | # https://github.com/mesonbuild/meson/issues/2681 | |
3736 | args : exe.full_path()) | |
3737 | endif | |
8ef8f3d5 | 3738 | endif |
5c23128d ZJS |
3739 | endif |
3740 | ||
349cc4a5 | 3741 | if conf.get('ENABLE_TMPFILES') == 1 |
6164ec4c ZJS |
3742 | exe = executable( |
3743 | 'systemd-tmpfiles', | |
db64ba81 | 3744 | systemd_tmpfiles_sources, |
6164ec4c ZJS |
3745 | include_directories : includes, |
3746 | link_with : [libshared], | |
c47511da ZJS |
3747 | dependencies : [libacl, |
3748 | versiondep], | |
5fb22561 | 3749 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3750 | install : true, |
3751 | install_dir : rootbindir) | |
5a8b1640 | 3752 | public_programs += exe |
d9daae55 | 3753 | |
938be089 ZJS |
3754 | if want_tests != 'false' |
3755 | test('test-systemd-tmpfiles', | |
3756 | test_systemd_tmpfiles_py, | |
3757 | # https://github.com/mesonbuild/meson/issues/2681 | |
3758 | args : exe.full_path()) | |
3759 | endif | |
db64ba81 FB |
3760 | |
3761 | if have_standalone_binaries | |
bf93f24a | 3762 | exe = executable( |
db64ba81 FB |
3763 | 'systemd-tmpfiles.standalone', |
3764 | systemd_tmpfiles_sources, | |
3765 | include_directories : includes, | |
3537577c | 3766 | c_args : '-DSTANDALONE', |
db64ba81 FB |
3767 | link_with : [libshared_static, |
3768 | libbasic, | |
3769 | libbasic_gcrypt, | |
99b9f8fd | 3770 | libsystemd_static], |
c47511da ZJS |
3771 | dependencies : [libacl, |
3772 | versiondep], | |
db64ba81 FB |
3773 | install : true, |
3774 | install_dir : rootbindir) | |
bf93f24a MG |
3775 | public_programs += exe |
3776 | ||
3777 | if want_tests != 'false' | |
3778 | test('test-systemd-tmpfiles.standalone', | |
3779 | test_systemd_tmpfiles_py, | |
3780 | # https://github.com/mesonbuild/meson/issues/2681 | |
3781 | args : exe.full_path()) | |
3782 | endif | |
db64ba81 | 3783 | endif |
5c23128d ZJS |
3784 | endif |
3785 | ||
349cc4a5 | 3786 | if conf.get('ENABLE_HWDB') == 1 |
ecd1bfdd | 3787 | systemd_hwdb = executable( |
6164ec4c ZJS |
3788 | 'systemd-hwdb', |
3789 | 'src/hwdb/hwdb.c', | |
6164ec4c | 3790 | include_directories : includes, |
e4b127e2 | 3791 | link_with : udev_link_with, |
3a21c554 | 3792 | dependencies : [versiondep], |
6164ec4c ZJS |
3793 | install_rpath : udev_rpath, |
3794 | install : true, | |
3795 | install_dir : rootbindir) | |
ecd1bfdd ZJS |
3796 | public_programs += systemd_hwdb |
3797 | ||
3798 | if want_tests != 'false' | |
3799 | test('hwdb-test', | |
3800 | hwdb_test_sh, | |
14056a52 | 3801 | suite : 'dist-check', |
ecd1bfdd ZJS |
3802 | args : [systemd_hwdb.full_path()], |
3803 | timeout : 90) | |
3804 | endif | |
37efbbd8 ZJS |
3805 | endif |
3806 | ||
349cc4a5 | 3807 | if conf.get('ENABLE_QUOTACHECK') == 1 |
6164ec4c ZJS |
3808 | executable( |
3809 | 'systemd-quotacheck', | |
3810 | 'src/quotacheck/quotacheck.c', | |
3811 | include_directories : includes, | |
3812 | link_with : [libshared], | |
5fb22561 | 3813 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3814 | install : true, |
3815 | install_dir : rootlibexecdir) | |
3816 | endif | |
3817 | ||
3818 | public_programs += executable( | |
3819 | 'systemd-socket-proxyd', | |
3820 | 'src/socket-proxy/socket-proxyd.c', | |
3821 | include_directories : includes, | |
3822 | link_with : [libshared], | |
c47511da ZJS |
3823 | dependencies : [threads, |
3824 | versiondep], | |
5fb22561 | 3825 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3826 | install : true, |
3827 | install_dir : rootlibexecdir) | |
5c23128d | 3828 | |
9b264c1d | 3829 | udevadm = executable( |
6164ec4c ZJS |
3830 | 'udevadm', |
3831 | udevadm_sources, | |
6164ec4c | 3832 | include_directories : includes, |
e4b127e2 | 3833 | link_with : [libudevd_core], |
c47511da | 3834 | dependencies : [threads, |
6164ec4c ZJS |
3835 | libkmod, |
3836 | libidn, | |
3837 | libacl, | |
c47511da ZJS |
3838 | libblkid, |
3839 | versiondep], | |
6164ec4c ZJS |
3840 | install_rpath : udev_rpath, |
3841 | install : true, | |
3842 | install_dir : rootbindir) | |
9b264c1d FS |
3843 | public_programs += udevadm |
3844 | ||
3845 | if conf.get('ENABLE_REPART') == 1 | |
3846 | exe = executable( | |
3847 | 'systemd-repart', | |
3848 | systemd_repart_sources, | |
3849 | include_directories : includes, | |
f8cf3d19 LP |
3850 | link_with : [libshared, |
3851 | libshared_fdisk], | |
9b264c1d FS |
3852 | dependencies : [threads, |
3853 | libblkid, | |
b456191d | 3854 | libfdisk, |
c47511da ZJS |
3855 | libopenssl, |
3856 | versiondep], | |
5fb22561 | 3857 | install_rpath : rootpkglibdir, |
9b264c1d FS |
3858 | install : true, |
3859 | install_dir : rootbindir) | |
3860 | public_programs += exe | |
3c3e14a7 ZJS |
3861 | |
3862 | if have_standalone_binaries | |
3863 | exe = executable( | |
3864 | 'systemd-repart.standalone', | |
3865 | systemd_repart_sources, | |
3866 | include_directories : includes, | |
3867 | c_args : '-DSTANDALONE', | |
3868 | link_with : [libshared_static, | |
3869 | libbasic, | |
3870 | libbasic_gcrypt, | |
f8cf3d19 LP |
3871 | libsystemd_static, |
3872 | libshared_fdisk], | |
3c3e14a7 ZJS |
3873 | dependencies : [threads, |
3874 | libblkid, | |
3875 | libfdisk, | |
c47511da ZJS |
3876 | libopenssl, |
3877 | versiondep], | |
3c3e14a7 ZJS |
3878 | install_rpath : rootpkglibdir, |
3879 | install : true, | |
3880 | install_dir : rootbindir) | |
9702d824 | 3881 | public_programs += exe |
3c3e14a7 | 3882 | endif |
9b264c1d | 3883 | endif |
6164ec4c ZJS |
3884 | |
3885 | executable( | |
3886 | 'systemd-shutdown', | |
3887 | systemd_shutdown_sources, | |
3888 | include_directories : includes, | |
bac11cd6 | 3889 | link_with : [libshared], |
c47511da ZJS |
3890 | dependencies : [libmount, |
3891 | versiondep], | |
5fb22561 | 3892 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3893 | install : true, |
3894 | install_dir : rootlibexecdir) | |
3895 | ||
6ed3aca5 ZJS |
3896 | if have_standalone_binaries |
3897 | executable( | |
3898 | 'systemd-shutdown.standalone', | |
3899 | systemd_shutdown_sources, | |
3900 | include_directories : includes, | |
3901 | c_args : '-DSTANDALONE', | |
3902 | link_with : [libshared_static, | |
3903 | libbasic, | |
3904 | libsystemd_static], | |
3905 | dependencies : [libmount, | |
3906 | versiondep], | |
3907 | install_rpath : rootpkglibdir, | |
3908 | install : true, | |
3909 | install_dir : rootlibexecdir) | |
3910 | endif | |
3911 | ||
6164ec4c ZJS |
3912 | executable( |
3913 | 'systemd-update-done', | |
3914 | 'src/update-done/update-done.c', | |
3915 | include_directories : includes, | |
3916 | link_with : [libshared], | |
c47511da | 3917 | dependencies : [versiondep], |
5fb22561 | 3918 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3919 | install : true, |
3920 | install_dir : rootlibexecdir) | |
3921 | ||
3922 | executable( | |
3923 | 'systemd-update-utmp', | |
3924 | 'src/update-utmp/update-utmp.c', | |
3925 | include_directories : includes, | |
3926 | link_with : [libshared], | |
c47511da ZJS |
3927 | dependencies : [libaudit, |
3928 | versiondep], | |
5fb22561 | 3929 | install_rpath : rootpkglibdir, |
55678b9e | 3930 | install : (conf.get('ENABLE_UTMP') == 1), |
6164ec4c | 3931 | install_dir : rootlibexecdir) |
5c23128d | 3932 | |
349cc4a5 | 3933 | if conf.get('HAVE_KMOD') == 1 |
6164ec4c ZJS |
3934 | executable( |
3935 | 'systemd-modules-load', | |
3936 | 'src/modules-load/modules-load.c', | |
3937 | include_directories : includes, | |
3938 | link_with : [libshared], | |
c47511da ZJS |
3939 | dependencies : [libkmod, |
3940 | versiondep], | |
5fb22561 | 3941 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3942 | install : true, |
3943 | install_dir : rootlibexecdir) | |
94e75a54 | 3944 | |
7c22f07c ZJS |
3945 | meson.add_install_script('sh', '-c', |
3946 | mkdir_p.format(modulesloaddir)) | |
d7aa78c3 | 3947 | if install_sysconfdir |
7c22f07c | 3948 | meson.add_install_script('sh', '-c', |
fce9abb2 | 3949 | mkdir_p.format(sysconfdir / 'modules-load.d')) |
d7aa78c3 | 3950 | endif |
5c23128d ZJS |
3951 | endif |
3952 | ||
6164ec4c ZJS |
3953 | public_programs += executable( |
3954 | 'systemd-nspawn', | |
3955 | systemd_nspawn_sources, | |
3956 | include_directories : includes, | |
bac11cd6 | 3957 | link_with : [libnspawn_core, |
6164ec4c ZJS |
3958 | libshared], |
3959 | dependencies : [libblkid, | |
c47511da ZJS |
3960 | libseccomp, |
3961 | versiondep], | |
5fb22561 | 3962 | install_rpath : rootpkglibdir, |
6164ec4c | 3963 | install : true) |
5c23128d | 3964 | |
349cc4a5 | 3965 | if conf.get('ENABLE_NETWORKD') == 1 |
9ff2b35f | 3966 | dbus_programs += executable( |
6164ec4c ZJS |
3967 | 'systemd-networkd', |
3968 | systemd_networkd_sources, | |
8d40961c | 3969 | include_directories : network_includes, |
6164ec4c ZJS |
3970 | link_with : [libnetworkd_core, |
3971 | libsystemd_network, | |
6164ec4c | 3972 | networkd_link_with], |
c47511da ZJS |
3973 | dependencies : [threads, |
3974 | versiondep], | |
5fb22561 | 3975 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3976 | install : true, |
3977 | install_dir : rootlibexecdir) | |
3978 | ||
3761002e | 3979 | public_programs += executable( |
6164ec4c ZJS |
3980 | 'systemd-networkd-wait-online', |
3981 | systemd_networkd_wait_online_sources, | |
3982 | include_directories : includes, | |
8d40961c | 3983 | link_with : [networkd_link_with], |
c47511da | 3984 | dependencies : [versiondep], |
5fb22561 | 3985 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3986 | install : true, |
3987 | install_dir : rootlibexecdir) | |
3988 | ||
3989 | public_programs += executable( | |
3990 | 'networkctl', | |
3991 | networkctl_sources, | |
8d40961c | 3992 | include_directories : libsystemd_network_includes, |
6164ec4c ZJS |
3993 | link_with : [libsystemd_network, |
3994 | networkd_link_with], | |
c47511da | 3995 | dependencies : [versiondep], |
5fb22561 | 3996 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
3997 | install : true, |
3998 | install_dir : rootbindir) | |
987dd89c | 3999 | endif |
6164ec4c | 4000 | |
987dd89c YW |
4001 | exe = executable( |
4002 | 'systemd-network-generator', | |
4003 | network_generator_sources, | |
4004 | include_directories : includes, | |
4005 | link_with : [networkd_link_with], | |
c47511da | 4006 | dependencies : [versiondep], |
5fb22561 | 4007 | install_rpath : rootpkglibdir, |
987dd89c YW |
4008 | install : true, |
4009 | install_dir : rootlibexecdir) | |
fbaa1137 | 4010 | |
987dd89c YW |
4011 | if want_tests != 'false' |
4012 | test('test-network-generator-conversion', | |
4013 | test_network_generator_conversion_sh, | |
4014 | # https://github.com/mesonbuild/meson/issues/2681 | |
e93ada98 DDM |
4015 | args : exe.full_path(), |
4016 | depends : exe) | |
dcfe072a | 4017 | endif |
e821f6a9 | 4018 | |
6164ec4c ZJS |
4019 | executable( |
4020 | 'systemd-sulogin-shell', | |
73e994f2 | 4021 | 'src/sulogin-shell/sulogin-shell.c', |
6164ec4c ZJS |
4022 | include_directories : includes, |
4023 | link_with : [libshared], | |
c47511da | 4024 | dependencies : [versiondep], |
5fb22561 | 4025 | install_rpath : rootpkglibdir, |
6164ec4c ZJS |
4026 | install : true, |
4027 | install_dir : rootlibexecdir) | |
e821f6a9 | 4028 | |
f875e6bc | 4029 | exe = custom_target( |
99d8cbce ZJS |
4030 | 'kernel-install', |
4031 | input : kernel_install_in, | |
4032 | output : 'kernel-install', | |
4033 | command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], | |
4034 | install : want_kernel_install, | |
4035 | install_mode : 'rwxr-xr-x', | |
4036 | install_dir : bindir) | |
f875e6bc ZJS |
4037 | public_programs += exe |
4038 | ||
cc77a565 | 4039 | if want_tests != 'false' and want_kernel_install |
f875e6bc ZJS |
4040 | test('test-kernel-install', |
4041 | test_kernel_install_sh, | |
8702496b | 4042 | env : test_env, |
f875e6bc ZJS |
4043 | args : [exe.full_path(), loaderentry_install]) |
4044 | endif | |
99d8cbce | 4045 | |
30ec2eae ZJS |
4046 | if want_ukify |
4047 | exe = custom_target( | |
4048 | 'ukify', | |
4049 | input : 'src/ukify/ukify.py', | |
4050 | output : 'ukify', | |
4051 | command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], | |
4052 | install : true, | |
4053 | install_mode : 'rwxr-xr-x', | |
4054 | install_dir : rootlibexecdir) | |
4055 | public_programs += exe | |
4056 | endif | |
4057 | ||
69e96427 ZJS |
4058 | ############################################################ |
4059 | ||
e93ada98 | 4060 | runtest_env = custom_target( |
e2d41370 FB |
4061 | 'systemd-runtest.env', |
4062 | output : 'systemd-runtest.env', | |
0f4c4f38 ZJS |
4063 | command : [sh, '-c', |
4064 | '{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format( | |
fce9abb2 ZJS |
4065 | project_source_root / 'test', |
4066 | project_build_root / 'catalog')], | |
e93ada98 | 4067 | depends : catalogs, |
e2d41370 FB |
4068 | build_by_default : true) |
4069 | ||
a626cb15 ZJS |
4070 | test_cflags = ['-DTEST_CODE=1'] |
4071 | # We intentionally do not do inline initializations with definitions for a | |
4072 | # bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we | |
4073 | # use the variable unexpectedly. This triggers a lot of maybe-uninitialized | |
4074 | # false positives when the combination of -O2 and -flto is used. Suppress them. | |
b528a628 | 4075 | if '-O2' in c_args and '-flto=auto' in c_args |
a626cb15 ZJS |
4076 | test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized') |
4077 | endif | |
4078 | ||
c12e10d7 | 4079 | foreach test : simple_tests |
822cd3ff | 4080 | tests += { 'sources' : [test] } |
c12e10d7 JJ |
4081 | endforeach |
4082 | ||
822cd3ff JJ |
4083 | foreach test : tests |
4084 | sources = test.get('sources') | |
4085 | condition = test.get('condition', '') | |
4086 | type = test.get('type', '') | |
4087 | base = test.get('base', {}) | |
37efbbd8 | 4088 | |
e1eeebbb JJ |
4089 | # FIXME: Use fs.stem() with meson >= 0.54.0 |
4090 | name = '@0@'.format(sources[0]).split('/')[-1].split('.')[0] | |
3b2bdd62 | 4091 | |
c3191c6d DDM |
4092 | suite = fs.name(fs.parent('@0@'.format(sources[0]))) |
4093 | # FIXME: Use str.replace() with meson >= 0.58.0 | |
4094 | suite = suite.split('sd-')[-1] | |
4095 | ||
822cd3ff | 4096 | if condition != '' and conf.get(condition) == 0 |
37efbbd8 | 4097 | message('Not compiling @0@ because @1@ is not true'.format(name, condition)) |
822cd3ff JJ |
4098 | continue |
4099 | endif | |
4100 | ||
4101 | exe = executable( | |
4102 | name, | |
4103 | sources, | |
4104 | include_directories : [base.get('includes', []), test.get('includes', includes)], | |
4105 | link_with : [base.get('link_with', []), test.get('link_with', libshared)], | |
4106 | dependencies : [versiondep, base.get('dependencies', []), test.get('dependencies', [])], | |
4107 | c_args : [test_cflags, test.get('c_args', [])], | |
4108 | build_by_default : want_tests != 'false', | |
4109 | install_rpath : rootpkglibdir, | |
4110 | install : install_tests, | |
4111 | install_dir : testsdir / type, | |
4112 | link_depends : runtest_env) | |
4113 | ||
4114 | if type == 'manual' | |
4115 | message('@0@ is a manual test'.format(name)) | |
4116 | elif type == 'unsafe' and want_tests != 'unsafe' | |
4117 | message('@0@ is an unsafe test'.format(name)) | |
4118 | elif want_tests != 'false' | |
4119 | test(name, exe, | |
4120 | env : test_env, | |
4121 | timeout : test.get('timeout', 30), | |
4122 | suite : suite, | |
4123 | is_parallel : test.get('parallel', true)) | |
37efbbd8 | 4124 | endif |
69e96427 ZJS |
4125 | endforeach |
4126 | ||
0632b4cd | 4127 | exe = executable( |
37efbbd8 ZJS |
4128 | 'test-libsystemd-sym', |
4129 | test_libsystemd_sym_c, | |
4130 | include_directories : includes, | |
4131 | link_with : [libsystemd], | |
fd1939fb | 4132 | build_by_default : want_tests != 'false', |
37efbbd8 ZJS |
4133 | install : install_tests, |
4134 | install_dir : testsdir) | |
938be089 ZJS |
4135 | if want_tests != 'false' |
4136 | test('test-libsystemd-sym', exe) | |
4137 | endif | |
37ab1a25 | 4138 | |
0632b4cd ZJS |
4139 | exe = executable( |
4140 | 'test-libsystemd-static-sym', | |
4141 | test_libsystemd_sym_c, | |
4142 | include_directories : includes, | |
0632b4cd ZJS |
4143 | link_with : [install_libsystemd_static], |
4144 | dependencies : [threads], # threads is already included in dependencies on the library, | |
4145 | # but does not seem to get propagated. Add here as a work-around. | |
fd1939fb | 4146 | build_by_default : want_tests != 'false' and static_libsystemd_pic, |
20f3d32d | 4147 | install : install_tests and static_libsystemd_pic, |
0632b4cd | 4148 | install_dir : testsdir) |
938be089 | 4149 | if want_tests != 'false' and static_libsystemd_pic |
0632b4cd ZJS |
4150 | test('test-libsystemd-static-sym', exe) |
4151 | endif | |
37ab1a25 | 4152 | |
0632b4cd | 4153 | exe = executable( |
37efbbd8 ZJS |
4154 | 'test-libudev-sym', |
4155 | test_libudev_sym_c, | |
e4b127e2 | 4156 | include_directories : libudev_includes, |
a626cb15 | 4157 | c_args : ['-Wno-deprecated-declarations'] + test_cflags, |
37efbbd8 | 4158 | link_with : [libudev], |
fd1939fb | 4159 | build_by_default : want_tests != 'false', |
37efbbd8 ZJS |
4160 | install : install_tests, |
4161 | install_dir : testsdir) | |
938be089 ZJS |
4162 | if want_tests != 'false' |
4163 | test('test-libudev-sym', exe) | |
4164 | endif | |
0632b4cd ZJS |
4165 | |
4166 | exe = executable( | |
4167 | 'test-libudev-static-sym', | |
4168 | test_libudev_sym_c, | |
e4b127e2 | 4169 | include_directories : libudev_includes, |
a626cb15 | 4170 | c_args : ['-Wno-deprecated-declarations'] + test_cflags, |
0632b4cd | 4171 | link_with : [install_libudev_static], |
fd1939fb | 4172 | build_by_default : want_tests != 'false' and static_libudev_pic, |
20f3d32d | 4173 | install : install_tests and static_libudev_pic, |
0632b4cd | 4174 | install_dir : testsdir) |
938be089 | 4175 | if want_tests != 'false' and static_libudev_pic |
0632b4cd ZJS |
4176 | test('test-libudev-static-sym', exe) |
4177 | endif | |
e0bec52f | 4178 | |
69e96427 | 4179 | ############################################################ |
5c23128d | 4180 | |
a9a7153c | 4181 | foreach fuzzer : simple_fuzzers |
2ed35b2f | 4182 | fuzzers += { 'sources' : [fuzzer] } |
a9a7153c JJ |
4183 | endforeach |
4184 | ||
7db7d5b7 JR |
4185 | fuzzer_exes = [] |
4186 | ||
2ed35b2f JJ |
4187 | foreach fuzzer : fuzzers |
4188 | sources = fuzzer.get('sources') | |
4189 | base = fuzzer.get('base', {}) | |
4190 | dependencies = [base.get('dependencies', []), fuzzer.get('dependencies', [])] | |
7e299ffe ZJS |
4191 | link_args = [] |
4192 | ||
4193 | if want_ossfuzz | |
4194 | dependencies += fuzzing_engine | |
4195 | elif want_libfuzzer | |
4196 | if fuzzing_engine.found() | |
9c5c4677 EV |
4197 | dependencies += fuzzing_engine |
4198 | else | |
7e299ffe | 4199 | link_args += ['-fsanitize=fuzzer'] |
9c5c4677 | 4200 | endif |
7e299ffe | 4201 | else |
2ed35b2f | 4202 | sources += files('src/fuzz/fuzz-main.c') |
7e299ffe | 4203 | endif |
7e343b53 | 4204 | sources += fuzz_generated_directives |
7db7d5b7 | 4205 | |
bbec46c8 JJ |
4206 | # FIXME: Use fs.stem() with meson >= 0.54.0 |
4207 | name = '@0@'.format(sources[0]).split('/')[-1].split('.')[0] | |
7db7d5b7 | 4208 | |
f78ad5f0 | 4209 | exe = executable( |
7e299ffe ZJS |
4210 | name, |
4211 | sources, | |
2ed35b2f JJ |
4212 | include_directories : [ |
4213 | base.get('includes', []), | |
4214 | fuzzer.get('includes', includes), | |
4215 | include_directories('src/fuzz'), | |
4216 | ], | |
4217 | link_with : [base.get('link_with', []), fuzzer.get('link_with', libshared)], | |
4218 | dependencies : [dependencies, versiondep], | |
4219 | c_args : [test_cflags, fuzzer.get('c_args', [])], | |
7e299ffe ZJS |
4220 | link_args: link_args, |
4221 | install : false, | |
f78ad5f0 ZJS |
4222 | build_by_default : fuzzer_build) |
4223 | fuzzer_exes += exe | |
4224 | ||
7db5761d | 4225 | if want_tests != 'false' and name in fuzz_regression_tests |
f78ad5f0 ZJS |
4226 | # Run the fuzz regression tests without any sanitizers enabled. |
4227 | # Additional invocations with sanitizers may be added below. | |
7e343b53 MK |
4228 | foreach tuple : fuzz_regression_tests[name] |
4229 | fuzz_dir = tuple[0] | |
4230 | fuzz_in = tuple[1] | |
7db5761d MK |
4231 | test('@0@_@1@'.format(name, fuzz_in), |
4232 | exe, | |
4233 | suite : 'fuzzers', | |
7e343b53 MK |
4234 | args : [fuzz_dir != '' ? project_source_root / fuzz_dir / name / fuzz_in |
4235 | : fuzz_generated_in_dir / '@0@_@1@'.format(name, fuzz_in)]) | |
f78ad5f0 ZJS |
4236 | endforeach |
4237 | endif | |
7e299ffe | 4238 | endforeach |
7db7d5b7 | 4239 | |
6839ce33 | 4240 | alias_target('fuzzers', fuzzer_exes) |
7db7d5b7 JR |
4241 | |
4242 | ############################################################ | |
4243 | ||
10783aef ZJS |
4244 | subdir('docs/sysvinit') |
4245 | subdir('docs/var-log') | |
4246 | subdir('hwdb.d') | |
4247 | subdir('man') | |
378e9d2b | 4248 | subdir('modprobe.d') |
10783aef ZJS |
4249 | subdir('network') |
4250 | subdir('presets') | |
4251 | subdir('shell-completion/bash') | |
4252 | subdir('shell-completion/zsh') | |
5c23128d ZJS |
4253 | subdir('sysctl.d') |
4254 | subdir('sysusers.d') | |
4255 | subdir('tmpfiles.d') | |
4f10b807 | 4256 | subdir('units') |
5c23128d | 4257 | |
5c23128d ZJS |
4258 | install_subdir('factory/etc', |
4259 | install_dir : factorydir) | |
623370e6 | 4260 | subdir('factory/templates') |
5c23128d | 4261 | |
d7aa78c3 JT |
4262 | if install_sysconfdir |
4263 | install_data('xorg/50-systemd-user.sh', | |
4264 | install_dir : xinitrcdir) | |
4265 | endif | |
f09eb768 | 4266 | install_data('LICENSE.GPL2', |
5c23128d | 4267 | 'LICENSE.LGPL2.1', |
f09eb768 LP |
4268 | 'NEWS', |
4269 | 'README', | |
eea98402 | 4270 | 'docs/CODING_STYLE.md', |
1d1cb168 | 4271 | 'docs/DISTRO_PORTING.md', |
9e825ebf | 4272 | 'docs/ENVIRONMENT.md', |
5425f8a5 | 4273 | 'docs/HACKING.md', |
9e825ebf | 4274 | 'docs/TRANSIENT-SETTINGS.md', |
b6dc0d7d | 4275 | 'docs/TRANSLATORS.md', |
9e825ebf | 4276 | 'docs/UIDS-GIDS.md', |
5c23128d | 4277 | install_dir : docdir) |
d68b342b | 4278 | |
9c6e32a2 LB |
4279 | install_subdir('LICENSES', |
4280 | install_dir : docdir) | |
4281 | ||
7c22f07c ZJS |
4282 | meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir)) |
4283 | meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir)) | |
94e75a54 | 4284 | |
d68b342b ZJS |
4285 | ############################################################ |
4286 | ||
2d4efd1d LB |
4287 | # Ensure that changes to the docs/ directory do not break the |
4288 | # basic Github pages build. But only run it in developer mode, | |
4289 | # as it might be fragile due to changes in the tooling, and it is | |
4290 | # not generally useful for users. | |
4291 | jekyll = find_program('jekyll', required : false) | |
4292 | if get_option('mode') == 'developer' and want_tests != 'false' and jekyll.found() | |
4293 | test('github-pages', | |
4294 | jekyll, | |
14056a52 | 4295 | suite : 'dist-check', |
2d4efd1d | 4296 | args : ['build', |
fce9abb2 ZJS |
4297 | '--source', project_source_root / 'docs', |
4298 | '--destination', project_build_root / '_site']) | |
2d4efd1d LB |
4299 | endif |
4300 | ||
4301 | ############################################################ | |
4302 | ||
dd1e33c8 | 4303 | check_help = find_program('tools/check-help.sh') |
ffb7406b | 4304 | check_version = find_program('tools/check-version.sh') |
005a29f2 ZJS |
4305 | |
4306 | foreach exec : public_programs | |
37efbbd8 | 4307 | name = exec.full_path().split('/')[-1] |
938be089 ZJS |
4308 | if want_tests != 'false' |
4309 | test('check-help-' + name, | |
dd1e33c8 | 4310 | check_help, |
14056a52 | 4311 | suite : 'dist-check', |
e93ada98 DDM |
4312 | args : exec.full_path(), |
4313 | depends: exec) | |
ffb7406b ZJS |
4314 | |
4315 | test('check-version-' + name, | |
4316 | check_version, | |
14056a52 | 4317 | suite : 'dist-check', |
ffb7406b ZJS |
4318 | args : [exec.full_path(), |
4319 | meson.project_version()], | |
4320 | depends: exec) | |
938be089 | 4321 | endif |
005a29f2 ZJS |
4322 | endforeach |
4323 | ||
52d4d1d3 | 4324 | # Enable tests for all supported sanitizers |
7db5761d | 4325 | foreach tuple : fuzz_sanitizers |
52d4d1d3 ZJS |
4326 | sanitizer = tuple[0] |
4327 | build = tuple[1] | |
b68dfb9e | 4328 | |
7a6397d2 | 4329 | if cc.has_link_argument('-fsanitize=@0@'.format(sanitizer)) |
7db5761d MK |
4330 | foreach fuzzer, fuzz_ins : fuzz_regression_tests |
4331 | name = '@0@:@1@'.format(fuzzer, sanitizer) | |
4332 | if want_tests == 'false' | |
4333 | message('Not compiling @0@ because tests is set to false'.format(name)) | |
4334 | continue | |
52d4d1d3 | 4335 | endif |
7db5761d MK |
4336 | if not fuzz_tests |
4337 | message('Not compiling @0@ because fuzz-tests is set to false'.format(name)) | |
4338 | continue | |
4339 | endif | |
4340 | exe = custom_target( | |
4341 | name, | |
4342 | output : name, | |
7e343b53 | 4343 | depends : [build] + fuzz_generated_directives, |
7db5761d MK |
4344 | command : [ln, '-fs', |
4345 | build.full_path() / fuzzer, | |
4346 | '@OUTPUT@'], | |
4347 | build_by_default : true) | |
4348 | ||
7e343b53 MK |
4349 | foreach tuple : fuzz_ins |
4350 | fuzz_dir = tuple[0] | |
4351 | fuzz_in = tuple[1] | |
4352 | ||
7db5761d | 4353 | test('@0@_@1@_@2@'.format(fuzzer, fuzz_in, sanitizer), |
52d4d1d3 | 4354 | env, |
14056a52 | 4355 | suite : 'fuzz+san', |
89767158 EV |
4356 | env : ['UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1'], |
4357 | timeout : 60, | |
52d4d1d3 | 4358 | args : [exe.full_path(), |
7e343b53 MK |
4359 | fuzz_dir != '' ? project_source_root / fuzz_dir / fuzzer / fuzz_in |
4360 | : fuzz_generated_in_dir / '@0@_@1@'.format(fuzzer, fuzz_in)]) | |
7db5761d | 4361 | endforeach |
52d4d1d3 | 4362 | endforeach |
b68dfb9e ZJS |
4363 | endif |
4364 | endforeach | |
4365 | ||
52d4d1d3 | 4366 | |
b68dfb9e ZJS |
4367 | ############################################################ |
4368 | ||
0700e8ba | 4369 | if git.found() |
37efbbd8 | 4370 | all_files = run_command( |
0f4c4f38 ZJS |
4371 | env, '-u', 'GIT_WORK_TREE', |
4372 | git, '--git-dir=@0@/.git'.format(project_source_root), | |
e92777d2 ZJS |
4373 | 'ls-files', ':/*.[ch]', |
4374 | check : false) | |
4375 | if all_files.returncode() == 0 | |
4376 | all_files = files(all_files.stdout().split()) | |
4377 | ||
4378 | custom_target( | |
4379 | 'tags', | |
4380 | output : 'tags', | |
4381 | command : [env, 'etags', '-o', '@0@/TAGS'.format(project_source_root)] + all_files) | |
4382 | run_target( | |
4383 | 'ctags', | |
691db9a7 | 4384 | command : [env, 'ctags', '--tag-relative=never', '-o', '@0@/tags'.format(project_source_root)] + all_files) |
e92777d2 | 4385 | endif |
d68b342b | 4386 | endif |
177929c2 ZJS |
4387 | |
4388 | if git.found() | |
dd1e33c8 | 4389 | git_contrib_sh = find_program('tools/git-contrib.sh') |
a923e085 | 4390 | run_target( |
37efbbd8 | 4391 | 'git-contrib', |
dd1e33c8 | 4392 | command : [git_contrib_sh]) |
177929c2 | 4393 | endif |
dd6ab3df ZJS |
4394 | |
4395 | if git.found() | |
4396 | git_head = run_command( | |
e92777d2 ZJS |
4397 | git, '--git-dir=@0@/.git'.format(project_source_root), |
4398 | 'rev-parse', 'HEAD', | |
4399 | check : false).stdout().strip() | |
dd6ab3df | 4400 | git_head_short = run_command( |
e92777d2 ZJS |
4401 | git, '--git-dir=@0@/.git'.format(project_source_root), |
4402 | 'rev-parse', '--short=7', 'HEAD', | |
4403 | check : false).stdout().strip() | |
dd6ab3df ZJS |
4404 | |
4405 | run_target( | |
4406 | 'git-snapshot', | |
0f4c4f38 | 4407 | command : [git, 'archive', |
1485aacb | 4408 | '-o', '@0@/systemd-@1@.tar.gz'.format(project_source_root, |
dd6ab3df ZJS |
4409 | git_head_short), |
4410 | '--prefix', 'systemd-@0@/'.format(git_head), | |
4411 | 'HEAD']) | |
4412 | endif | |
829257d1 ZJS |
4413 | |
4414 | ############################################################ | |
4415 | ||
dd1e33c8 | 4416 | check_api_docs_sh = find_program('tools/check-api-docs.sh') |
51b13863 LP |
4417 | run_target( |
4418 | 'check-api-docs', | |
4419 | depends : [man, libsystemd, libudev], | |
dd1e33c8 | 4420 | command : [check_api_docs_sh, libsystemd.full_path(), libudev.full_path()]) |
51b13863 | 4421 | |
f12c5d36 ZJS |
4422 | alias_target('update-dbus-docs', update_dbus_docs) |
4423 | alias_target('update-man-rules', update_man_rules) | |
e3c368f6 | 4424 | |
0628d48e LB |
4425 | if not meson.is_cross_build() |
4426 | custom_target( | |
4427 | 'export-dbus-interfaces', | |
4645074e | 4428 | output : fs.name(dbus_interfaces_dir), |
0628d48e | 4429 | install : dbus_interfaces_dir != 'no', |
4645074e | 4430 | install_dir : fs.parent(dbus_interfaces_dir), |
0628d48e LB |
4431 | command : [export_dbus_interfaces_py, '@OUTPUT@', dbus_programs]) |
4432 | endif | |
e3c68924 | 4433 | |
51b13863 | 4434 | ############################################################ |
829257d1 | 4435 | |
e92777d2 ZJS |
4436 | alt_time_epoch = run_command('date', '-Is', '-u', '-d', '@@0@'.format(time_epoch), |
4437 | check : true).stdout().strip() | |
12085ebb ZJS |
4438 | |
4439 | summary({ | |
12085ebb ZJS |
4440 | 'split /usr' : split_usr, |
4441 | 'split bin-sbin' : split_bin, | |
4442 | 'prefix directory' : prefixdir, | |
4443 | 'rootprefix directory' : rootprefixdir, | |
4444 | 'sysconf directory' : sysconfdir, | |
4445 | 'include directory' : includedir, | |
4446 | 'lib directory' : libdir, | |
4447 | 'rootlib directory' : rootlibdir, | |
4448 | 'SysV init scripts' : sysvinit_path, | |
4449 | 'SysV rc?.d directories' : sysvrcnd_path, | |
4450 | 'PAM modules directory' : pamlibdir, | |
4451 | 'PAM configuration directory' : pamconfdir, | |
4452 | 'libcryptsetup plugins directory' : libcryptsetup_plugins_dir, | |
4453 | 'RPM macros directory' : rpmmacrosdir, | |
4454 | 'modprobe.d directory' : modprobedir, | |
4455 | 'D-Bus policy directory' : dbuspolicydir, | |
4456 | 'D-Bus session directory' : dbussessionservicedir, | |
4457 | 'D-Bus system directory' : dbussystemservicedir, | |
7e560e79 | 4458 | 'D-Bus interfaces directory' : dbus_interfaces_dir, |
12085ebb ZJS |
4459 | 'bash completions directory' : bashcompletiondir, |
4460 | 'zsh completions directory' : zshcompletiondir, | |
a2b0cd3f | 4461 | 'private shared lib version tag' : shared_lib_tag, |
12085ebb ZJS |
4462 | 'extra start script' : get_option('rc-local'), |
4463 | 'debug shell' : '@0@ @ @1@'.format(get_option('debug-shell'), | |
4464 | get_option('debug-tty')), | |
4465 | 'system UIDs' : '<=@0@ (alloc >=@1@)'.format(conf.get('SYSTEM_UID_MAX'), | |
4466 | conf.get('SYSTEM_ALLOC_UID_MIN')), | |
4467 | 'system GIDs' : '<=@0@ (alloc >=@1@)'.format(conf.get('SYSTEM_GID_MAX'), | |
4468 | conf.get('SYSTEM_ALLOC_GID_MIN')), | |
4469 | 'dynamic UIDs' : '@0@…@1@'.format(dynamic_uid_min, dynamic_uid_max), | |
4470 | 'container UID bases' : '@0@…@1@'.format(container_uid_base_min, container_uid_base_max), | |
4471 | 'static UID/GID allocations' : ' '.join(static_ugids), | |
4472 | '/dev/kvm access mode' : get_option('dev-kvm-mode'), | |
4473 | 'render group access mode' : get_option('group-render-mode'), | |
4474 | 'certificate root directory' : get_option('certificate-root'), | |
4475 | 'support URL' : support_url, | |
4476 | 'nobody user name' : nobody_user, | |
4477 | 'nobody group name' : nobody_group, | |
4478 | 'fallback hostname' : get_option('fallback-hostname'), | |
9798deaf | 4479 | 'default compression method' : compression, |
12085ebb ZJS |
4480 | 'default DNSSEC mode' : default_dnssec, |
4481 | 'default DNS-over-TLS mode' : default_dns_over_tls, | |
4482 | 'default mDNS mode' : default_mdns, | |
4483 | 'default LLMNR mode' : default_llmnr, | |
4484 | 'default DNS servers' : dns_servers.split(' '), | |
4485 | 'default NTP servers' : ntp_servers.split(' '), | |
4486 | 'default cgroup hierarchy' : default_hierarchy, | |
4487 | 'default net.naming-scheme value' : default_net_naming_scheme, | |
4488 | 'default KillUserProcesses value' : kill_user_processes, | |
4489 | 'default locale' : default_locale, | |
88b6f0de | 4490 | 'default nspawn locale' : nspawn_locale, |
79dec86a | 4491 | 'default status unit format' : status_unit_format_default, |
12085ebb ZJS |
4492 | 'default user $PATH' : |
4493 | default_user_path != '' ? default_user_path : '(same as system services)', | |
4494 | 'systemd service watchdog' : service_watchdog == '' ? 'disabled' : service_watchdog, | |
4495 | 'time epoch' : '@0@ (@1@)'.format(time_epoch, alt_time_epoch)}) | |
829257d1 ZJS |
4496 | |
4497 | # TODO: | |
4498 | # CFLAGS: ${OUR_CFLAGS} ${CFLAGS} | |
4499 | # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} | |
4500 | # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS} | |
4501 | ||
829257d1 ZJS |
4502 | found = [] |
4503 | missing = [] | |
4504 | ||
4505 | foreach tuple : [ | |
56d68e71 ZJS |
4506 | # dependencies |
4507 | ['ACL'], | |
829257d1 | 4508 | ['AUDIT'], |
829257d1 | 4509 | ['AppArmor'], |
56d68e71 ZJS |
4510 | ['IMA'], |
4511 | ['PAM'], | |
829257d1 | 4512 | ['SECCOMP'], |
56d68e71 | 4513 | ['SELinux'], |
829257d1 | 4514 | ['SMACK'], |
56d68e71 ZJS |
4515 | ['blkid'], |
4516 | ['elfutils'], | |
829257d1 | 4517 | ['gcrypt'], |
829257d1 | 4518 | ['gnutls'], |
7d861e12 | 4519 | ['libbpf'], |
56d68e71 | 4520 | ['libcryptsetup'], |
d1ae38d8 | 4521 | ['libcryptsetup-plugins'], |
829257d1 | 4522 | ['libcurl'], |
56d68e71 ZJS |
4523 | ['libfdisk'], |
4524 | ['libfido2'], | |
829257d1 | 4525 | ['libidn'], |
56d68e71 | 4526 | ['libidn2'], |
829257d1 | 4527 | ['libiptc'], |
56d68e71 ZJS |
4528 | ['microhttpd'], |
4529 | ['openssl'], | |
4530 | ['p11kit'], | |
4531 | ['pcre2'], | |
4532 | ['pwquality'], | |
4533 | ['qrencode'], | |
4534 | ['tpm2'], | |
4535 | ['xkbcommon'], | |
4536 | ||
4537 | # compression libs | |
4538 | ['zstd'], | |
4539 | ['lz4'], | |
4540 | ['xz'], | |
4541 | ['zlib'], | |
4542 | ['bzip2'], | |
4543 | ||
4544 | # components | |
4545 | ['backlight'], | |
829257d1 | 4546 | ['binfmt'], |
0a0d4899 | 4547 | ['bpf-framework', conf.get('BPF_FRAMEWORK') == 1], |
56d68e71 | 4548 | ['coredump'], |
829257d1 | 4549 | ['environment.d'], |
56d68e71 | 4550 | ['efi'], |
9cf75222 | 4551 | ['gnu-efi'], |
829257d1 | 4552 | ['firstboot'], |
56d68e71 ZJS |
4553 | ['hibernate'], |
4554 | ['homed'], | |
4555 | ['hostnamed'], | |
4556 | ['hwdb'], | |
4557 | ['importd'], | |
4558 | ['initrd'], | |
f887eab1 | 4559 | ['kernel-install'], |
56d68e71 | 4560 | ['localed'], |
829257d1 ZJS |
4561 | ['logind'], |
4562 | ['machined'], | |
56d68e71 ZJS |
4563 | ['networkd'], |
4564 | ['nss-myhostname'], | |
4565 | ['nss-mymachines'], | |
4566 | ['nss-resolve'], | |
4567 | ['nss-systemd'], | |
4568 | ['oomd'], | |
61d0578b | 4569 | ['portabled'], |
56d68e71 ZJS |
4570 | ['pstore'], |
4571 | ['quotacheck'], | |
4572 | ['randomseed'], | |
4573 | ['repart'], | |
4574 | ['resolve'], | |
4575 | ['rfkill'], | |
9bca4ae4 | 4576 | ['sysext'], |
0a0d4899 | 4577 | ['systemd-analyze', conf.get('ENABLE_ANALYZE') == 1], |
43cc7a3e | 4578 | ['sysupdate'], |
56d68e71 | 4579 | ['sysusers'], |
829257d1 ZJS |
4580 | ['timedated'], |
4581 | ['timesyncd'], | |
56d68e71 ZJS |
4582 | ['tmpfiles'], |
4583 | ['userdb'], | |
4584 | ['vconsole'], | |
4585 | ['xdg-autostart'], | |
4586 | ||
4587 | # optional features | |
56d68e71 | 4588 | ['idn'], |
829257d1 | 4589 | ['polkit'], |
56d68e71 | 4590 | ['nscd'], |
0a0d4899 | 4591 | ['legacy-pkla', install_polkit_pkla], |
829257d1 | 4592 | ['kmod'], |
ede5a78f | 4593 | ['xenctrl'], |
829257d1 ZJS |
4594 | ['dbus'], |
4595 | ['glib'], | |
829257d1 | 4596 | ['tpm'], |
0a0d4899 JH |
4597 | ['man pages', want_man], |
4598 | ['html pages', want_html], | |
4599 | ['man page indices', want_man and have_lxml], | |
829257d1 | 4600 | ['SysV compat'], |
56d68e71 | 4601 | ['compat-mutable-uid-boundaries'], |
829257d1 ZJS |
4602 | ['utmp'], |
4603 | ['ldconfig'], | |
0a0d4899 JH |
4604 | ['adm group', get_option('adm-group')], |
4605 | ['wheel group', get_option('wheel-group')], | |
b14e1b43 | 4606 | ['gshadow'], |
829257d1 ZJS |
4607 | ['debug hashmap'], |
4608 | ['debug mmap cache'], | |
d6601495 | 4609 | ['debug siphash'], |
0a0d4899 JH |
4610 | ['trace logging', conf.get('LOG_TRACE') == 1], |
4611 | ['install tests', install_tests], | |
4612 | ['link-udev-shared', get_option('link-udev-shared')], | |
4613 | ['link-systemctl-shared', get_option('link-systemctl-shared')], | |
4614 | ['link-networkd-shared', get_option('link-networkd-shared')], | |
4615 | ['link-timesyncd-shared', get_option('link-timesyncd-shared')], | |
4616 | ['link-journalctl-shared', get_option('link-journalctl-shared')], | |
4617 | ['link-boot-shared', get_option('link-boot-shared')], | |
93651582 | 4618 | ['first-boot-full-preset'], |
ceedbf81 | 4619 | ['fexecve'], |
0a0d4899 JH |
4620 | ['standalone-binaries', get_option('standalone-binaries')], |
4621 | ['coverage', get_option('b_coverage')], | |
829257d1 ZJS |
4622 | ] |
4623 | ||
af4d7860 ZJS |
4624 | if tuple.length() >= 2 |
4625 | cond = tuple[1] | |
4626 | else | |
829257d1 ZJS |
4627 | ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() |
4628 | ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() | |
349cc4a5 | 4629 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 |
829257d1 ZJS |
4630 | endif |
4631 | if cond | |
5a8b1640 | 4632 | found += tuple[0] |
829257d1 | 4633 | else |
5a8b1640 | 4634 | missing += tuple[0] |
829257d1 ZJS |
4635 | endif |
4636 | endforeach | |
4637 | ||
c716c253 ZJS |
4638 | if static_libsystemd == 'false' |
4639 | missing += 'static-libsystemd' | |
4640 | else | |
4641 | found += 'static-libsystemd(@0@)'.format(static_libsystemd) | |
4642 | endif | |
4643 | ||
4644 | if static_libudev == 'false' | |
4645 | missing += 'static-libudev' | |
4646 | else | |
4647 | found += 'static-libudev(@0@)'.format(static_libudev) | |
4648 | endif | |
4649 | ||
57633d23 ZJS |
4650 | if conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1 and conf.get('PREFER_OPENSSL') == 1 |
4651 | found += 'cryptolib(openssl)' | |
4652 | elif conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1 | |
4653 | found += 'cryptolib(gcrypt)' | |
4654 | else | |
4655 | missing += 'cryptolib' | |
4656 | endif | |
4657 | ||
237f2da9 ZJS |
4658 | if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1 |
4659 | found += 'DNS-over-TLS(gnutls)' | |
4660 | elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1 | |
4661 | found += 'DNS-over-TLS(openssl)' | |
4662 | else | |
4663 | missing += 'DNS-over-TLS' | |
4664 | endif | |
4665 | ||
12085ebb ZJS |
4666 | summary({ |
4667 | 'enabled' : ', '.join(found), | |
4668 | 'disabled' : ', '.join(missing)}, | |
4669 | section : 'Features') | |
9a8e64b0 ZJS |
4670 | |
4671 | if rootprefixdir != rootprefix_default | |
8ea9fad7 YW |
4672 | warning('\n' + |
4673 | 'Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) + | |
4674 | 'systemd used fixed names for unit file directories and other paths, so anything\n' + | |
4675 | 'except the default ("@0@") is strongly discouraged.'.format(rootprefix_default)) | |
9a8e64b0 | 4676 | endif |