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