]>
Commit | Line | Data |
---|---|---|
3a726fcd ZJS |
1 | # SPDX-License-Identifier: LGPL-2.1+ |
2 | # | |
3 | # Copyright 2017 Zbigniew Jędrzejewski-Szmek | |
4 | # | |
5 | # systemd is free software; you can redistribute it and/or modify it | |
6 | # under the terms of the GNU Lesser General Public License as published by | |
7 | # the Free Software Foundation; either version 2.1 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # systemd is distributed in the hope that it will be useful, but | |
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU Lesser General Public License | |
16 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
5c23128d | 18 | project('systemd', 'c', |
cbd73c69 | 19 | version : '236', |
5c23128d ZJS |
20 | license : 'LGPLv2+', |
21 | default_options: [ | |
37efbbd8 ZJS |
22 | 'c_std=gnu99', |
23 | 'prefix=/usr', | |
24 | 'sysconfdir=/etc', | |
25 | 'localstatedir=/var', | |
5c23128d | 26 | ], |
86ea8d70 | 27 | meson_version : '>= 0.41', |
5c23128d ZJS |
28 | ) |
29 | ||
cbd73c69 LP |
30 | libsystemd_version = '0.20.0' |
31 | libudev_version = '1.6.8' | |
56d50ab1 | 32 | |
5c23128d ZJS |
33 | # We need the same data in three different formats, ugh! |
34 | # Also, for hysterical reasons, we use different variable | |
35 | # names, sometimes. Not all variables are included in every | |
36 | # set. Ugh, ugh, ugh! | |
37 | conf = configuration_data() | |
38 | conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version()) | |
39 | conf.set_quoted('PACKAGE_VERSION', meson.project_version()) | |
40 | ||
41 | substs = configuration_data() | |
42 | substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd') | |
43 | substs.set('PACKAGE_VERSION', meson.project_version()) | |
44 | ||
45 | m4_defines = [] | |
46 | ||
47 | ##################################################################### | |
48 | ||
003c8879 ZJS |
49 | # Try to install the git pre-commit hook |
50 | git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh')) | |
51 | if git_hook.returncode() == 0 | |
52 | message(git_hook.stdout().strip()) | |
53 | endif | |
54 | ||
55 | ##################################################################### | |
56 | ||
9a8e64b0 ZJS |
57 | split_usr = get_option('split-usr') |
58 | conf.set10('HAVE_SPLIT_USR', split_usr) | |
59 | ||
74344a17 | 60 | rootprefixdir = get_option('rootprefix') |
74344a17 ZJS |
61 | # Unusual rootprefixdir values are used by some distros |
62 | # (see https://github.com/systemd/systemd/pull/7461). | |
9a8e64b0 ZJS |
63 | rootprefix_default = get_option('split-usr') ? '/' : '/usr' |
64 | if rootprefixdir == '' | |
65 | rootprefixdir = rootprefix_default | |
74344a17 | 66 | endif |
5c23128d ZJS |
67 | |
68 | sysvinit_path = get_option('sysvinit-path') | |
69 | sysvrcnd_path = get_option('sysvrcnd-path') | |
5424824a | 70 | have = sysvinit_path != '' and sysvrcnd_path != '' |
349cc4a5 ZJS |
71 | conf.set10('HAVE_SYSV_COMPAT', have, |
72 | description : 'SysV init scripts and rcN.d links are supported') | |
73 | m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : [] | |
5c23128d ZJS |
74 | |
75 | # join_paths ignore the preceding arguments if an absolute component is | |
76 | # encountered, so this should canonicalize various paths when they are | |
77 | # absolute or relative. | |
78 | prefixdir = get_option('prefix') | |
79 | if not prefixdir.startswith('/') | |
37efbbd8 | 80 | error('Prefix is not absolute: "@0@"'.format(prefixdir)) |
5c23128d ZJS |
81 | endif |
82 | bindir = join_paths(prefixdir, get_option('bindir')) | |
83 | libdir = join_paths(prefixdir, get_option('libdir')) | |
84 | sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) | |
85 | includedir = join_paths(prefixdir, get_option('includedir')) | |
86 | datadir = join_paths(prefixdir, get_option('datadir')) | |
87 | localstatedir = join_paths('/', get_option('localstatedir')) | |
88 | ||
89 | rootbindir = join_paths(rootprefixdir, 'bin') | |
90 | rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd') | |
91 | ||
92 | rootlibdir = get_option('rootlibdir') | |
93 | if rootlibdir == '' | |
37efbbd8 | 94 | rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) |
5c23128d ZJS |
95 | endif |
96 | ||
97 | # Dirs of external packages | |
e17e5ba9 MB |
98 | pkgconfigdatadir = join_paths(datadir, 'pkgconfig') |
99 | pkgconfiglibdir = join_paths(libdir, 'pkgconfig') | |
100 | polkitpolicydir = join_paths(datadir, 'polkit-1/actions') | |
101 | polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d') | |
102 | polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d') | |
103 | varlogdir = join_paths(localstatedir, 'log') | |
104 | xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d') | |
8a38aac3 YW |
105 | rpmmacrosdir = get_option('rpmmacrosdir') |
106 | if rpmmacrosdir != 'no' | |
107 | rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir) | |
108 | endif | |
02fa054d | 109 | modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d') |
5c23128d ZJS |
110 | |
111 | # Our own paths | |
e17e5ba9 MB |
112 | pkgdatadir = join_paths(datadir, 'systemd') |
113 | environmentdir = join_paths(prefixdir, 'lib/environment.d') | |
114 | pkgsysconfdir = join_paths(sysconfdir, 'systemd') | |
115 | userunitdir = join_paths(prefixdir, 'lib/systemd/user') | |
116 | userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset') | |
117 | tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d') | |
118 | sysusersdir = join_paths(prefixdir, 'lib/sysusers.d') | |
119 | sysctldir = join_paths(prefixdir, 'lib/sysctl.d') | |
120 | binfmtdir = join_paths(prefixdir, 'lib/binfmt.d') | |
121 | modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d') | |
122 | networkdir = join_paths(rootprefixdir, 'lib/systemd/network') | |
123 | pkgincludedir = join_paths(includedir, 'systemd') | |
124 | systemgeneratordir = join_paths(rootlibexecdir, 'system-generators') | |
125 | usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators') | |
126 | systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators') | |
127 | userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators') | |
128 | systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown') | |
129 | systemsleepdir = join_paths(rootlibexecdir, 'system-sleep') | |
130 | systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system') | |
131 | systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset') | |
132 | udevlibexecdir = join_paths(rootprefixdir, 'lib/udev') | |
133 | udevhomedir = udevlibexecdir | |
134 | udevrulesdir = join_paths(udevlibexecdir, 'rules.d') | |
135 | udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d') | |
136 | catalogdir = join_paths(prefixdir, 'lib/systemd/catalog') | |
137 | kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d') | |
138 | factorydir = join_paths(datadir, 'factory') | |
139 | docdir = join_paths(datadir, 'doc/systemd') | |
140 | bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi') | |
141 | testsdir = join_paths(prefixdir, 'lib/systemd/tests') | |
142 | systemdstatedir = join_paths(localstatedir, 'lib/systemd') | |
143 | catalogstatedir = join_paths(systemdstatedir, 'catalog') | |
144 | randomseeddir = join_paths(localstatedir, 'lib/systemd') | |
5c23128d ZJS |
145 | |
146 | dbuspolicydir = get_option('dbuspolicydir') | |
147 | if dbuspolicydir == '' | |
37efbbd8 | 148 | dbuspolicydir = join_paths(datadir, 'dbus-1/system.d') |
5c23128d ZJS |
149 | endif |
150 | ||
151 | dbussessionservicedir = get_option('dbussessionservicedir') | |
152 | if dbussessionservicedir == '' | |
37efbbd8 | 153 | dbussessionservicedir = join_paths(datadir, 'dbus-1/services') |
5c23128d ZJS |
154 | endif |
155 | ||
156 | dbussystemservicedir = get_option('dbussystemservicedir') | |
157 | if dbussystemservicedir == '' | |
37efbbd8 | 158 | dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services') |
5c23128d ZJS |
159 | endif |
160 | ||
161 | pamlibdir = get_option('pamlibdir') | |
162 | if pamlibdir == '' | |
37efbbd8 | 163 | pamlibdir = join_paths(rootlibdir, 'security') |
5c23128d ZJS |
164 | endif |
165 | ||
166 | pamconfdir = get_option('pamconfdir') | |
167 | if pamconfdir == '' | |
37efbbd8 | 168 | pamconfdir = join_paths(sysconfdir, 'pam.d') |
5c23128d ZJS |
169 | endif |
170 | ||
171 | conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) | |
e17e5ba9 | 172 | conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system')) |
5c23128d ZJS |
173 | conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) |
174 | conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) | |
175 | conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) | |
2a4c156d ZJS |
176 | conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) |
177 | conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) | |
e17e5ba9 | 178 | conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user')) |
5c23128d ZJS |
179 | conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir) |
180 | conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) | |
e17e5ba9 MB |
181 | conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database')) |
182 | conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent')) | |
183 | conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd')) | |
184 | conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck')) | |
da495a03 | 185 | conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs')) |
7f2806d5 | 186 | conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs')) |
e17e5ba9 MB |
187 | conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown')) |
188 | conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep')) | |
189 | conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl')) | |
190 | conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent')) | |
191 | conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge')) | |
74344a17 | 192 | conf.set_quoted('ROOTPREFIX', rootprefixdir) |
3131bfe3 | 193 | conf.set_quoted('RANDOM_SEED_DIR', randomseeddir) |
e17e5ba9 MB |
194 | conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) |
195 | conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup')) | |
5c23128d ZJS |
196 | conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir) |
197 | conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir) | |
198 | conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir) | |
199 | conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir) | |
200 | conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir) | |
201 | conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir) | |
e17e5ba9 MB |
202 | conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map')) |
203 | conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map')) | |
5c23128d | 204 | conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir) |
e17e5ba9 | 205 | conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent')) |
5c23128d ZJS |
206 | conf.set_quoted('LIBDIR', libdir) |
207 | conf.set_quoted('ROOTLIBDIR', rootlibdir) | |
208 | conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir) | |
209 | conf.set_quoted('BOOTLIBDIR', bootlibdir) | |
e17e5ba9 MB |
210 | conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull')) |
211 | conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import')) | |
212 | conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export')) | |
213 | conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg')) | |
214 | conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg')) | |
215 | conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd')) | |
5c23128d ZJS |
216 | |
217 | conf.set_quoted('ABS_BUILD_DIR', meson.build_root()) | |
218 | conf.set_quoted('ABS_SRC_DIR', meson.source_root()) | |
219 | ||
220 | substs.set('prefix', prefixdir) | |
3131bfe3 ZJS |
221 | substs.set('exec_prefix', prefixdir) |
222 | substs.set('libdir', libdir) | |
223 | substs.set('rootlibdir', rootlibdir) | |
224 | substs.set('includedir', includedir) | |
5c23128d | 225 | substs.set('pkgsysconfdir', pkgsysconfdir) |
3131bfe3 ZJS |
226 | substs.set('bindir', bindir) |
227 | substs.set('rootbindir', rootbindir) | |
5c23128d ZJS |
228 | substs.set('rootlibexecdir', rootlibexecdir) |
229 | substs.set('systemunitdir', systemunitdir) | |
230 | substs.set('userunitdir', userunitdir) | |
231 | substs.set('systempresetdir', systempresetdir) | |
232 | substs.set('userpresetdir', userpresetdir) | |
233 | substs.set('udevhwdbdir', udevhwdbdir) | |
234 | substs.set('udevrulesdir', udevrulesdir) | |
3131bfe3 | 235 | substs.set('udevlibexecdir', udevlibexecdir) |
5c23128d ZJS |
236 | substs.set('catalogdir', catalogdir) |
237 | substs.set('tmpfilesdir', tmpfilesdir) | |
238 | substs.set('sysusersdir', sysusersdir) | |
239 | substs.set('sysctldir', sysctldir) | |
240 | substs.set('binfmtdir', binfmtdir) | |
241 | substs.set('modulesloaddir', modulesloaddir) | |
242 | substs.set('systemgeneratordir', systemgeneratordir) | |
243 | substs.set('usergeneratordir', usergeneratordir) | |
244 | substs.set('systemenvgeneratordir', systemenvgeneratordir) | |
245 | substs.set('userenvgeneratordir', userenvgeneratordir) | |
246 | substs.set('systemshutdowndir', systemshutdowndir) | |
247 | substs.set('systemsleepdir', systemsleepdir) | |
2a4c156d ZJS |
248 | substs.set('VARLOGDIR', varlogdir) |
249 | substs.set('CERTIFICATEROOT', get_option('certificate-root')) | |
e17e5ba9 MB |
250 | substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl')) |
251 | substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) | |
2a4c156d ZJS |
252 | substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path) |
253 | substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) | |
254 | substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) | |
255 | substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) | |
5c23128d ZJS |
256 | |
257 | ##################################################################### | |
258 | ||
259 | cc = meson.get_compiler('c') | |
260 | pkgconfig = import('pkgconfig') | |
6e2afb1c | 261 | check_compilation_sh = find_program('tools/meson-check-compilation.sh') |
5c23128d | 262 | |
08318a2c AD |
263 | if get_option('tests') != 'false' |
264 | cxx = find_program('c++', required : false) | |
265 | if cxx.found() | |
266 | # Used only for tests | |
267 | add_languages('cpp') | |
268 | endif | |
94e2523b ZJS |
269 | endif |
270 | ||
7db7d5b7 JR |
271 | ossfuzz = get_option('oss-fuzz') |
272 | if ossfuzz | |
273 | fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine') | |
274 | endif | |
275 | ||
75cf1d66 | 276 | foreach arg : ['-Wextra', |
70160ce8 | 277 | '-Werror=undef', |
5c23128d ZJS |
278 | '-Wlogical-op', |
279 | '-Wmissing-include-dirs', | |
280 | '-Wold-style-definition', | |
281 | '-Wpointer-arith', | |
282 | '-Winit-self', | |
283 | '-Wdeclaration-after-statement', | |
284 | '-Wfloat-equal', | |
285 | '-Wsuggest-attribute=noreturn', | |
286 | '-Werror=missing-prototypes', | |
287 | '-Werror=implicit-function-declaration', | |
288 | '-Werror=missing-declarations', | |
289 | '-Werror=return-type', | |
290 | '-Werror=incompatible-pointer-types', | |
291 | '-Werror=format=2', | |
292 | '-Wstrict-prototypes', | |
293 | '-Wredundant-decls', | |
294 | '-Wmissing-noreturn', | |
97279d83 | 295 | '-Wimplicit-fallthrough=5', |
5c23128d ZJS |
296 | '-Wshadow', |
297 | '-Wendif-labels', | |
298 | '-Wstrict-aliasing=2', | |
299 | '-Wwrite-strings', | |
5c23128d ZJS |
300 | '-Werror=overflow', |
301 | '-Wdate-time', | |
302 | '-Wnested-externs', | |
303 | '-ffast-math', | |
304 | '-fno-common', | |
305 | '-fdiagnostics-show-option', | |
306 | '-fno-strict-aliasing', | |
307 | '-fvisibility=hidden', | |
308 | '-fstack-protector', | |
309 | '-fstack-protector-strong', | |
5c23128d ZJS |
310 | '--param=ssp-buffer-size=4', |
311 | ] | |
37efbbd8 ZJS |
312 | if cc.has_argument(arg) |
313 | add_project_arguments(arg, language : 'c') | |
314 | endif | |
5c23128d ZJS |
315 | endforeach |
316 | ||
7db7d5b7 JR |
317 | # the oss-fuzz fuzzers are not built with -fPIE, so don't |
318 | # enable it when we are linking against them | |
319 | if not ossfuzz | |
320 | if cc.has_argument('-fPIE') | |
321 | add_project_arguments('-fPIE', language : 'c') | |
322 | endif | |
323 | endif | |
324 | ||
2c5434ad ZJS |
325 | # "negative" arguments: gcc on purpose does not return an error for "-Wno-" |
326 | # arguments, just emits a warnings. So test for the "positive" version instead. | |
327 | foreach arg : ['unused-parameter', | |
328 | 'missing-field-initializers', | |
329 | 'unused-result', | |
fb1b5882 ZJS |
330 | 'format-signedness', |
331 | 'error=nonnull', # work-around for gcc 7.1 turning this on on its own | |
332 | ] | |
2c5434ad ZJS |
333 | if cc.has_argument('-W' + arg) |
334 | add_project_arguments('-Wno-' + arg, language : 'c') | |
335 | endif | |
336 | endforeach | |
337 | ||
5c23128d ZJS |
338 | if cc.compiles(' |
339 | #include <time.h> | |
340 | #include <inttypes.h> | |
341 | typedef uint64_t usec_t; | |
342 | usec_t now(clockid_t clock); | |
343 | int main(void) { | |
344 | struct timespec now; | |
345 | return 0; | |
346 | } | |
7572aa80 | 347 | ', name : '-Werror=shadow with local shadowing') |
37efbbd8 | 348 | add_project_arguments('-Werror=shadow', language : 'c') |
5c23128d ZJS |
349 | endif |
350 | ||
351 | if cc.get_id() == 'clang' | |
37efbbd8 ZJS |
352 | foreach arg : ['-Wno-typedef-redefinition', |
353 | '-Wno-gnu-variable-sized-type-not-at-end', | |
354 | ] | |
7572aa80 ZJS |
355 | if cc.has_argument(arg, |
356 | name : '@0@ is supported'.format(arg)) | |
37efbbd8 ZJS |
357 | add_project_arguments(arg, language : 'c') |
358 | endif | |
359 | endforeach | |
5c23128d ZJS |
360 | endif |
361 | ||
6e2afb1c ZJS |
362 | link_test_c = files('tools/meson-link-test.c') |
363 | ||
5c23128d ZJS |
364 | # --as-needed and --no-undefined are provided by meson by default, |
365 | # run mesonconf to see what is enabled | |
366 | foreach arg : ['-Wl,-z,relro', | |
367 | '-Wl,-z,now', | |
368 | '-pie', | |
5c23128d | 369 | ] |
6e2afb1c ZJS |
370 | |
371 | have = run_command(check_compilation_sh, | |
372 | cc.cmd_array(), '-x', 'c', arg, | |
373 | '-include', link_test_c).returncode() == 0 | |
374 | message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no')) | |
7db7d5b7 | 375 | if have and (arg != '-pie' or not ossfuzz) |
37efbbd8 ZJS |
376 | add_project_link_arguments(arg, language : 'c') |
377 | endif | |
5c23128d ZJS |
378 | endforeach |
379 | ||
41afb5eb ZJS |
380 | if get_option('buildtype') != 'debug' |
381 | foreach arg : ['-ffunction-sections', | |
382 | '-fdata-sections'] | |
7572aa80 ZJS |
383 | if cc.has_argument(arg, |
384 | name : '@0@ is supported'.format(arg)) | |
41afb5eb ZJS |
385 | add_project_arguments(arg, language : 'c') |
386 | endif | |
387 | endforeach | |
388 | ||
389 | foreach arg : ['-Wl,--gc-sections'] | |
6e2afb1c ZJS |
390 | have = run_command(check_compilation_sh, |
391 | cc.cmd_array(), '-x', 'c', arg, | |
392 | '-include', link_test_c).returncode() == 0 | |
393 | message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no')) | |
394 | if have | |
41afb5eb ZJS |
395 | add_project_link_arguments(arg, language : 'c') |
396 | endif | |
397 | endforeach | |
398 | endif | |
399 | ||
9cc0e6e9 ZJS |
400 | cpp = ' '.join(cc.cmd_array()) + ' -E' |
401 | ||
5c23128d ZJS |
402 | ##################################################################### |
403 | # compilation result tests | |
404 | ||
2c201c21 ZJS |
405 | conf.set('_GNU_SOURCE', true) |
406 | conf.set('__SANE_USERSPACE_TYPES__', true) | |
5c23128d ZJS |
407 | |
408 | conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>')) | |
409 | conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>')) | |
410 | conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>')) | |
411 | conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>')) | |
412 | conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>')) | |
413 | conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>')) | |
414 | conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>')) | |
415 | ||
416 | decl_headers = ''' | |
417 | #include <uchar.h> | |
418 | #include <linux/ethtool.h> | |
bce67bbe | 419 | #include <linux/fib_rules.h> |
5c23128d ZJS |
420 | ''' |
421 | # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail | |
422 | ||
423 | foreach decl : ['char16_t', | |
424 | 'char32_t', | |
425 | 'key_serial_t', | |
426 | 'struct ethtool_link_settings', | |
bce67bbe | 427 | 'struct fib_rule_uid_range', |
5c23128d | 428 | ] |
2c201c21 ZJS |
429 | |
430 | # We get -1 if the size cannot be determined | |
431 | have = cc.sizeof(decl, prefix : decl_headers) > 0 | |
349cc4a5 | 432 | conf.set10('HAVE_' + decl.underscorify().to_upper(), have) |
5c23128d ZJS |
433 | endforeach |
434 | ||
435 | foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], | |
436 | ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], | |
437 | ['IFLA_VRF_TABLE', 'linux/if_link.h'], | |
438 | ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'], | |
d384826f | 439 | ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'], |
5c23128d ZJS |
440 | ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'], |
441 | ['IFLA_BOND_AD_INFO', 'linux/if_link.h'], | |
442 | ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'], | |
443 | ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'], | |
444 | ['IFLA_VXLAN_GPE', 'linux/if_link.h'], | |
9dfed8dd | 445 | ['IFLA_GENEVE_LABEL', 'linux/if_link.h'], |
5c23128d ZJS |
446 | # if_tunnel.h is buggy and cannot be included on its own |
447 | ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'], | |
448 | ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'], | |
449 | ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'], | |
450 | ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'], | |
451 | ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'], | |
452 | ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'], | |
453 | ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'], | |
d384826f | 454 | ['IPVLAN_F_PRIVATE', 'linux/if_link.h'], |
5c23128d ZJS |
455 | ['NDA_IFINDEX', 'linux/neighbour.h'], |
456 | ['IFA_FLAGS', 'linux/if_addr.h'], | |
bce67bbe | 457 | ['FRA_UID_RANGE', 'linux/fib_rules.h'], |
5c23128d | 458 | ['LO_FLAGS_PARTSCAN', 'linux/loop.h'], |
d6df583c | 459 | ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'], |
5c23128d | 460 | ] |
37efbbd8 ZJS |
461 | prefix = decl.length() > 2 ? decl[2] : '' |
462 | have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) | |
4b9545f1 | 463 | conf.set10('HAVE_' + decl[0], have) |
5c23128d ZJS |
464 | endforeach |
465 | ||
5c23128d | 466 | foreach ident : ['secure_getenv', '__secure_getenv'] |
349cc4a5 | 467 | conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) |
5c23128d ZJS |
468 | endforeach |
469 | ||
470 | foreach ident : [ | |
85db59b7 | 471 | ['memfd_create', '''#include <sys/mman.h>'''], |
7b961e40 LP |
472 | ['gettid', '''#include <sys/types.h> |
473 | #include <unistd.h>'''], | |
3c042add LP |
474 | ['pivot_root', '''#include <stdlib.h> |
475 | #include <unistd.h>'''], # no known header declares pivot_root | |
85db59b7 | 476 | ['name_to_handle_at', '''#include <sys/types.h> |
37efbbd8 ZJS |
477 | #include <sys/stat.h> |
478 | #include <fcntl.h>'''], | |
85db59b7 | 479 | ['setns', '''#include <sched.h>'''], |
2acfd0ff LP |
480 | ['renameat2', '''#include <stdio.h> |
481 | #include <fcntl.h>'''], | |
37efbbd8 ZJS |
482 | ['kcmp', '''#include <linux/kcmp.h>'''], |
483 | ['keyctl', '''#include <sys/types.h> | |
484 | #include <keyutils.h>'''], | |
85db59b7 | 485 | ['copy_file_range', '''#include <sys/syscall.h> |
37efbbd8 | 486 | #include <unistd.h>'''], |
71e5200f DM |
487 | ['bpf', '''#include <sys/syscall.h> |
488 | #include <unistd.h>'''], | |
38f1ae0f | 489 | ['explicit_bzero' , '''#include <string.h>'''], |
37efbbd8 ZJS |
490 | ] |
491 | ||
85db59b7 | 492 | have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') |
4b9545f1 | 493 | conf.set10('HAVE_' + ident[0].to_upper(), have) |
5c23128d ZJS |
494 | endforeach |
495 | ||
85db59b7 | 496 | if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE') |
349cc4a5 | 497 | conf.set10('USE_SYS_RANDOM_H', true) |
4b9545f1 | 498 | conf.set10('HAVE_GETRANDOM', true) |
4984c8be ZJS |
499 | else |
500 | have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''') | |
349cc4a5 | 501 | conf.set10('USE_SYS_RANDOM_H', false) |
4b9545f1 | 502 | conf.set10('HAVE_GETRANDOM', have) |
4984c8be ZJS |
503 | endif |
504 | ||
5c23128d ZJS |
505 | ##################################################################### |
506 | ||
507 | sed = find_program('sed') | |
5c23128d | 508 | awk = find_program('awk') |
d730e2d1 | 509 | m4 = find_program('m4') |
5c23128d | 510 | stat = find_program('stat') |
d68b342b | 511 | git = find_program('git', required : false) |
5c23128d | 512 | |
7b76fce1 | 513 | meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh' |
94e75a54 | 514 | mkdir_p = 'mkdir -p $DESTDIR/@0@' |
d83f4f50 ZJS |
515 | test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh') |
516 | splash_bmp = files('test/splash.bmp') | |
94e75a54 | 517 | |
5c23128d ZJS |
518 | # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, |
519 | # /usr/sbin, /sbin, and fall back to the default from middle column. | |
2fa645f1 | 520 | progs = [['quotaon', '/usr/sbin/quotaon' ], |
5c23128d ZJS |
521 | ['quotacheck', '/usr/sbin/quotacheck' ], |
522 | ['kill', '/usr/bin/kill' ], | |
523 | ['kmod', '/usr/bin/kmod' ], | |
524 | ['kexec', '/usr/sbin/kexec' ], | |
525 | ['sulogin', '/usr/sbin/sulogin' ], | |
526 | ['mount', '/usr/bin/mount', 'MOUNT_PATH'], | |
527 | ['umount', '/usr/bin/umount', 'UMOUNT_PATH'], | |
528 | ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'], | |
529 | ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'], | |
530 | ] | |
531 | foreach prog : progs | |
37efbbd8 ZJS |
532 | path = get_option(prog[0] + '-path') |
533 | if path != '' | |
534 | message('Using @1@ for @0@'.format(prog[0], path)) | |
535 | else | |
536 | exe = find_program(prog[0], | |
537 | '/usr/sbin/' + prog[0], | |
538 | '/sbin/' + prog[0], | |
539 | required: false) | |
540 | path = exe.found() ? exe.path() : prog[1] | |
541 | endif | |
542 | name = prog.length() > 2 ? prog[2] : prog[0].to_upper() | |
543 | conf.set_quoted(name, path) | |
544 | substs.set(name, path) | |
5c23128d ZJS |
545 | endforeach |
546 | ||
2fa645f1 MG |
547 | conf.set_quoted('TELINIT', get_option('telinit-path')) |
548 | ||
1276a9f6 ZJS |
549 | if run_command('ln', '--relative', '--help').returncode() != 0 |
550 | error('ln does not support --relative') | |
551 | endif | |
5c23128d ZJS |
552 | |
553 | ############################################################ | |
554 | ||
555 | gperf = find_program('gperf') | |
556 | ||
557 | gperf_test_format = ''' | |
558 | #include <string.h> | |
559 | const char * in_word_set(const char *, @0@); | |
560 | @1@ | |
561 | ''' | |
562 | gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C' | |
563 | gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path())) | |
564 | gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout()) | |
565 | if cc.compiles(gperf_test) | |
37efbbd8 | 566 | gperf_len_type = 'size_t' |
5c23128d | 567 | else |
37efbbd8 ZJS |
568 | gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout()) |
569 | if cc.compiles(gperf_test) | |
570 | gperf_len_type = 'unsigned' | |
571 | else | |
572 | error('unable to determine gperf len type') | |
573 | endif | |
5c23128d ZJS |
574 | endif |
575 | message('gperf len type is @0@'.format(gperf_len_type)) | |
37efbbd8 ZJS |
576 | conf.set('GPERF_LEN_TYPE', gperf_len_type, |
577 | description : 'The type of gperf "len" parameter') | |
5c23128d ZJS |
578 | |
579 | ############################################################ | |
580 | ||
581 | if not cc.has_header('sys/capability.h') | |
37efbbd8 | 582 | error('POSIX caps headers not found') |
5c23128d ZJS |
583 | endif |
584 | foreach header : ['linux/btrfs.h', | |
585 | 'linux/memfd.h', | |
586 | 'linux/vm_sockets.h', | |
af8786b1 | 587 | 'sys/auxv.h', |
5c23128d ZJS |
588 | 'valgrind/memcheck.h', |
589 | 'valgrind/valgrind.h', | |
590 | ] | |
2c201c21 | 591 | |
349cc4a5 ZJS |
592 | conf.set10('HAVE_' + header.underscorify().to_upper(), |
593 | cc.has_header(header)) | |
5c23128d ZJS |
594 | endforeach |
595 | ||
596 | ############################################################ | |
597 | ||
598 | conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname')) | |
5248e7e1 ZJS |
599 | conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname')) |
600 | gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : []) | |
5c23128d ZJS |
601 | |
602 | default_hierarchy = get_option('default-hierarchy') | |
603 | conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy, | |
604 | description : 'default cgroup hierarchy as string') | |
605 | if default_hierarchy == 'legacy' | |
37efbbd8 | 606 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE') |
5c23128d | 607 | elif default_hierarchy == 'hybrid' |
37efbbd8 | 608 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD') |
5c23128d | 609 | else |
37efbbd8 | 610 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL') |
5c23128d ZJS |
611 | endif |
612 | ||
613 | time_epoch = get_option('time-epoch') | |
614 | if time_epoch == '' | |
37efbbd8 ZJS |
615 | NEWS = files('NEWS') |
616 | time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout() | |
5c23128d ZJS |
617 | endif |
618 | time_epoch = time_epoch.to_int() | |
619 | conf.set('TIME_EPOCH', time_epoch) | |
620 | ||
621 | system_uid_max = get_option('system-uid-max') | |
622 | if system_uid_max == '' | |
37efbbd8 ZJS |
623 | system_uid_max = run_command( |
624 | awk, | |
625 | 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }', | |
626 | '/etc/login.defs').stdout() | |
5c23128d ZJS |
627 | endif |
628 | system_uid_max = system_uid_max.to_int() | |
629 | conf.set('SYSTEM_UID_MAX', system_uid_max) | |
630 | substs.set('systemuidmax', system_uid_max) | |
7572aa80 | 631 | message('maximum system UID is @0@'.format(system_uid_max)) |
5c23128d | 632 | |
5c23128d ZJS |
633 | system_gid_max = get_option('system-gid-max') |
634 | if system_gid_max == '' | |
37efbbd8 ZJS |
635 | system_gid_max = run_command( |
636 | awk, | |
637 | 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }', | |
638 | '/etc/login.defs').stdout() | |
5c23128d ZJS |
639 | endif |
640 | system_gid_max = system_gid_max.to_int() | |
641 | conf.set('SYSTEM_GID_MAX', system_gid_max) | |
642 | substs.set('systemgidmax', system_gid_max) | |
7572aa80 | 643 | message('maximum system GID is @0@'.format(system_gid_max)) |
5c23128d | 644 | |
87d5e4f2 LP |
645 | dynamic_uid_min = get_option('dynamic-uid-min').to_int() |
646 | dynamic_uid_max = get_option('dynamic-uid-max').to_int() | |
647 | conf.set('DYNAMIC_UID_MIN', dynamic_uid_min) | |
648 | conf.set('DYNAMIC_UID_MAX', dynamic_uid_max) | |
649 | substs.set('dynamicuidmin', dynamic_uid_min) | |
650 | substs.set('dynamicuidmax', dynamic_uid_max) | |
651 | ||
652 | container_uid_base_min = get_option('container-uid-base-min').to_int() | |
653 | container_uid_base_max = get_option('container-uid-base-max').to_int() | |
654 | conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min) | |
655 | conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max) | |
656 | substs.set('containeruidbasemin', container_uid_base_min) | |
657 | substs.set('containeruidbasemax', container_uid_base_max) | |
658 | ||
afde4574 LP |
659 | nobody_user = get_option('nobody-user') |
660 | nobody_group = get_option('nobody-group') | |
661 | ||
662 | getent_result = run_command('getent', 'passwd', '65534') | |
663 | if getent_result.returncode() == 0 | |
664 | name = getent_result.stdout().split(':')[0] | |
665 | if name != nobody_user | |
666 | message('WARNING:\n' + | |
667 | ' 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) + | |
668 | ' Your build will result in an user table setup that is incompatible with the local system.') | |
669 | endif | |
670 | endif | |
671 | id_result = run_command('id', '-u', nobody_user) | |
672 | if id_result.returncode() == 0 | |
673 | id = id_result.stdout().to_int() | |
674 | if id != 65534 | |
675 | message('WARNING:\n' + | |
676 | ' 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) + | |
677 | ' Your build will result in an user table setup that is incompatible with the local system.') | |
678 | endif | |
679 | endif | |
680 | ||
681 | getent_result = run_command('getent', 'group', '65534') | |
682 | if getent_result.returncode() == 0 | |
683 | name = getent_result.stdout().split(':')[0] | |
684 | if name != nobody_group | |
685 | message('WARNING:\n' + | |
686 | ' 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) + | |
687 | ' Your build will result in an group table setup that is incompatible with the local system.') | |
688 | endif | |
689 | endif | |
690 | id_result = run_command('id', '-g', nobody_group) | |
691 | if id_result.returncode() == 0 | |
692 | id = id_result.stdout().to_int() | |
693 | if id != 65534 | |
694 | message('WARNING:\n' + | |
695 | ' The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) + | |
696 | ' Your build will result in an group table setup that is incompatible with the local system.') | |
697 | endif | |
698 | endif | |
8374cc62 YW |
699 | if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup') |
700 | message('WARNING:\n' + | |
701 | ' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) + | |
702 | ' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.') | |
703 | endif | |
afde4574 LP |
704 | |
705 | conf.set_quoted('NOBODY_USER_NAME', nobody_user) | |
706 | conf.set_quoted('NOBODY_GROUP_NAME', nobody_group) | |
60712021 YW |
707 | substs.set('NOBODY_USER_NAME', nobody_user) |
708 | substs.set('NOBODY_GROUP_NAME', nobody_group) | |
87d5e4f2 | 709 | |
5c23128d ZJS |
710 | tty_gid = get_option('tty-gid') |
711 | conf.set('TTY_GID', tty_gid) | |
2a4c156d | 712 | substs.set('TTY_GID', tty_gid) |
5c23128d | 713 | |
84786b8e ID |
714 | # Ensure provided GID argument is numeric, otherwise fallback to default assignment |
715 | if get_option('users-gid') != '' | |
d6806870 | 716 | users_gid = get_option('users-gid').to_int() |
84786b8e | 717 | else |
d6806870 | 718 | users_gid = '-' |
84786b8e ID |
719 | endif |
720 | substs.set('USERS_GID', users_gid) | |
721 | ||
5c23128d | 722 | if get_option('adm-group') |
37efbbd8 | 723 | m4_defines += ['-DENABLE_ADM_GROUP'] |
5c23128d ZJS |
724 | endif |
725 | ||
726 | if get_option('wheel-group') | |
37efbbd8 | 727 | m4_defines += ['-DENABLE_WHEEL_GROUP'] |
5c23128d ZJS |
728 | endif |
729 | ||
730 | substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode')) | |
4e15a734 | 731 | substs.set('GROUP_RENDER_MODE', get_option('group-render-mode')) |
5c23128d | 732 | |
2a4c156d ZJS |
733 | kill_user_processes = get_option('default-kill-user-processes') |
734 | conf.set10('KILL_USER_PROCESSES', kill_user_processes) | |
735 | substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no') | |
5c23128d | 736 | |
829257d1 ZJS |
737 | dns_servers = get_option('dns-servers') |
738 | conf.set_quoted('DNS_SERVERS', dns_servers) | |
739 | substs.set('DNS_SERVERS', dns_servers) | |
5c23128d | 740 | |
829257d1 ZJS |
741 | ntp_servers = get_option('ntp-servers') |
742 | conf.set_quoted('NTP_SERVERS', ntp_servers) | |
743 | substs.set('NTP_SERVERS', ntp_servers) | |
5c23128d ZJS |
744 | |
745 | conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) | |
746 | ||
3131bfe3 ZJS |
747 | substs.set('SUSHELL', get_option('debug-shell')) |
748 | substs.set('DEBUGTTY', get_option('debug-tty')) | |
749 | ||
671677da | 750 | debug = get_option('debug') |
349cc4a5 ZJS |
751 | enable_debug_hashmap = false |
752 | enable_debug_mmap_cache = false | |
671677da ZJS |
753 | if debug != '' |
754 | foreach name : debug.split(',') | |
755 | if name == 'hashmap' | |
349cc4a5 | 756 | enable_debug_hashmap = true |
671677da | 757 | elif name == 'mmap-cache' |
349cc4a5 | 758 | enable_debug_mmap_cache = true |
671677da ZJS |
759 | else |
760 | message('unknown debug option "@0@", ignoring'.format(name)) | |
761 | endif | |
762 | endforeach | |
763 | endif | |
349cc4a5 ZJS |
764 | conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap) |
765 | conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache) | |
671677da | 766 | |
5c23128d ZJS |
767 | ##################################################################### |
768 | ||
769 | threads = dependency('threads') | |
770 | librt = cc.find_library('rt') | |
771 | libm = cc.find_library('m') | |
772 | libdl = cc.find_library('dl') | |
773 | libcrypt = cc.find_library('crypt') | |
774 | ||
1800cc85 ZJS |
775 | libcap = dependency('libcap', required : false) |
776 | if not libcap.found() | |
777 | # Compat with Ubuntu 14.04 which ships libcap w/o .pc file | |
778 | libcap = cc.find_library('cap') | |
779 | endif | |
780 | ||
5c23128d | 781 | libmount = dependency('mount', |
d6e80966 | 782 | version : '>= 2.30') |
5c23128d ZJS |
783 | |
784 | want_seccomp = get_option('seccomp') | |
4390be30 | 785 | if want_seccomp != 'false' |
37efbbd8 | 786 | libseccomp = dependency('libseccomp', |
9f0e9c01 | 787 | version : '>= 2.3.1', |
37efbbd8 | 788 | required : want_seccomp == 'true') |
349cc4a5 | 789 | have = libseccomp.found() |
5c23128d | 790 | else |
349cc4a5 | 791 | have = false |
37efbbd8 | 792 | libseccomp = [] |
5c23128d | 793 | endif |
349cc4a5 ZJS |
794 | conf.set10('HAVE_SECCOMP', have) |
795 | m4_defines += have ? ['-DHAVE_SECCOMP'] : [] | |
5c23128d ZJS |
796 | |
797 | want_selinux = get_option('selinux') | |
4390be30 | 798 | if want_selinux != 'false' |
37efbbd8 ZJS |
799 | libselinux = dependency('libselinux', |
800 | version : '>= 2.1.9', | |
801 | required : want_selinux == 'true') | |
349cc4a5 | 802 | have = libselinux.found() |
5c23128d | 803 | else |
349cc4a5 | 804 | have = false |
37efbbd8 | 805 | libselinux = [] |
5c23128d | 806 | endif |
349cc4a5 ZJS |
807 | conf.set10('HAVE_SELINUX', have) |
808 | m4_defines += have ? ['-DHAVE_SELINUX'] : [] | |
5c23128d ZJS |
809 | |
810 | want_apparmor = get_option('apparmor') | |
4390be30 | 811 | if want_apparmor != 'false' |
37efbbd8 ZJS |
812 | libapparmor = dependency('libapparmor', |
813 | required : want_apparmor == 'true') | |
349cc4a5 | 814 | have = libapparmor.found() |
5c23128d | 815 | else |
349cc4a5 | 816 | have = false |
37efbbd8 | 817 | libapparmor = [] |
5c23128d | 818 | endif |
349cc4a5 ZJS |
819 | conf.set10('HAVE_APPARMOR', have) |
820 | m4_defines += have ? ['-DHAVE_APPARMOR'] : [] | |
5c23128d | 821 | |
5c23128d ZJS |
822 | smack_run_label = get_option('smack-run-label') |
823 | if smack_run_label != '' | |
37efbbd8 ZJS |
824 | conf.set_quoted('SMACK_RUN_LABEL', smack_run_label) |
825 | m4_defines += ['-DHAVE_SMACK_RUN_LABEL'] | |
5c23128d ZJS |
826 | endif |
827 | ||
3ca0cb73 ZJS |
828 | want_polkit = get_option('polkit') |
829 | install_polkit = false | |
830 | install_polkit_pkla = false | |
4390be30 | 831 | if want_polkit != 'false' |
37efbbd8 | 832 | install_polkit = true |
3ca0cb73 | 833 | |
37efbbd8 ZJS |
834 | libpolkit = dependency('polkit-gobject-1', |
835 | required : false) | |
836 | if libpolkit.found() and libpolkit.version().version_compare('< 0.106') | |
837 | message('Old polkit detected, will install pkla files') | |
838 | install_polkit_pkla = true | |
839 | endif | |
3ca0cb73 | 840 | endif |
349cc4a5 | 841 | conf.set10('ENABLE_POLKIT', install_polkit) |
3ca0cb73 | 842 | |
36f0387e ZJS |
843 | want_acl = get_option('acl') |
844 | if want_acl != 'false' | |
845 | libacl = cc.find_library('acl', required : want_acl == 'true') | |
349cc4a5 | 846 | have = libacl.found() |
36f0387e | 847 | else |
349cc4a5 | 848 | have = false |
36f0387e ZJS |
849 | libacl = [] |
850 | endif | |
349cc4a5 ZJS |
851 | conf.set10('HAVE_ACL', have) |
852 | m4_defines += have ? ['-DHAVE_ACL'] : [] | |
36f0387e | 853 | |
5c23128d | 854 | want_audit = get_option('audit') |
4390be30 | 855 | if want_audit != 'false' |
37efbbd8 | 856 | libaudit = dependency('audit', required : want_audit == 'true') |
349cc4a5 | 857 | have = libaudit.found() |
5c23128d | 858 | else |
349cc4a5 | 859 | have = false |
37efbbd8 | 860 | libaudit = [] |
5c23128d | 861 | endif |
349cc4a5 | 862 | conf.set10('HAVE_AUDIT', have) |
5c23128d ZJS |
863 | |
864 | want_blkid = get_option('blkid') | |
4390be30 | 865 | if want_blkid != 'false' |
37efbbd8 | 866 | libblkid = dependency('blkid', required : want_blkid == 'true') |
349cc4a5 | 867 | have = libblkid.found() |
5c23128d | 868 | else |
349cc4a5 | 869 | have = false |
37efbbd8 | 870 | libblkid = [] |
5c23128d | 871 | endif |
349cc4a5 | 872 | conf.set10('HAVE_BLKID', have) |
5c23128d ZJS |
873 | |
874 | want_kmod = get_option('kmod') | |
4390be30 | 875 | if want_kmod != 'false' |
37efbbd8 ZJS |
876 | libkmod = dependency('libkmod', |
877 | version : '>= 15', | |
878 | required : want_kmod == 'true') | |
349cc4a5 | 879 | have = libkmod.found() |
5c23128d | 880 | else |
349cc4a5 | 881 | have = false |
37efbbd8 | 882 | libkmod = [] |
5c23128d | 883 | endif |
349cc4a5 | 884 | conf.set10('HAVE_KMOD', have) |
5c23128d ZJS |
885 | |
886 | want_pam = get_option('pam') | |
4390be30 | 887 | if want_pam != 'false' |
37efbbd8 ZJS |
888 | libpam = cc.find_library('pam', required : want_pam == 'true') |
889 | libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true') | |
349cc4a5 | 890 | have = libpam.found() and libpam_misc.found() |
5c23128d | 891 | else |
349cc4a5 | 892 | have = false |
37efbbd8 ZJS |
893 | libpam = [] |
894 | libpam_misc = [] | |
5c23128d | 895 | endif |
349cc4a5 ZJS |
896 | conf.set10('HAVE_PAM', have) |
897 | m4_defines += have ? ['-DHAVE_PAM'] : [] | |
5c23128d ZJS |
898 | |
899 | want_microhttpd = get_option('microhttpd') | |
4390be30 | 900 | if want_microhttpd != 'false' |
37efbbd8 ZJS |
901 | libmicrohttpd = dependency('libmicrohttpd', |
902 | version : '>= 0.9.33', | |
903 | required : want_microhttpd == 'true') | |
349cc4a5 | 904 | have = libmicrohttpd.found() |
5c23128d | 905 | else |
349cc4a5 | 906 | have = false |
37efbbd8 | 907 | libmicrohttpd = [] |
5c23128d | 908 | endif |
349cc4a5 ZJS |
909 | conf.set10('HAVE_MICROHTTPD', have) |
910 | m4_defines += have ? ['-DHAVE_MICROHTTPD'] : [] | |
5c23128d ZJS |
911 | |
912 | want_libcryptsetup = get_option('libcryptsetup') | |
4390be30 | 913 | if want_libcryptsetup != 'false' |
37efbbd8 ZJS |
914 | libcryptsetup = dependency('libcryptsetup', |
915 | version : '>= 1.6.0', | |
916 | required : want_libcryptsetup == 'true') | |
349cc4a5 | 917 | have = libcryptsetup.found() |
5c23128d | 918 | else |
349cc4a5 | 919 | have = false |
37efbbd8 | 920 | libcryptsetup = [] |
5c23128d | 921 | endif |
349cc4a5 | 922 | conf.set10('HAVE_LIBCRYPTSETUP', have) |
5c23128d ZJS |
923 | |
924 | want_libcurl = get_option('libcurl') | |
4390be30 | 925 | if want_libcurl != 'false' |
37efbbd8 ZJS |
926 | libcurl = dependency('libcurl', |
927 | version : '>= 7.32.0', | |
928 | required : want_libcurl == 'true') | |
349cc4a5 | 929 | have = libcurl.found() |
5c23128d | 930 | else |
349cc4a5 | 931 | have = false |
37efbbd8 | 932 | libcurl = [] |
5c23128d | 933 | endif |
349cc4a5 ZJS |
934 | conf.set10('HAVE_LIBCURL', have) |
935 | m4_defines += have ? ['-DHAVE_LIBCURL'] : [] | |
5c23128d ZJS |
936 | |
937 | want_libidn = get_option('libidn') | |
87057e24 ZJS |
938 | want_libidn2 = get_option('libidn2') |
939 | if want_libidn == 'true' and want_libidn2 == 'true' | |
940 | error('libidn and libidn2 cannot be requested simultaneously') | |
941 | endif | |
942 | ||
7f7ab228 ZJS |
943 | if want_libidn != 'false' and want_libidn2 != 'true' |
944 | libidn = dependency('libidn', | |
945 | required : want_libidn == 'true') | |
349cc4a5 | 946 | have = libidn.found() |
87057e24 | 947 | else |
349cc4a5 | 948 | have = false |
87057e24 ZJS |
949 | libidn = [] |
950 | endif | |
349cc4a5 ZJS |
951 | conf.set10('HAVE_LIBIDN', have) |
952 | m4_defines += have ? ['-DHAVE_LIBIDN'] : [] | |
953 | if not have and want_libidn2 != 'false' | |
7f7ab228 ZJS |
954 | # libidn is used for both libidn and libidn2 objects |
955 | libidn = dependency('libidn2', | |
956 | required : want_libidn2 == 'true') | |
349cc4a5 ZJS |
957 | have = libidn.found() |
958 | else | |
959 | have = false | |
5c23128d | 960 | endif |
349cc4a5 ZJS |
961 | conf.set10('HAVE_LIBIDN2', have) |
962 | m4_defines += have ? ['-DHAVE_LIBIDN2'] : [] | |
5c23128d ZJS |
963 | |
964 | want_libiptc = get_option('libiptc') | |
4390be30 | 965 | if want_libiptc != 'false' |
37efbbd8 ZJS |
966 | libiptc = dependency('libiptc', |
967 | required : want_libiptc == 'true') | |
349cc4a5 | 968 | have = libiptc.found() |
5c23128d | 969 | else |
349cc4a5 | 970 | have = false |
37efbbd8 | 971 | libiptc = [] |
5c23128d | 972 | endif |
349cc4a5 ZJS |
973 | conf.set10('HAVE_LIBIPTC', have) |
974 | m4_defines += have ? ['-DHAVE_LIBIPTC'] : [] | |
5c23128d ZJS |
975 | |
976 | want_qrencode = get_option('qrencode') | |
4390be30 | 977 | if want_qrencode != 'false' |
37efbbd8 ZJS |
978 | libqrencode = dependency('libqrencode', |
979 | required : want_qrencode == 'true') | |
349cc4a5 | 980 | have = libqrencode.found() |
5c23128d | 981 | else |
349cc4a5 | 982 | have = false |
37efbbd8 | 983 | libqrencode = [] |
5c23128d | 984 | endif |
349cc4a5 | 985 | conf.set10('HAVE_QRENCODE', have) |
5c23128d | 986 | |
a44fb601 ZJS |
987 | want_gcrypt = get_option('gcrypt') |
988 | if want_gcrypt != 'false' | |
989 | libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true') | |
990 | libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true') | |
349cc4a5 | 991 | have = libgcrypt.found() and libgpg_error.found() |
a44fb601 | 992 | else |
349cc4a5 ZJS |
993 | have = false |
994 | endif | |
995 | if not have | |
996 | # link to neither of the libs if one is not found | |
a44fb601 ZJS |
997 | libgcrypt = [] |
998 | libgpg_error = [] | |
999 | endif | |
349cc4a5 | 1000 | conf.set10('HAVE_GCRYPT', have) |
a44fb601 | 1001 | |
5c23128d | 1002 | want_gnutls = get_option('gnutls') |
4390be30 | 1003 | if want_gnutls != 'false' |
37efbbd8 ZJS |
1004 | libgnutls = dependency('gnutls', |
1005 | version : '>= 3.1.4', | |
1006 | required : want_gnutls == 'true') | |
349cc4a5 | 1007 | have = libgnutls.found() |
5c23128d | 1008 | else |
349cc4a5 | 1009 | have = false |
37efbbd8 | 1010 | libgnutls = [] |
5c23128d | 1011 | endif |
349cc4a5 | 1012 | conf.set10('HAVE_GNUTLS', have) |
5c23128d ZJS |
1013 | |
1014 | want_elfutils = get_option('elfutils') | |
4390be30 | 1015 | if want_elfutils != 'false' |
37efbbd8 ZJS |
1016 | libdw = dependency('libdw', |
1017 | required : want_elfutils == 'true') | |
349cc4a5 | 1018 | have = libdw.found() |
5c23128d | 1019 | else |
349cc4a5 | 1020 | have = false |
37efbbd8 | 1021 | libdw = [] |
5c23128d | 1022 | endif |
349cc4a5 | 1023 | conf.set10('HAVE_ELFUTILS', have) |
5c23128d ZJS |
1024 | |
1025 | want_zlib = get_option('zlib') | |
4390be30 | 1026 | if want_zlib != 'false' |
37efbbd8 ZJS |
1027 | libz = dependency('zlib', |
1028 | required : want_zlib == 'true') | |
349cc4a5 | 1029 | have = libz.found() |
5c23128d | 1030 | else |
349cc4a5 | 1031 | have = false |
37efbbd8 | 1032 | libz = [] |
5c23128d | 1033 | endif |
349cc4a5 | 1034 | conf.set10('HAVE_ZLIB', have) |
5c23128d ZJS |
1035 | |
1036 | want_bzip2 = get_option('bzip2') | |
4390be30 | 1037 | if want_bzip2 != 'false' |
37efbbd8 ZJS |
1038 | libbzip2 = cc.find_library('bz2', |
1039 | required : want_bzip2 == 'true') | |
349cc4a5 | 1040 | have = libbzip2.found() |
5c23128d | 1041 | else |
349cc4a5 | 1042 | have = false |
37efbbd8 | 1043 | libbzip2 = [] |
5c23128d | 1044 | endif |
349cc4a5 | 1045 | conf.set10('HAVE_BZIP2', have) |
5c23128d ZJS |
1046 | |
1047 | want_xz = get_option('xz') | |
4390be30 | 1048 | if want_xz != 'false' |
37efbbd8 ZJS |
1049 | libxz = dependency('liblzma', |
1050 | required : want_xz == 'true') | |
349cc4a5 | 1051 | have = libxz.found() |
5c23128d | 1052 | else |
349cc4a5 | 1053 | have = false |
37efbbd8 | 1054 | libxz = [] |
5c23128d | 1055 | endif |
349cc4a5 | 1056 | conf.set10('HAVE_XZ', have) |
5c23128d ZJS |
1057 | |
1058 | want_lz4 = get_option('lz4') | |
4390be30 | 1059 | if want_lz4 != 'false' |
37efbbd8 ZJS |
1060 | liblz4 = dependency('liblz4', |
1061 | required : want_lz4 == 'true') | |
349cc4a5 | 1062 | have = liblz4.found() |
5c23128d | 1063 | else |
349cc4a5 | 1064 | have = false |
37efbbd8 | 1065 | liblz4 = [] |
5c23128d | 1066 | endif |
349cc4a5 | 1067 | conf.set10('HAVE_LZ4', have) |
5c23128d | 1068 | |
a44fb601 ZJS |
1069 | want_xkbcommon = get_option('xkbcommon') |
1070 | if want_xkbcommon != 'false' | |
1071 | libxkbcommon = dependency('xkbcommon', | |
1072 | version : '>= 0.3.0', | |
1073 | required : want_xkbcommon == 'true') | |
349cc4a5 | 1074 | have = libxkbcommon.found() |
a44fb601 | 1075 | else |
349cc4a5 | 1076 | have = false |
a44fb601 ZJS |
1077 | libxkbcommon = [] |
1078 | endif | |
349cc4a5 | 1079 | conf.set10('HAVE_XKBCOMMON', have) |
a44fb601 | 1080 | |
69e96427 | 1081 | want_glib = get_option('glib') |
4390be30 | 1082 | if want_glib != 'false' |
37efbbd8 ZJS |
1083 | libglib = dependency('glib-2.0', |
1084 | version : '>= 2.22.0', | |
1085 | required : want_glib == 'true') | |
1086 | libgobject = dependency('gobject-2.0', | |
1087 | version : '>= 2.22.0', | |
1088 | required : want_glib == 'true') | |
1089 | libgio = dependency('gio-2.0', | |
1090 | required : want_glib == 'true') | |
2c201c21 | 1091 | have = libglib.found() and libgobject.found() and libgio.found() |
69e96427 | 1092 | else |
349cc4a5 | 1093 | have = false |
37efbbd8 ZJS |
1094 | libglib = [] |
1095 | libgobject = [] | |
1096 | libgio = [] | |
69e96427 | 1097 | endif |
349cc4a5 | 1098 | conf.set10('HAVE_GLIB', have) |
69e96427 ZJS |
1099 | |
1100 | want_dbus = get_option('dbus') | |
4390be30 | 1101 | if want_dbus != 'false' |
37efbbd8 ZJS |
1102 | libdbus = dependency('dbus-1', |
1103 | version : '>= 1.3.2', | |
1104 | required : want_dbus == 'true') | |
349cc4a5 | 1105 | have = libdbus.found() |
69e96427 | 1106 | else |
349cc4a5 | 1107 | have = false |
37efbbd8 | 1108 | libdbus = [] |
69e96427 | 1109 | endif |
349cc4a5 | 1110 | conf.set10('HAVE_DBUS', have) |
69e96427 | 1111 | |
42303dcb | 1112 | default_dnssec = get_option('default-dnssec') |
349cc4a5 | 1113 | if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0 |
42303dcb YW |
1114 | message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.') |
1115 | default_dnssec = 'no' | |
1116 | endif | |
1117 | conf.set('DEFAULT_DNSSEC_MODE', | |
1118 | 'DNSSEC_' + default_dnssec.underscorify().to_upper()) | |
1119 | substs.set('DEFAULT_DNSSEC_MODE', default_dnssec) | |
1120 | ||
5c23128d | 1121 | want_importd = get_option('importd') |
4390be30 | 1122 | if want_importd != 'false' |
349cc4a5 ZJS |
1123 | have = (conf.get('HAVE_LIBCURL') == 1 and |
1124 | conf.get('HAVE_ZLIB') == 1 and | |
1125 | conf.get('HAVE_BZIP2') == 1 and | |
1126 | conf.get('HAVE_XZ') == 1 and | |
1127 | conf.get('HAVE_GCRYPT') == 1) | |
1128 | if want_importd == 'true' and not have | |
37efbbd8 ZJS |
1129 | error('importd support was requested, but dependencies are not available') |
1130 | endif | |
349cc4a5 ZJS |
1131 | else |
1132 | have = false | |
5c23128d | 1133 | endif |
349cc4a5 | 1134 | conf.set10('ENABLE_IMPORTD', have) |
5c23128d ZJS |
1135 | |
1136 | want_remote = get_option('remote') | |
4390be30 | 1137 | if want_remote != 'false' |
349cc4a5 ZJS |
1138 | have_deps = [conf.get('HAVE_MICROHTTPD') == 1, |
1139 | conf.get('HAVE_LIBCURL') == 1] | |
37efbbd8 ZJS |
1140 | # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so |
1141 | # it's possible to build one without the other. Complain only if | |
1142 | # support was explictly requested. The auxiliary files like sysusers | |
1143 | # config should be installed when any of the programs are built. | |
1144 | if want_remote == 'true' and not (have_deps[0] and have_deps[1]) | |
1145 | error('remote support was requested, but dependencies are not available') | |
1146 | endif | |
349cc4a5 ZJS |
1147 | have = have_deps[0] or have_deps[1] |
1148 | else | |
1149 | have = false | |
5c23128d | 1150 | endif |
349cc4a5 | 1151 | conf.set10('ENABLE_REMOTE', have) |
5c23128d | 1152 | |
a9149d87 ZJS |
1153 | foreach term : ['utmp', |
1154 | 'hibernate', | |
1155 | 'environment-d', | |
1156 | 'binfmt', | |
1157 | 'coredump', | |
1158 | 'resolve', | |
1159 | 'logind', | |
1160 | 'hostnamed', | |
1161 | 'localed', | |
1162 | 'machined', | |
1163 | 'networkd', | |
1164 | 'timedated', | |
1165 | 'timesyncd', | |
1166 | 'myhostname', | |
1167 | 'firstboot', | |
1168 | 'randomseed', | |
1169 | 'backlight', | |
1170 | 'vconsole', | |
1171 | 'quotacheck', | |
1172 | 'sysusers', | |
1173 | 'tmpfiles', | |
1174 | 'hwdb', | |
1175 | 'rfkill', | |
1176 | 'ldconfig', | |
1177 | 'efi', | |
1178 | 'tpm', | |
1179 | 'ima', | |
1180 | 'smack', | |
1181 | 'gshadow', | |
1182 | 'idn', | |
1183 | 'nss-systemd'] | |
1184 | have = get_option(term) | |
1185 | name = 'ENABLE_' + term.underscorify().to_upper() | |
1186 | conf.set10(name, have) | |
1187 | m4_defines += have ? ['-D' + name] : [] | |
5c23128d ZJS |
1188 | endforeach |
1189 | ||
69e96427 | 1190 | want_tests = get_option('tests') |
572baca1 | 1191 | install_tests = get_option('install-tests') |
69e96427 | 1192 | tests = [] |
7db7d5b7 | 1193 | fuzzers = [] |
69e96427 | 1194 | |
00d82c81 ZJS |
1195 | conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests')) |
1196 | ||
5c23128d ZJS |
1197 | ##################################################################### |
1198 | ||
1199 | if get_option('efi') | |
37efbbd8 | 1200 | efi_arch = host_machine.cpu_family() |
b710072d | 1201 | |
6800fe7f | 1202 | if efi_arch == 'x86' |
37efbbd8 | 1203 | EFI_MACHINE_TYPE_NAME = 'ia32' |
6800fe7f | 1204 | gnu_efi_arch = 'ia32' |
37efbbd8 ZJS |
1205 | elif efi_arch == 'x86_64' |
1206 | EFI_MACHINE_TYPE_NAME = 'x64' | |
6800fe7f | 1207 | gnu_efi_arch = 'x86_64' |
37efbbd8 ZJS |
1208 | elif efi_arch == 'arm' |
1209 | EFI_MACHINE_TYPE_NAME = 'arm' | |
6800fe7f | 1210 | gnu_efi_arch = 'arm' |
37efbbd8 ZJS |
1211 | elif efi_arch == 'aarch64' |
1212 | EFI_MACHINE_TYPE_NAME = 'aa64' | |
6800fe7f | 1213 | gnu_efi_arch = 'aarch64' |
37efbbd8 ZJS |
1214 | else |
1215 | EFI_MACHINE_TYPE_NAME = '' | |
6800fe7f | 1216 | gnu_efi_arch = '' |
37efbbd8 | 1217 | endif |
5c23128d | 1218 | |
349cc4a5 | 1219 | have = true |
37efbbd8 | 1220 | conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) |
80c6fce8 ZJS |
1221 | |
1222 | conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int()) | |
349cc4a5 ZJS |
1223 | else |
1224 | have = false | |
5c23128d | 1225 | endif |
349cc4a5 | 1226 | conf.set10('ENABLE_EFI', have) |
5c23128d ZJS |
1227 | |
1228 | ##################################################################### | |
1229 | ||
1230 | config_h = configure_file( | |
37efbbd8 ZJS |
1231 | output : 'config.h', |
1232 | configuration : conf) | |
5c23128d ZJS |
1233 | |
1234 | includes = include_directories('src/basic', | |
1235 | 'src/shared', | |
1236 | 'src/systemd', | |
1237 | 'src/journal', | |
1238 | 'src/resolve', | |
1239 | 'src/timesync', | |
1240 | 'src/login', | |
1241 | 'src/udev', | |
1242 | 'src/libudev', | |
1243 | 'src/core', | |
1244 | 'src/libsystemd/sd-bus', | |
1245 | 'src/libsystemd/sd-device', | |
1246 | 'src/libsystemd/sd-hwdb', | |
1247 | 'src/libsystemd/sd-id128', | |
1248 | 'src/libsystemd/sd-netlink', | |
1249 | 'src/libsystemd/sd-network', | |
1250 | 'src/libsystemd-network', | |
2d4ceca8 | 1251 | '.') |
5c23128d ZJS |
1252 | |
1253 | add_project_arguments('-include', 'config.h', language : 'c') | |
1254 | ||
5c23128d ZJS |
1255 | subdir('po') |
1256 | subdir('catalog') | |
1257 | subdir('src/systemd') | |
1258 | subdir('src/basic') | |
1259 | subdir('src/libsystemd') | |
1260 | subdir('src/libsystemd-network') | |
5c23128d | 1261 | subdir('src/journal') |
5c23128d | 1262 | subdir('src/login') |
5c23128d ZJS |
1263 | |
1264 | libjournal_core = static_library( | |
37efbbd8 ZJS |
1265 | 'journal-core', |
1266 | libjournal_core_sources, | |
1267 | journald_gperf_c, | |
1268 | include_directories : includes, | |
1269 | install : false) | |
5c23128d | 1270 | |
37ab1a25 | 1271 | libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) |
5c23128d | 1272 | libsystemd = shared_library( |
37efbbd8 | 1273 | 'systemd', |
7f1ea2cc | 1274 | 'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug |
56d50ab1 | 1275 | version : libsystemd_version, |
37efbbd8 ZJS |
1276 | include_directories : includes, |
1277 | link_args : ['-shared', | |
1278 | '-Wl,--version-script=' + libsystemd_sym_path], | |
34e221a5 ZJS |
1279 | link_with : [libbasic, |
1280 | libbasic_gcrypt], | |
5e3cec87 ZJS |
1281 | link_whole : [libsystemd_static, |
1282 | libjournal_client], | |
37efbbd8 ZJS |
1283 | dependencies : [threads, |
1284 | librt, | |
1285 | libxz, | |
1286 | liblz4], | |
1287 | link_depends : libsystemd_sym, | |
1288 | install : true, | |
1289 | install_dir : rootlibdir) | |
5c23128d ZJS |
1290 | |
1291 | ############################################################ | |
1292 | ||
83b6af36 ZJS |
1293 | # binaries that have --help and are intended for use by humans, |
1294 | # usually, but not always, installed in /bin. | |
1295 | public_programs = [] | |
1296 | ||
1297 | subdir('src/libudev') | |
1298 | subdir('src/shared') | |
1299 | subdir('src/core') | |
1300 | subdir('src/udev') | |
1301 | subdir('src/network') | |
1302 | ||
1303 | subdir('src/analyze') | |
1304 | subdir('src/journal-remote') | |
1305 | subdir('src/coredump') | |
1306 | subdir('src/hostname') | |
1307 | subdir('src/import') | |
1308 | subdir('src/kernel-install') | |
1309 | subdir('src/locale') | |
1310 | subdir('src/machine') | |
1311 | subdir('src/nspawn') | |
1312 | subdir('src/resolve') | |
1313 | subdir('src/timedate') | |
1314 | subdir('src/timesync') | |
1315 | subdir('src/vconsole') | |
83b6af36 ZJS |
1316 | subdir('src/boot/efi') |
1317 | ||
1318 | subdir('src/test') | |
7db7d5b7 | 1319 | subdir('src/fuzz') |
6b97bf22 | 1320 | subdir('rules') |
83b6af36 ZJS |
1321 | subdir('test') |
1322 | ||
1323 | ############################################################ | |
1324 | ||
1325 | # only static linking apart from libdl, to make sure that the | |
1326 | # module is linked to all libraries that it uses. | |
1327 | test_dlopen = executable( | |
37efbbd8 ZJS |
1328 | 'test-dlopen', |
1329 | test_dlopen_c, | |
1330 | include_directories : includes, | |
1331 | link_with : [libbasic], | |
1332 | dependencies : [libdl]) | |
83b6af36 | 1333 | |
08cf5b8d | 1334 | foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'], |
e7e11bbf | 1335 | ['systemd', 'ENABLE_NSS_SYSTEMD'], |
5486a31d | 1336 | ['mymachines', 'ENABLE_MACHINED'], |
1ec57f33 | 1337 | ['resolve', 'ENABLE_RESOLVE']] |
5c23128d | 1338 | |
349cc4a5 | 1339 | condition = tuple[1] == '' or conf.get(tuple[1]) == 1 |
37efbbd8 ZJS |
1340 | if condition |
1341 | module = tuple[0] | |
37efbbd8 ZJS |
1342 | |
1343 | sym = 'src/nss-@0@/nss-@0@.sym'.format(module) | |
1344 | version_script_arg = join_paths(meson.current_source_dir(), sym) | |
1345 | ||
1346 | nss = shared_library( | |
1347 | 'nss_' + module, | |
1348 | 'src/nss-@0@/nss-@0@.c'.format(module), | |
1349 | version : '2', | |
1350 | include_directories : includes, | |
b4b36f44 LP |
1351 | # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned |
1352 | link_args : ['-Wl,-z,nodelete', | |
1353 | '-shared', | |
37efbbd8 ZJS |
1354 | '-Wl,--version-script=' + version_script_arg, |
1355 | '-Wl,--undefined'], | |
37e4d7a8 | 1356 | link_with : [libsystemd_static, |
37efbbd8 ZJS |
1357 | libbasic], |
1358 | dependencies : [threads, | |
5486a31d | 1359 | librt], |
37efbbd8 ZJS |
1360 | link_depends : sym, |
1361 | install : true, | |
1362 | install_dir : rootlibdir) | |
1363 | ||
1364 | # We cannot use shared_module because it does not support version suffix. | |
1365 | # Unfortunately shared_library insists on creating the symlink… | |
1366 | meson.add_install_script('sh', '-c', | |
1367 | 'rm $DESTDIR@0@/libnss_@1@.so' | |
1368 | .format(rootlibdir, module)) | |
1369 | ||
1370 | test('dlopen-nss_' + module, | |
1371 | test_dlopen, | |
1372 | args : [nss.full_path()]) # path to dlopen must include a slash | |
1373 | endif | |
5c23128d ZJS |
1374 | endforeach |
1375 | ||
1376 | ############################################################ | |
1377 | ||
5c23128d ZJS |
1378 | executable('systemd', |
1379 | systemd_sources, | |
1380 | include_directories : includes, | |
1381 | link_with : [libcore, | |
34ce0a52 | 1382 | libshared], |
5c23128d ZJS |
1383 | dependencies : [threads, |
1384 | librt, | |
1385 | libseccomp, | |
1386 | libselinux, | |
f4ee10a2 ZJS |
1387 | libmount, |
1388 | libblkid], | |
421f0012 | 1389 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1390 | install : true, |
1391 | install_dir : rootlibexecdir) | |
1392 | ||
005a29f2 ZJS |
1393 | exe = executable('systemd-analyze', |
1394 | systemd_analyze_sources, | |
1395 | include_directories : includes, | |
1396 | link_with : [libcore, | |
005a29f2 ZJS |
1397 | libshared], |
1398 | dependencies : [threads, | |
1399 | librt, | |
1400 | libseccomp, | |
1401 | libselinux, | |
1402 | libmount, | |
1403 | libblkid], | |
1404 | install_rpath : rootlibexecdir, | |
1405 | install : true) | |
1406 | public_programs += [exe] | |
5c23128d ZJS |
1407 | |
1408 | executable('systemd-journald', | |
1409 | systemd_journald_sources, | |
1410 | include_directories : includes, | |
aac26058 | 1411 | link_with : [libjournal_core, |
34ce0a52 | 1412 | libshared], |
5c23128d ZJS |
1413 | dependencies : [threads, |
1414 | libxz, | |
aac26058 ZJS |
1415 | liblz4, |
1416 | libselinux], | |
421f0012 | 1417 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1418 | install : true, |
1419 | install_dir : rootlibexecdir) | |
1420 | ||
005a29f2 ZJS |
1421 | exe = executable('systemd-cat', |
1422 | systemd_cat_sources, | |
1423 | include_directories : includes, | |
1424 | link_with : [libjournal_core, | |
34ce0a52 | 1425 | libshared], |
005a29f2 ZJS |
1426 | dependencies : [threads], |
1427 | install_rpath : rootlibexecdir, | |
1428 | install : true) | |
1429 | public_programs += [exe] | |
1430 | ||
1431 | exe = executable('journalctl', | |
1432 | journalctl_sources, | |
1433 | include_directories : includes, | |
34ce0a52 | 1434 | link_with : [libshared], |
005a29f2 ZJS |
1435 | dependencies : [threads, |
1436 | libqrencode, | |
1437 | libxz, | |
1438 | liblz4], | |
1439 | install_rpath : rootlibexecdir, | |
1440 | install : true, | |
1441 | install_dir : rootbindir) | |
1442 | public_programs += [exe] | |
5c23128d ZJS |
1443 | |
1444 | executable('systemd-getty-generator', | |
1445 | 'src/getty-generator/getty-generator.c', | |
5c23128d | 1446 | include_directories : includes, |
b2fc5836 ZJS |
1447 | link_with : [libshared], |
1448 | install_rpath : rootlibexecdir, | |
1449 | install : true, | |
1450 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
1451 | |
1452 | executable('systemd-debug-generator', | |
1453 | 'src/debug-generator/debug-generator.c', | |
5c23128d | 1454 | include_directories : includes, |
b2fc5836 ZJS |
1455 | link_with : [libshared], |
1456 | install_rpath : rootlibexecdir, | |
1457 | install : true, | |
1458 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
1459 | |
1460 | executable('systemd-fstab-generator', | |
1461 | 'src/fstab-generator/fstab-generator.c', | |
1462 | 'src/core/mount-setup.c', | |
5c23128d | 1463 | include_directories : includes, |
b2fc5836 ZJS |
1464 | link_with : [libshared], |
1465 | install_rpath : rootlibexecdir, | |
1466 | install : true, | |
1467 | install_dir : systemgeneratordir) | |
5c23128d | 1468 | |
349cc4a5 | 1469 | if conf.get('ENABLE_ENVIRONMENT_D') == 1 |
37efbbd8 ZJS |
1470 | executable('30-systemd-environment-d-generator', |
1471 | 'src/environment-d-generator/environment-d-generator.c', | |
1472 | include_directories : includes, | |
1473 | link_with : [libshared], | |
1474 | install_rpath : rootlibexecdir, | |
1475 | install : true, | |
1476 | install_dir : userenvgeneratordir) | |
7b76fce1 | 1477 | |
37efbbd8 ZJS |
1478 | meson.add_install_script(meson_make_symlink, |
1479 | join_paths(sysconfdir, 'environment'), | |
1480 | join_paths(environmentdir, '99-environment.conf')) | |
5c23128d ZJS |
1481 | endif |
1482 | ||
349cc4a5 | 1483 | if conf.get('ENABLE_HIBERNATE') == 1 |
37efbbd8 ZJS |
1484 | executable('systemd-hibernate-resume-generator', |
1485 | 'src/hibernate-resume/hibernate-resume-generator.c', | |
1486 | include_directories : includes, | |
1487 | link_with : [libshared], | |
1488 | install_rpath : rootlibexecdir, | |
1489 | install : true, | |
1490 | install_dir : systemgeneratordir) | |
5c23128d | 1491 | |
37efbbd8 ZJS |
1492 | executable('systemd-hibernate-resume', |
1493 | 'src/hibernate-resume/hibernate-resume.c', | |
005a29f2 ZJS |
1494 | include_directories : includes, |
1495 | link_with : [libshared], | |
1496 | install_rpath : rootlibexecdir, | |
1497 | install : true, | |
1498 | install_dir : rootlibexecdir) | |
37efbbd8 ZJS |
1499 | endif |
1500 | ||
349cc4a5 | 1501 | if conf.get('HAVE_BLKID') == 1 |
37efbbd8 ZJS |
1502 | executable('systemd-gpt-auto-generator', |
1503 | 'src/gpt-auto-generator/gpt-auto-generator.c', | |
1504 | 'src/basic/blkid-util.h', | |
1505 | include_directories : includes, | |
34ce0a52 | 1506 | link_with : [libshared], |
37efbbd8 ZJS |
1507 | dependencies : libblkid, |
1508 | install_rpath : rootlibexecdir, | |
1509 | install : true, | |
1510 | install_dir : systemgeneratordir) | |
1511 | ||
1512 | exe = executable('systemd-dissect', | |
1513 | 'src/dissect/dissect.c', | |
1514 | include_directories : includes, | |
1515 | link_with : [libshared], | |
1516 | install_rpath : rootlibexecdir, | |
1517 | install : true, | |
1518 | install_dir : rootlibexecdir) | |
1519 | public_programs += [exe] | |
5c23128d ZJS |
1520 | endif |
1521 | ||
1ec57f33 | 1522 | if conf.get('ENABLE_RESOLVE') == 1 |
37efbbd8 ZJS |
1523 | executable('systemd-resolved', |
1524 | systemd_resolved_sources, | |
005a29f2 | 1525 | include_directories : includes, |
34e221a5 | 1526 | link_with : [libshared, |
568a4ff8 ZJS |
1527 | libbasic_gcrypt, |
1528 | libsystemd_resolve_core], | |
005a29f2 | 1529 | dependencies : [threads, |
76c87410 | 1530 | libgpg_error, |
005a29f2 ZJS |
1531 | libm, |
1532 | libidn], | |
1533 | install_rpath : rootlibexecdir, | |
37efbbd8 ZJS |
1534 | install : true, |
1535 | install_dir : rootlibexecdir) | |
1536 | ||
1537 | exe = executable('systemd-resolve', | |
1538 | systemd_resolve_sources, | |
1539 | include_directories : includes, | |
34e221a5 | 1540 | link_with : [libshared, |
568a4ff8 ZJS |
1541 | libbasic_gcrypt, |
1542 | libsystemd_resolve_core], | |
37efbbd8 | 1543 | dependencies : [threads, |
76c87410 | 1544 | libgpg_error, |
37efbbd8 ZJS |
1545 | libm, |
1546 | libidn], | |
1547 | install_rpath : rootlibexecdir, | |
1548 | install : true) | |
1549 | public_programs += [exe] | |
5c23128d ZJS |
1550 | endif |
1551 | ||
349cc4a5 | 1552 | if conf.get('ENABLE_LOGIND') == 1 |
37efbbd8 ZJS |
1553 | executable('systemd-logind', |
1554 | systemd_logind_sources, | |
005a29f2 | 1555 | include_directories : includes, |
37efbbd8 | 1556 | link_with : [liblogind_core, |
34ce0a52 | 1557 | libshared], |
005a29f2 | 1558 | dependencies : [threads, |
37efbbd8 | 1559 | libacl], |
005a29f2 ZJS |
1560 | install_rpath : rootlibexecdir, |
1561 | install : true, | |
37efbbd8 ZJS |
1562 | install_dir : rootlibexecdir) |
1563 | ||
1564 | exe = executable('loginctl', | |
1565 | loginctl_sources, | |
1566 | include_directories : includes, | |
34ce0a52 | 1567 | link_with : [libshared], |
37efbbd8 ZJS |
1568 | dependencies : [threads, |
1569 | liblz4, | |
1570 | libxz], | |
1571 | install_rpath : rootlibexecdir, | |
1572 | install : true, | |
1573 | install_dir : rootbindir) | |
1574 | public_programs += [exe] | |
1575 | ||
1576 | exe = executable('systemd-inhibit', | |
1577 | 'src/login/inhibit.c', | |
1578 | include_directories : includes, | |
1579 | link_with : [libshared], | |
1580 | install_rpath : rootlibexecdir, | |
1581 | install : true, | |
1582 | install_dir : rootbindir) | |
1583 | public_programs += [exe] | |
1584 | ||
349cc4a5 | 1585 | if conf.get('HAVE_PAM') == 1 |
37efbbd8 ZJS |
1586 | version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) |
1587 | pam_systemd = shared_library( | |
1588 | 'pam_systemd', | |
1589 | pam_systemd_c, | |
1590 | name_prefix : '', | |
1591 | include_directories : includes, | |
1592 | link_args : ['-shared', | |
1593 | '-Wl,--version-script=' + version_script_arg], | |
37e4d7a8 | 1594 | link_with : [libsystemd_static, |
37efbbd8 ZJS |
1595 | libshared_static], |
1596 | dependencies : [threads, | |
1597 | libpam, | |
1598 | libpam_misc], | |
1599 | link_depends : pam_systemd_sym, | |
1600 | install : true, | |
1601 | install_dir : pamlibdir) | |
1602 | ||
1603 | test('dlopen-pam_systemd', | |
1604 | test_dlopen, | |
1605 | args : [pam_systemd.full_path()]) # path to dlopen must include a slash | |
1606 | endif | |
1607 | endif | |
005a29f2 | 1608 | |
349cc4a5 | 1609 | if conf.get('HAVE_PAM') == 1 |
37efbbd8 ZJS |
1610 | executable('systemd-user-sessions', |
1611 | 'src/user-sessions/user-sessions.c', | |
005a29f2 | 1612 | include_directories : includes, |
aac26058 | 1613 | link_with : [libshared], |
005a29f2 ZJS |
1614 | install_rpath : rootlibexecdir, |
1615 | install : true, | |
37efbbd8 | 1616 | install_dir : rootlibexecdir) |
5c23128d ZJS |
1617 | endif |
1618 | ||
349cc4a5 | 1619 | if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1 |
37efbbd8 ZJS |
1620 | exe = executable('bootctl', |
1621 | 'src/boot/bootctl.c', | |
1622 | include_directories : includes, | |
1623 | link_with : [libshared], | |
1624 | dependencies : [libblkid], | |
1625 | install_rpath : rootlibexecdir, | |
1626 | install : true) | |
1627 | public_programs += [exe] | |
005a29f2 ZJS |
1628 | endif |
1629 | ||
1630 | exe = executable('systemd-socket-activate', 'src/activate/activate.c', | |
1631 | include_directories : includes, | |
1632 | link_with : [libshared], | |
1633 | dependencies : [threads], | |
1634 | install_rpath : rootlibexecdir, | |
1635 | install : true) | |
1636 | public_programs += [exe] | |
1637 | ||
1638 | exe = executable('systemctl', 'src/systemctl/systemctl.c', | |
1639 | include_directories : includes, | |
aac26058 | 1640 | link_with : [libshared], |
005a29f2 ZJS |
1641 | dependencies : [threads, |
1642 | libcap, | |
1643 | libselinux, | |
1644 | libxz, | |
1645 | liblz4], | |
1646 | install_rpath : rootlibexecdir, | |
1647 | install : true, | |
1648 | install_dir : rootbindir) | |
1649 | public_programs += [exe] | |
5c23128d | 1650 | |
349cc4a5 | 1651 | if conf.get('ENABLE_BACKLIGHT') == 1 |
37efbbd8 ZJS |
1652 | executable('systemd-backlight', |
1653 | 'src/backlight/backlight.c', | |
1654 | include_directories : includes, | |
34ce0a52 | 1655 | link_with : [libshared], |
37efbbd8 ZJS |
1656 | install_rpath : rootlibexecdir, |
1657 | install : true, | |
1658 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
1659 | endif |
1660 | ||
349cc4a5 | 1661 | if conf.get('ENABLE_RFKILL') == 1 |
37efbbd8 ZJS |
1662 | executable('systemd-rfkill', |
1663 | 'src/rfkill/rfkill.c', | |
1664 | include_directories : includes, | |
34ce0a52 | 1665 | link_with : [libshared], |
37efbbd8 ZJS |
1666 | install_rpath : rootlibexecdir, |
1667 | install : true, | |
1668 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
1669 | endif |
1670 | ||
1671 | executable('systemd-system-update-generator', | |
1672 | 'src/system-update-generator/system-update-generator.c', | |
1673 | include_directories : includes, | |
1674 | link_with : [libshared], | |
b2fc5836 | 1675 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1676 | install : true, |
1677 | install_dir : systemgeneratordir) | |
1678 | ||
349cc4a5 | 1679 | if conf.get('HAVE_LIBCRYPTSETUP') == 1 |
37efbbd8 ZJS |
1680 | executable('systemd-cryptsetup', |
1681 | 'src/cryptsetup/cryptsetup.c', | |
1682 | include_directories : includes, | |
1683 | link_with : [libshared], | |
1684 | dependencies : [libcryptsetup], | |
1685 | install_rpath : rootlibexecdir, | |
1686 | install : true, | |
1687 | install_dir : rootlibexecdir) | |
1688 | ||
1689 | executable('systemd-cryptsetup-generator', | |
1690 | 'src/cryptsetup/cryptsetup-generator.c', | |
1691 | include_directories : includes, | |
1692 | link_with : [libshared], | |
1693 | dependencies : [libcryptsetup], | |
1694 | install_rpath : rootlibexecdir, | |
1695 | install : true, | |
1696 | install_dir : systemgeneratordir) | |
1697 | ||
1698 | executable('systemd-veritysetup', | |
1699 | 'src/veritysetup/veritysetup.c', | |
1700 | include_directories : includes, | |
1701 | link_with : [libshared], | |
1702 | dependencies : [libcryptsetup], | |
1703 | install_rpath : rootlibexecdir, | |
1704 | install : true, | |
1705 | install_dir : rootlibexecdir) | |
1706 | ||
1707 | executable('systemd-veritysetup-generator', | |
1708 | 'src/veritysetup/veritysetup-generator.c', | |
1709 | include_directories : includes, | |
1710 | link_with : [libshared], | |
1711 | dependencies : [libcryptsetup], | |
1712 | install_rpath : rootlibexecdir, | |
1713 | install : true, | |
1714 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
1715 | endif |
1716 | ||
349cc4a5 | 1717 | if conf.get('HAVE_SYSV_COMPAT') == 1 |
37efbbd8 ZJS |
1718 | executable('systemd-sysv-generator', |
1719 | 'src/sysv-generator/sysv-generator.c', | |
1720 | include_directories : includes, | |
1721 | link_with : [libshared], | |
1722 | install_rpath : rootlibexecdir, | |
1723 | install : true, | |
1724 | install_dir : systemgeneratordir) | |
1725 | ||
1726 | executable('systemd-rc-local-generator', | |
1727 | 'src/rc-local-generator/rc-local-generator.c', | |
1728 | include_directories : includes, | |
1729 | link_with : [libshared], | |
1730 | install_rpath : rootlibexecdir, | |
1731 | install : true, | |
1732 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
1733 | endif |
1734 | ||
349cc4a5 | 1735 | if conf.get('ENABLE_HOSTNAMED') == 1 |
37efbbd8 ZJS |
1736 | executable('systemd-hostnamed', |
1737 | 'src/hostname/hostnamed.c', | |
005a29f2 | 1738 | include_directories : includes, |
aac26058 | 1739 | link_with : [libshared], |
005a29f2 | 1740 | install_rpath : rootlibexecdir, |
37efbbd8 ZJS |
1741 | install : true, |
1742 | install_dir : rootlibexecdir) | |
1743 | ||
1744 | exe = executable('hostnamectl', | |
1745 | 'src/hostname/hostnamectl.c', | |
1746 | include_directories : includes, | |
1747 | link_with : [libshared], | |
1748 | install_rpath : rootlibexecdir, | |
1749 | install : true) | |
1750 | public_programs += [exe] | |
5c23128d ZJS |
1751 | endif |
1752 | ||
349cc4a5 ZJS |
1753 | if conf.get('ENABLE_LOCALED') == 1 |
1754 | if conf.get('HAVE_XKBCOMMON') == 1 | |
37efbbd8 ZJS |
1755 | # logind will load libxkbcommon.so dynamically on its own |
1756 | deps = [libdl] | |
1757 | else | |
1758 | deps = [] | |
1759 | endif | |
1760 | ||
1761 | executable('systemd-localed', | |
1762 | systemd_localed_sources, | |
005a29f2 | 1763 | include_directories : includes, |
aac26058 | 1764 | link_with : [libshared], |
37efbbd8 | 1765 | dependencies : deps, |
005a29f2 | 1766 | install_rpath : rootlibexecdir, |
37efbbd8 ZJS |
1767 | install : true, |
1768 | install_dir : rootlibexecdir) | |
1769 | ||
1770 | exe = executable('localectl', | |
1771 | localectl_sources, | |
1772 | include_directories : includes, | |
1773 | link_with : [libshared], | |
1774 | install_rpath : rootlibexecdir, | |
1775 | install : true) | |
1776 | public_programs += [exe] | |
5c23128d ZJS |
1777 | endif |
1778 | ||
349cc4a5 | 1779 | if conf.get('ENABLE_TIMEDATED') == 1 |
37efbbd8 ZJS |
1780 | executable('systemd-timedated', |
1781 | 'src/timedate/timedated.c', | |
005a29f2 | 1782 | include_directories : includes, |
aac26058 | 1783 | link_with : [libshared], |
37efbbd8 ZJS |
1784 | install_rpath : rootlibexecdir, |
1785 | install : true, | |
1786 | install_dir : rootlibexecdir) | |
5c23128d | 1787 | |
37efbbd8 ZJS |
1788 | exe = executable('timedatectl', |
1789 | 'src/timedate/timedatectl.c', | |
1790 | include_directories : includes, | |
1791 | install_rpath : rootlibexecdir, | |
1792 | link_with : [libshared], | |
1793 | install : true) | |
1794 | public_programs += [exe] | |
5c23128d ZJS |
1795 | endif |
1796 | ||
349cc4a5 | 1797 | if conf.get('ENABLE_TIMESYNCD') == 1 |
37efbbd8 ZJS |
1798 | executable('systemd-timesyncd', |
1799 | systemd_timesyncd_sources, | |
005a29f2 | 1800 | include_directories : includes, |
aac26058 | 1801 | link_with : [libshared], |
005a29f2 | 1802 | dependencies : [threads, |
37efbbd8 | 1803 | libm], |
005a29f2 ZJS |
1804 | install_rpath : rootlibexecdir, |
1805 | install : true, | |
37efbbd8 | 1806 | install_dir : rootlibexecdir) |
5c23128d ZJS |
1807 | endif |
1808 | ||
349cc4a5 | 1809 | if conf.get('ENABLE_MACHINED') == 1 |
37efbbd8 ZJS |
1810 | executable('systemd-machined', |
1811 | systemd_machined_sources, | |
1812 | include_directories : includes, | |
1813 | link_with : [libmachine_core, | |
1814 | libshared], | |
1815 | install_rpath : rootlibexecdir, | |
1816 | install : true, | |
1817 | install_dir : rootlibexecdir) | |
1818 | ||
1819 | exe = executable('machinectl', | |
1820 | 'src/machine/machinectl.c', | |
1821 | include_directories : includes, | |
1822 | link_with : [libshared], | |
1823 | dependencies : [threads, | |
1824 | libxz, | |
1825 | liblz4], | |
1826 | install_rpath : rootlibexecdir, | |
1827 | install : true, | |
1828 | install_dir : rootbindir) | |
1829 | public_programs += [exe] | |
5c23128d ZJS |
1830 | endif |
1831 | ||
349cc4a5 | 1832 | if conf.get('ENABLE_IMPORTD') == 1 |
37efbbd8 ZJS |
1833 | executable('systemd-importd', |
1834 | systemd_importd_sources, | |
005a29f2 | 1835 | include_directories : includes, |
aac26058 | 1836 | link_with : [libshared], |
37efbbd8 | 1837 | dependencies : [threads], |
005a29f2 ZJS |
1838 | install_rpath : rootlibexecdir, |
1839 | install : true, | |
1840 | install_dir : rootlibexecdir) | |
37efbbd8 ZJS |
1841 | |
1842 | systemd_pull = executable('systemd-pull', | |
1843 | systemd_pull_sources, | |
1844 | include_directories : includes, | |
1845 | link_with : [libshared], | |
1846 | dependencies : [libcurl, | |
1847 | libz, | |
1848 | libbzip2, | |
1849 | libxz, | |
1850 | libgcrypt], | |
1851 | install_rpath : rootlibexecdir, | |
1852 | install : true, | |
1853 | install_dir : rootlibexecdir) | |
1854 | ||
1855 | systemd_import = executable('systemd-import', | |
1856 | systemd_import_sources, | |
1857 | include_directories : includes, | |
1858 | link_with : [libshared], | |
1859 | dependencies : [libcurl, | |
1860 | libz, | |
1861 | libbzip2, | |
1862 | libxz], | |
1863 | install_rpath : rootlibexecdir, | |
1864 | install : true, | |
1865 | install_dir : rootlibexecdir) | |
1866 | ||
1867 | systemd_export = executable('systemd-export', | |
1868 | systemd_export_sources, | |
1869 | include_directories : includes, | |
1870 | link_with : [libshared], | |
1871 | dependencies : [libcurl, | |
1872 | libz, | |
1873 | libbzip2, | |
1874 | libxz], | |
1875 | install_rpath : rootlibexecdir, | |
1876 | install : true, | |
1877 | install_dir : rootlibexecdir) | |
1878 | public_programs += [systemd_pull, systemd_import, systemd_export] | |
1879 | endif | |
1880 | ||
349cc4a5 | 1881 | if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1 |
37efbbd8 ZJS |
1882 | exe = executable('systemd-journal-upload', |
1883 | systemd_journal_upload_sources, | |
1884 | include_directories : includes, | |
1885 | link_with : [libshared], | |
1886 | dependencies : [threads, | |
1887 | libcurl, | |
1888 | libgnutls, | |
1889 | libxz, | |
1890 | liblz4], | |
1891 | install_rpath : rootlibexecdir, | |
1892 | install : true, | |
1893 | install_dir : rootlibexecdir) | |
1894 | public_programs += [exe] | |
5c23128d ZJS |
1895 | endif |
1896 | ||
349cc4a5 | 1897 | if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 |
37efbbd8 ZJS |
1898 | s_j_remote = executable('systemd-journal-remote', |
1899 | systemd_journal_remote_sources, | |
1900 | include_directories : includes, | |
1901 | link_with : [libshared], | |
1902 | dependencies : [threads, | |
1903 | libmicrohttpd, | |
1904 | libgnutls, | |
1905 | libxz, | |
1906 | liblz4], | |
1907 | install_rpath : rootlibexecdir, | |
1908 | install : true, | |
1909 | install_dir : rootlibexecdir) | |
1910 | ||
1911 | s_j_gatewayd = executable('systemd-journal-gatewayd', | |
1912 | systemd_journal_gatewayd_sources, | |
1913 | include_directories : includes, | |
1914 | link_with : [libshared], | |
1915 | dependencies : [threads, | |
1916 | libmicrohttpd, | |
1917 | libgnutls, | |
1918 | libxz, | |
1919 | liblz4], | |
1920 | install_rpath : rootlibexecdir, | |
1921 | install : true, | |
1922 | install_dir : rootlibexecdir) | |
1923 | public_programs += [s_j_remote, s_j_gatewayd] | |
5c23128d ZJS |
1924 | endif |
1925 | ||
349cc4a5 | 1926 | if conf.get('ENABLE_COREDUMP') == 1 |
37efbbd8 ZJS |
1927 | executable('systemd-coredump', |
1928 | systemd_coredump_sources, | |
005a29f2 | 1929 | include_directories : includes, |
aac26058 | 1930 | link_with : [libshared], |
005a29f2 | 1931 | dependencies : [threads, |
37efbbd8 ZJS |
1932 | libacl, |
1933 | libdw, | |
005a29f2 ZJS |
1934 | libxz, |
1935 | liblz4], | |
1936 | install_rpath : rootlibexecdir, | |
37efbbd8 ZJS |
1937 | install : true, |
1938 | install_dir : rootlibexecdir) | |
1939 | ||
1940 | exe = executable('coredumpctl', | |
1941 | coredumpctl_sources, | |
1942 | include_directories : includes, | |
1943 | link_with : [libshared], | |
1944 | dependencies : [threads, | |
1945 | libxz, | |
1946 | liblz4], | |
1947 | install_rpath : rootlibexecdir, | |
1948 | install : true) | |
1949 | public_programs += [exe] | |
5c23128d ZJS |
1950 | endif |
1951 | ||
349cc4a5 | 1952 | if conf.get('ENABLE_BINFMT') == 1 |
37efbbd8 ZJS |
1953 | exe = executable('systemd-binfmt', |
1954 | 'src/binfmt/binfmt.c', | |
1955 | include_directories : includes, | |
1956 | link_with : [libshared], | |
1957 | install_rpath : rootlibexecdir, | |
1958 | install : true, | |
1959 | install_dir : rootlibexecdir) | |
1960 | public_programs += [exe] | |
1961 | ||
1962 | meson.add_install_script('sh', '-c', | |
1963 | mkdir_p.format(binfmtdir)) | |
1964 | meson.add_install_script('sh', '-c', | |
1965 | mkdir_p.format(join_paths(sysconfdir, 'binfmt.d'))) | |
1966 | endif | |
1967 | ||
349cc4a5 | 1968 | if conf.get('ENABLE_VCONSOLE') == 1 |
37efbbd8 ZJS |
1969 | executable('systemd-vconsole-setup', |
1970 | 'src/vconsole/vconsole-setup.c', | |
005a29f2 ZJS |
1971 | include_directories : includes, |
1972 | link_with : [libshared], | |
1973 | install_rpath : rootlibexecdir, | |
1974 | install : true, | |
1975 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
1976 | endif |
1977 | ||
349cc4a5 | 1978 | if conf.get('ENABLE_RANDOMSEED') == 1 |
37efbbd8 ZJS |
1979 | executable('systemd-random-seed', |
1980 | 'src/random-seed/random-seed.c', | |
1981 | include_directories : includes, | |
1982 | link_with : [libshared], | |
1983 | install_rpath : rootlibexecdir, | |
1984 | install : true, | |
1985 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
1986 | endif |
1987 | ||
349cc4a5 | 1988 | if conf.get('ENABLE_FIRSTBOOT') == 1 |
37efbbd8 ZJS |
1989 | executable('systemd-firstboot', |
1990 | 'src/firstboot/firstboot.c', | |
1991 | include_directories : includes, | |
1992 | link_with : [libshared], | |
1993 | dependencies : [libcrypt], | |
1994 | install_rpath : rootlibexecdir, | |
1995 | install : true, | |
1996 | install_dir : rootbindir) | |
5c23128d ZJS |
1997 | endif |
1998 | ||
1999 | executable('systemd-remount-fs', | |
2000 | 'src/remount-fs/remount-fs.c', | |
2001 | 'src/core/mount-setup.c', | |
2002 | 'src/core/mount-setup.h', | |
2003 | include_directories : includes, | |
2004 | link_with : [libshared], | |
b2fc5836 | 2005 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2006 | install : true, |
2007 | install_dir : rootlibexecdir) | |
2008 | ||
2009 | executable('systemd-machine-id-setup', | |
2010 | 'src/machine-id-setup/machine-id-setup-main.c', | |
2011 | 'src/core/machine-id-setup.c', | |
2012 | 'src/core/machine-id-setup.h', | |
2013 | include_directories : includes, | |
aac26058 | 2014 | link_with : [libshared], |
b2fc5836 | 2015 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2016 | install : true, |
2017 | install_dir : rootbindir) | |
2018 | ||
2019 | executable('systemd-fsck', | |
2020 | 'src/fsck/fsck.c', | |
2021 | include_directories : includes, | |
aac26058 | 2022 | link_with : [libshared], |
421f0012 | 2023 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2024 | install : true, |
2025 | install_dir : rootlibexecdir) | |
2026 | ||
80750adb ZJS |
2027 | executable('systemd-growfs', |
2028 | 'src/partition/growfs.c', | |
2029 | include_directories : includes, | |
2030 | link_with : [libshared], | |
c34b75a1 | 2031 | dependencies : [libcryptsetup], |
80750adb ZJS |
2032 | install_rpath : rootlibexecdir, |
2033 | install : true, | |
2034 | install_dir : rootlibexecdir) | |
2035 | ||
b7f28ac5 ZJS |
2036 | executable('systemd-makefs', |
2037 | 'src/partition/makefs.c', | |
2038 | include_directories : includes, | |
2039 | link_with : [libshared], | |
2040 | install_rpath : rootlibexecdir, | |
2041 | install : true, | |
2042 | install_dir : rootlibexecdir) | |
2043 | ||
5c23128d ZJS |
2044 | executable('systemd-sleep', |
2045 | 'src/sleep/sleep.c', | |
2046 | include_directories : includes, | |
2047 | link_with : [libshared], | |
421f0012 | 2048 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2049 | install : true, |
2050 | install_dir : rootlibexecdir) | |
2051 | ||
005a29f2 ZJS |
2052 | exe = executable('systemd-sysctl', |
2053 | 'src/sysctl/sysctl.c', | |
2054 | include_directories : includes, | |
2055 | link_with : [libshared], | |
2056 | install_rpath : rootlibexecdir, | |
2057 | install : true, | |
2058 | install_dir : rootlibexecdir) | |
2059 | public_programs += [exe] | |
5c23128d ZJS |
2060 | |
2061 | executable('systemd-ac-power', | |
2062 | 'src/ac-power/ac-power.c', | |
2063 | include_directories : includes, | |
2064 | link_with : [libshared], | |
421f0012 | 2065 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2066 | install : true, |
2067 | install_dir : rootlibexecdir) | |
2068 | ||
005a29f2 ZJS |
2069 | exe = executable('systemd-detect-virt', |
2070 | 'src/detect-virt/detect-virt.c', | |
2071 | include_directories : includes, | |
2072 | link_with : [libshared], | |
2073 | install_rpath : rootlibexecdir, | |
2074 | install : true) | |
2075 | public_programs += [exe] | |
2076 | ||
2077 | exe = executable('systemd-delta', | |
2078 | 'src/delta/delta.c', | |
2079 | include_directories : includes, | |
2080 | link_with : [libshared], | |
2081 | install_rpath : rootlibexecdir, | |
2082 | install : true) | |
2083 | public_programs += [exe] | |
2084 | ||
2085 | exe = executable('systemd-escape', | |
2086 | 'src/escape/escape.c', | |
2087 | include_directories : includes, | |
2088 | link_with : [libshared], | |
2089 | install_rpath : rootlibexecdir, | |
2090 | install : true, | |
2091 | install_dir : rootbindir) | |
2092 | public_programs += [exe] | |
2093 | ||
2094 | exe = executable('systemd-notify', | |
2095 | 'src/notify/notify.c', | |
2096 | include_directories : includes, | |
2097 | link_with : [libshared], | |
2098 | install_rpath : rootlibexecdir, | |
2099 | install : true, | |
2100 | install_dir : rootbindir) | |
2101 | public_programs += [exe] | |
5c23128d ZJS |
2102 | |
2103 | executable('systemd-volatile-root', | |
2104 | 'src/volatile-root/volatile-root.c', | |
2105 | include_directories : includes, | |
2106 | link_with : [libshared], | |
421f0012 | 2107 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2108 | install : true, |
2109 | install_dir : rootlibexecdir) | |
2110 | ||
2111 | executable('systemd-cgroups-agent', | |
2112 | 'src/cgroups-agent/cgroups-agent.c', | |
2113 | include_directories : includes, | |
2114 | link_with : [libshared], | |
421f0012 | 2115 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2116 | install : true, |
2117 | install_dir : rootlibexecdir) | |
2118 | ||
005a29f2 ZJS |
2119 | exe = executable('systemd-path', |
2120 | 'src/path/path.c', | |
2121 | include_directories : includes, | |
aac26058 | 2122 | link_with : [libshared], |
005a29f2 ZJS |
2123 | install_rpath : rootlibexecdir, |
2124 | install : true) | |
2125 | public_programs += [exe] | |
2126 | ||
2127 | exe = executable('systemd-ask-password', | |
2128 | 'src/ask-password/ask-password.c', | |
2129 | include_directories : includes, | |
aac26058 | 2130 | link_with : [libshared], |
005a29f2 ZJS |
2131 | install_rpath : rootlibexecdir, |
2132 | install : true, | |
2133 | install_dir : rootbindir) | |
2134 | public_programs += [exe] | |
5c23128d ZJS |
2135 | |
2136 | executable('systemd-reply-password', | |
2137 | 'src/reply-password/reply-password.c', | |
2138 | include_directories : includes, | |
aac26058 | 2139 | link_with : [libshared], |
421f0012 | 2140 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2141 | install : true, |
2142 | install_dir : rootlibexecdir) | |
2143 | ||
005a29f2 ZJS |
2144 | exe = executable('systemd-tty-ask-password-agent', |
2145 | 'src/tty-ask-password-agent/tty-ask-password-agent.c', | |
2146 | include_directories : includes, | |
aac26058 | 2147 | link_with : [libshared], |
005a29f2 ZJS |
2148 | install_rpath : rootlibexecdir, |
2149 | install : true, | |
2150 | install_dir : rootbindir) | |
2151 | public_programs += [exe] | |
2152 | ||
2153 | exe = executable('systemd-cgls', | |
2154 | 'src/cgls/cgls.c', | |
2155 | include_directories : includes, | |
aac26058 | 2156 | link_with : [libshared], |
005a29f2 ZJS |
2157 | install_rpath : rootlibexecdir, |
2158 | install : true) | |
2159 | public_programs += [exe] | |
2160 | ||
2161 | exe = executable('systemd-cgtop', | |
2162 | 'src/cgtop/cgtop.c', | |
2163 | include_directories : includes, | |
aac26058 | 2164 | link_with : [libshared], |
005a29f2 ZJS |
2165 | install_rpath : rootlibexecdir, |
2166 | install : true) | |
2167 | public_programs += [exe] | |
5c23128d ZJS |
2168 | |
2169 | executable('systemd-initctl', | |
2170 | 'src/initctl/initctl.c', | |
2171 | include_directories : includes, | |
aac26058 | 2172 | link_with : [libshared], |
421f0012 | 2173 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2174 | install : true, |
2175 | install_dir : rootlibexecdir) | |
2176 | ||
005a29f2 ZJS |
2177 | exe = executable('systemd-mount', |
2178 | 'src/mount/mount-tool.c', | |
2179 | include_directories : includes, | |
34ce0a52 | 2180 | link_with : [libshared], |
005a29f2 ZJS |
2181 | install_rpath : rootlibexecdir, |
2182 | install : true) | |
2183 | public_programs += [exe] | |
5c23128d | 2184 | |
7b76fce1 | 2185 | meson.add_install_script(meson_make_symlink, |
e17e5ba9 | 2186 | 'systemd-mount', join_paths(bindir, 'systemd-umount')) |
7b76fce1 | 2187 | |
005a29f2 ZJS |
2188 | exe = executable('systemd-run', |
2189 | 'src/run/run.c', | |
2190 | include_directories : includes, | |
aac26058 | 2191 | link_with : [libshared], |
005a29f2 ZJS |
2192 | install_rpath : rootlibexecdir, |
2193 | install : true) | |
2194 | public_programs += [exe] | |
2195 | ||
2196 | exe = executable('systemd-stdio-bridge', | |
2197 | 'src/stdio-bridge/stdio-bridge.c', | |
2198 | include_directories : includes, | |
aac26058 | 2199 | link_with : [libshared], |
005a29f2 ZJS |
2200 | install_rpath : rootlibexecdir, |
2201 | install : true) | |
2202 | public_programs += [exe] | |
2203 | ||
2204 | exe = executable('busctl', | |
2205 | 'src/busctl/busctl.c', | |
2206 | 'src/busctl/busctl-introspect.c', | |
2207 | 'src/busctl/busctl-introspect.h', | |
2208 | include_directories : includes, | |
aac26058 | 2209 | link_with : [libshared], |
005a29f2 ZJS |
2210 | install_rpath : rootlibexecdir, |
2211 | install : true) | |
2212 | public_programs += [exe] | |
5c23128d | 2213 | |
349cc4a5 | 2214 | if conf.get('ENABLE_SYSUSERS') == 1 |
37efbbd8 ZJS |
2215 | exe = executable('systemd-sysusers', |
2216 | 'src/sysusers/sysusers.c', | |
2217 | include_directories : includes, | |
2218 | link_with : [libshared], | |
2219 | install_rpath : rootlibexecdir, | |
2220 | install : true, | |
2221 | install_dir : rootbindir) | |
2222 | public_programs += [exe] | |
5c23128d ZJS |
2223 | endif |
2224 | ||
349cc4a5 | 2225 | if conf.get('ENABLE_TMPFILES') == 1 |
37efbbd8 ZJS |
2226 | exe = executable('systemd-tmpfiles', |
2227 | 'src/tmpfiles/tmpfiles.c', | |
2228 | include_directories : includes, | |
2229 | link_with : [libshared], | |
2230 | dependencies : [libacl], | |
2231 | install_rpath : rootlibexecdir, | |
2232 | install : true, | |
2233 | install_dir : rootbindir) | |
2234 | public_programs += [exe] | |
d9daae55 ZJS |
2235 | |
2236 | test('test-systemd-tmpfiles', | |
2237 | test_systemd_tmpfiles_py, | |
2238 | args : exe.full_path()) | |
2239 | # https://github.com/mesonbuild/meson/issues/2681 | |
5c23128d ZJS |
2240 | endif |
2241 | ||
349cc4a5 | 2242 | if conf.get('ENABLE_HWDB') == 1 |
37efbbd8 ZJS |
2243 | exe = executable('systemd-hwdb', |
2244 | 'src/hwdb/hwdb.c', | |
2245 | 'src/libsystemd/sd-hwdb/hwdb-internal.h', | |
2246 | include_directories : includes, | |
0c06b506 | 2247 | link_with : [libudev_static], |
0da6f396 | 2248 | install_rpath : udev_rpath, |
37efbbd8 ZJS |
2249 | install : true, |
2250 | install_dir : rootbindir) | |
2251 | public_programs += [exe] | |
2252 | endif | |
2253 | ||
349cc4a5 | 2254 | if conf.get('ENABLE_QUOTACHECK') == 1 |
37efbbd8 ZJS |
2255 | executable('systemd-quotacheck', |
2256 | 'src/quotacheck/quotacheck.c', | |
005a29f2 | 2257 | include_directories : includes, |
aac26058 | 2258 | link_with : [libshared], |
005a29f2 ZJS |
2259 | install_rpath : rootlibexecdir, |
2260 | install : true, | |
37efbbd8 | 2261 | install_dir : rootlibexecdir) |
5c23128d ZJS |
2262 | endif |
2263 | ||
005a29f2 ZJS |
2264 | exe = executable('systemd-socket-proxyd', |
2265 | 'src/socket-proxy/socket-proxyd.c', | |
2266 | include_directories : includes, | |
aac26058 | 2267 | link_with : [libshared], |
005a29f2 ZJS |
2268 | dependencies : [threads], |
2269 | install_rpath : rootlibexecdir, | |
2270 | install : true, | |
2271 | install_dir : rootlibexecdir) | |
2272 | public_programs += [exe] | |
2273 | ||
2274 | exe = executable('systemd-udevd', | |
2275 | systemd_udevd_sources, | |
2276 | include_directories : includes, | |
5c72049f | 2277 | c_args : ['-DLOG_REALM=LOG_REALM_UDEV'], |
005a29f2 | 2278 | link_with : [libudev_core, |
005a29f2 | 2279 | libsystemd_network, |
0c06b506 | 2280 | libudev_static], |
3a30f21f ZJS |
2281 | dependencies : [threads, |
2282 | libkmod, | |
005a29f2 | 2283 | libidn, |
aac26058 ZJS |
2284 | libacl, |
2285 | libblkid], | |
1aec3ed9 | 2286 | install_rpath : udev_rpath, |
005a29f2 ZJS |
2287 | install : true, |
2288 | install_dir : rootlibexecdir) | |
2289 | public_programs += [exe] | |
2290 | ||
2291 | exe = executable('udevadm', | |
2292 | udevadm_sources, | |
6671e818 | 2293 | c_args : ['-DLOG_REALM=LOG_REALM_UDEV'], |
005a29f2 ZJS |
2294 | include_directories : includes, |
2295 | link_with : [libudev_core, | |
005a29f2 | 2296 | libsystemd_network, |
0c06b506 | 2297 | libudev_static], |
3a30f21f ZJS |
2298 | dependencies : [threads, |
2299 | libkmod, | |
005a29f2 | 2300 | libidn, |
aac26058 ZJS |
2301 | libacl, |
2302 | libblkid], | |
1aec3ed9 | 2303 | install_rpath : udev_rpath, |
005a29f2 ZJS |
2304 | install : true, |
2305 | install_dir : rootbindir) | |
2306 | public_programs += [exe] | |
5c23128d ZJS |
2307 | |
2308 | executable('systemd-shutdown', | |
2309 | systemd_shutdown_sources, | |
2310 | include_directories : includes, | |
34ce0a52 | 2311 | link_with : [libshared], |
421f0012 | 2312 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2313 | install : true, |
2314 | install_dir : rootlibexecdir) | |
2315 | ||
2316 | executable('systemd-update-done', | |
2317 | 'src/update-done/update-done.c', | |
2318 | include_directories : includes, | |
2319 | link_with : [libshared], | |
421f0012 | 2320 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2321 | install : true, |
2322 | install_dir : rootlibexecdir) | |
2323 | ||
2324 | executable('systemd-update-utmp', | |
2325 | 'src/update-utmp/update-utmp.c', | |
2326 | include_directories : includes, | |
aac26058 | 2327 | link_with : [libshared], |
5c23128d | 2328 | dependencies : [libaudit], |
421f0012 | 2329 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2330 | install : true, |
2331 | install_dir : rootlibexecdir) | |
2332 | ||
349cc4a5 | 2333 | if conf.get('HAVE_KMOD') == 1 |
37efbbd8 ZJS |
2334 | executable('systemd-modules-load', |
2335 | 'src/modules-load/modules-load.c', | |
2336 | include_directories : includes, | |
2337 | link_with : [libshared], | |
2338 | dependencies : [libkmod], | |
2339 | install_rpath : rootlibexecdir, | |
2340 | install : true, | |
2341 | install_dir : rootlibexecdir) | |
94e75a54 | 2342 | |
37efbbd8 ZJS |
2343 | meson.add_install_script('sh', '-c', |
2344 | mkdir_p.format(modulesloaddir)) | |
2345 | meson.add_install_script('sh', '-c', | |
2346 | mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) | |
5c23128d ZJS |
2347 | endif |
2348 | ||
005a29f2 ZJS |
2349 | exe = executable('systemd-nspawn', |
2350 | systemd_nspawn_sources, | |
2351 | 'src/core/mount-setup.c', # FIXME: use a variable? | |
2352 | 'src/core/mount-setup.h', | |
2353 | 'src/core/loopback-setup.c', | |
2354 | 'src/core/loopback-setup.h', | |
2355 | include_directories : [includes, include_directories('src/nspawn')], | |
0bc91152 | 2356 | link_with : [libshared], |
005a29f2 ZJS |
2357 | dependencies : [libacl, |
2358 | libblkid, | |
2359 | libseccomp, | |
2360 | libselinux], | |
2361 | install_rpath : rootlibexecdir, | |
2362 | install : true) | |
2363 | public_programs += [exe] | |
5c23128d | 2364 | |
349cc4a5 | 2365 | if conf.get('ENABLE_NETWORKD') == 1 |
37efbbd8 ZJS |
2366 | executable('systemd-networkd', |
2367 | systemd_networkd_sources, | |
2368 | include_directories : includes, | |
2369 | link_with : [libnetworkd_core, | |
37efbbd8 | 2370 | libsystemd_network, |
0c06b506 | 2371 | libudev_static, |
37efbbd8 | 2372 | libshared], |
4b57a272 | 2373 | dependencies : [threads], |
37efbbd8 ZJS |
2374 | install_rpath : rootlibexecdir, |
2375 | install : true, | |
2376 | install_dir : rootlibexecdir) | |
2377 | ||
2378 | executable('systemd-networkd-wait-online', | |
2379 | systemd_networkd_wait_online_sources, | |
2380 | include_directories : includes, | |
2381 | link_with : [libnetworkd_core, | |
2382 | libshared], | |
2383 | install_rpath : rootlibexecdir, | |
2384 | install : true, | |
2385 | install_dir : rootlibexecdir) | |
5c23128d | 2386 | |
dcfe072a FS |
2387 | exe = executable('networkctl', |
2388 | networkctl_sources, | |
2389 | include_directories : includes, | |
2390 | link_with : [libsystemd_network, | |
aac26058 | 2391 | libshared], |
dcfe072a FS |
2392 | install_rpath : rootlibexecdir, |
2393 | install : true, | |
2394 | install_dir : rootbindir) | |
2395 | public_programs += [exe] | |
2396 | endif | |
e821f6a9 ZJS |
2397 | |
2398 | executable('systemd-sulogin-shell', | |
2399 | ['src/sulogin-shell/sulogin-shell.c'], | |
2400 | include_directories : includes, | |
2401 | link_with : [libshared], | |
2402 | install_rpath : rootlibexecdir, | |
2403 | install : true, | |
2404 | install_dir : rootlibexecdir) | |
2405 | ||
69e96427 ZJS |
2406 | ############################################################ |
2407 | ||
2408 | foreach tuple : tests | |
37efbbd8 ZJS |
2409 | sources = tuple[0] |
2410 | link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] | |
2411 | dependencies = tuple[2] | |
2412 | condition = tuple.length() >= 4 ? tuple[3] : '' | |
2413 | type = tuple.length() >= 5 ? tuple[4] : '' | |
2414 | defs = tuple.length() >= 6 ? tuple[5] : [] | |
2415 | incs = tuple.length() >= 7 ? tuple[6] : includes | |
2416 | timeout = 30 | |
2417 | ||
2418 | name = sources[0].split('/')[-1].split('.')[0] | |
2419 | if type.startswith('timeout=') | |
2420 | timeout = type.split('=')[1].to_int() | |
2421 | type = '' | |
2422 | endif | |
08318a2c AD |
2423 | if want_tests == 'false' |
2424 | message('Not compiling @0@ because tests is set to false'.format(name)) | |
2425 | elif condition == '' or conf.get(condition) == 1 | |
37efbbd8 ZJS |
2426 | exe = executable( |
2427 | name, | |
2428 | sources, | |
2429 | include_directories : incs, | |
2430 | link_with : link_with, | |
2431 | dependencies : dependencies, | |
2432 | c_args : defs, | |
2433 | install_rpath : rootlibexecdir, | |
7cdd9783 MB |
2434 | install : install_tests, |
2435 | install_dir : join_paths(testsdir, type)) | |
37efbbd8 ZJS |
2436 | |
2437 | if type == 'manual' | |
2438 | message('@0@ is a manual test'.format(name)) | |
2439 | elif type == 'unsafe' and want_tests != 'unsafe' | |
2440 | message('@0@ is an unsafe test'.format(name)) | |
2441 | else | |
2442 | test(name, exe, | |
2443 | env : test_env, | |
2444 | timeout : timeout) | |
2445 | endif | |
2446 | else | |
2447 | message('Not compiling @0@ because @1@ is not true'.format(name, condition)) | |
2448 | endif | |
69e96427 ZJS |
2449 | endforeach |
2450 | ||
37ab1a25 | 2451 | test_libsystemd_sym = executable( |
37efbbd8 ZJS |
2452 | 'test-libsystemd-sym', |
2453 | test_libsystemd_sym_c, | |
2454 | include_directories : includes, | |
2455 | link_with : [libsystemd], | |
2456 | install : install_tests, | |
2457 | install_dir : testsdir) | |
37ab1a25 ZJS |
2458 | test('test-libsystemd-sym', |
2459 | test_libsystemd_sym) | |
2460 | ||
e0bec52f | 2461 | test_libudev_sym = executable( |
37efbbd8 ZJS |
2462 | 'test-libudev-sym', |
2463 | test_libudev_sym_c, | |
2464 | include_directories : includes, | |
2465 | c_args : ['-Wno-deprecated-declarations'], | |
2466 | link_with : [libudev], | |
2467 | install : install_tests, | |
2468 | install_dir : testsdir) | |
e0bec52f ZJS |
2469 | test('test-libudev-sym', |
2470 | test_libudev_sym) | |
2471 | ||
69e96427 | 2472 | ############################################################ |
5c23128d | 2473 | |
7db7d5b7 JR |
2474 | fuzzer_exes = [] |
2475 | ||
2476 | foreach tuple : fuzzers | |
2477 | sources = tuple[0] | |
2478 | link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] | |
2479 | dependencies = tuple[2] | |
2480 | defs = tuple.length() >= 4 ? tuple[3] : [] | |
2481 | incs = tuple.length() >= 5 ? tuple[4] : includes | |
2482 | ||
2483 | if ossfuzz | |
2484 | dependencies += fuzzing_engine | |
2485 | else | |
2486 | sources += 'src/fuzz/fuzz-main.c' | |
2487 | endif | |
2488 | ||
2489 | name = sources[0].split('/')[-1].split('.')[0] | |
2490 | ||
2491 | fuzzer_exes += executable( | |
2492 | name, | |
2493 | sources, | |
2494 | include_directories : [incs, include_directories('src/fuzz')], | |
2495 | link_with : link_with, | |
2496 | dependencies : dependencies, | |
2497 | c_args : defs, | |
2498 | install : false) | |
2499 | endforeach | |
2500 | ||
2501 | run_target('fuzzers', | |
2502 | depends : fuzzer_exes, | |
2503 | command : ['true']) | |
2504 | ||
2505 | ############################################################ | |
2506 | ||
5c23128d ZJS |
2507 | make_directive_index_py = find_program('tools/make-directive-index.py') |
2508 | make_man_index_py = find_program('tools/make-man-index.py') | |
b184e8fe | 2509 | xml_helper_py = find_program('tools/xml_helper.py') |
abba22c5 | 2510 | hwdb_update_sh = find_program('tools/meson-hwdb-update.sh') |
5c23128d ZJS |
2511 | |
2512 | subdir('units') | |
2513 | subdir('sysctl.d') | |
2514 | subdir('sysusers.d') | |
2515 | subdir('tmpfiles.d') | |
e783f957 | 2516 | subdir('presets') |
5c23128d ZJS |
2517 | subdir('hwdb') |
2518 | subdir('network') | |
2519 | subdir('man') | |
2520 | subdir('shell-completion/bash') | |
2521 | subdir('shell-completion/zsh') | |
2522 | subdir('docs/sysvinit') | |
2523 | subdir('docs/var-log') | |
2524 | ||
2525 | # FIXME: figure out if the warning is true: | |
2526 | # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir | |
2527 | install_subdir('factory/etc', | |
2528 | install_dir : factorydir) | |
2529 | ||
2530 | ||
2531 | install_data('xorg/50-systemd-user.sh', | |
2532 | install_dir : xinitrcdir) | |
582faeb4 DJL |
2533 | install_data('modprobe.d/systemd.conf', |
2534 | install_dir : modprobedir) | |
5c23128d ZJS |
2535 | install_data('README', |
2536 | 'NEWS', | |
2537 | 'CODING_STYLE', | |
2538 | 'DISTRO_PORTING', | |
2539 | 'ENVIRONMENT.md', | |
2540 | 'LICENSE.GPL2', | |
2541 | 'LICENSE.LGPL2.1', | |
f9f54413 FS |
2542 | 'TRANSIENT-SETTINGS.md', |
2543 | 'UIDS-GIDS.md', | |
5c23128d ZJS |
2544 | 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION', |
2545 | install_dir : docdir) | |
d68b342b | 2546 | |
94e75a54 ZJS |
2547 | meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir)) |
2548 | meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir)) | |
2549 | ||
d68b342b ZJS |
2550 | ############################################################ |
2551 | ||
005a29f2 ZJS |
2552 | meson_check_help = find_program('tools/meson-check-help.sh') |
2553 | ||
2554 | foreach exec : public_programs | |
37efbbd8 ZJS |
2555 | name = exec.full_path().split('/')[-1] |
2556 | test('check-help-' + name, | |
2557 | meson_check_help, | |
2558 | args : [exec.full_path()]) | |
005a29f2 ZJS |
2559 | endforeach |
2560 | ||
2561 | ############################################################ | |
2562 | ||
0700e8ba | 2563 | if git.found() |
37efbbd8 ZJS |
2564 | all_files = run_command( |
2565 | git, | |
450b60ba | 2566 | ['--git-dir=@0@/.git'.format(meson.current_source_dir()), |
37efbbd8 ZJS |
2567 | 'ls-files', |
2568 | ':/*.[ch]']) | |
2569 | all_files = files(all_files.stdout().split()) | |
d68b342b | 2570 | |
e85a690b | 2571 | custom_target( |
0700e8ba | 2572 | 'tags', |
e85a690b | 2573 | output : 'tags', |
450b60ba | 2574 | command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files) |
e85a690b | 2575 | custom_target( |
0700e8ba | 2576 | 'ctags', |
e85a690b | 2577 | output : 'ctags', |
450b60ba | 2578 | command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files) |
d68b342b | 2579 | endif |
177929c2 ZJS |
2580 | |
2581 | if git.found() | |
37efbbd8 | 2582 | meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') |
a923e085 | 2583 | run_target( |
37efbbd8 | 2584 | 'git-contrib', |
37efbbd8 | 2585 | command : [meson_git_contrib_sh]) |
177929c2 | 2586 | endif |
dd6ab3df ZJS |
2587 | |
2588 | if git.found() | |
2589 | git_head = run_command( | |
2590 | git, | |
450b60ba | 2591 | ['--git-dir=@0@/.git'.format(meson.current_source_dir()), |
dd6ab3df ZJS |
2592 | 'rev-parse', 'HEAD']).stdout().strip() |
2593 | git_head_short = run_command( | |
2594 | git, | |
450b60ba | 2595 | ['--git-dir=@0@/.git'.format(meson.current_source_dir()), |
dd6ab3df ZJS |
2596 | 'rev-parse', '--short=7', 'HEAD']).stdout().strip() |
2597 | ||
2598 | run_target( | |
2599 | 'git-snapshot', | |
2600 | command : ['git', 'archive', | |
450b60ba | 2601 | '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(), |
dd6ab3df ZJS |
2602 | git_head_short), |
2603 | '--prefix', 'systemd-@0@/'.format(git_head), | |
2604 | 'HEAD']) | |
2605 | endif | |
829257d1 ZJS |
2606 | |
2607 | ############################################################ | |
2608 | ||
51b13863 LP |
2609 | meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh') |
2610 | run_target( | |
2611 | 'check-api-docs', | |
2612 | depends : [man, libsystemd, libudev], | |
2613 | command : [meson_check_api_docs_sh, libsystemd.full_path(), libudev.full_path()]) | |
2614 | ||
2615 | ############################################################ | |
2616 | ||
829257d1 ZJS |
2617 | status = [ |
2618 | '@0@ @1@'.format(meson.project_name(), meson.project_version()), | |
2619 | ||
359b496f YW |
2620 | 'prefix directory: @0@'.format(prefixdir), |
2621 | 'rootprefix directory: @0@'.format(rootprefixdir), | |
2622 | 'sysconf directory: @0@'.format(sysconfdir), | |
2623 | 'include directory: @0@'.format(includedir), | |
2624 | 'lib directory: @0@'.format(libdir), | |
2625 | 'rootlib directory: @0@'.format(rootlibdir), | |
829257d1 ZJS |
2626 | 'SysV init scripts: @0@'.format(sysvinit_path), |
2627 | 'SysV rc?.d directories: @0@'.format(sysvrcnd_path), | |
359b496f YW |
2628 | 'PAM modules directory: @0@'.format(pamlibdir), |
2629 | 'PAM configuration directory: @0@'.format(pamconfdir), | |
2630 | 'RPM macros directory: @0@'.format(rpmmacrosdir), | |
2631 | 'modprobe.d directory: @0@'.format(modprobedir), | |
2632 | 'D-Bus policy directory: @0@'.format(dbuspolicydir), | |
2633 | 'D-Bus session directory: @0@'.format(dbussessionservicedir), | |
2634 | 'D-Bus system directory: @0@'.format(dbussystemservicedir), | |
2635 | 'bash completions directory: @0@'.format(bashcompletiondir), | |
2636 | 'zsh completions directory: @0@'.format(zshcompletiondir), | |
829257d1 ZJS |
2637 | 'extra start script: @0@'.format(get_option('rc-local')), |
2638 | 'extra stop script: @0@'.format(get_option('halt-local')), | |
2639 | 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'), | |
2640 | get_option('debug-tty')), | |
2641 | 'TTY GID: @0@'.format(tty_gid), | |
84786b8e | 2642 | 'users GID: @0@'.format(users_gid), |
829257d1 ZJS |
2643 | 'maximum system UID: @0@'.format(system_uid_max), |
2644 | 'maximum system GID: @0@'.format(system_gid_max), | |
87d5e4f2 LP |
2645 | 'minimum dynamic UID: @0@'.format(dynamic_uid_min), |
2646 | 'maximum dynamic UID: @0@'.format(dynamic_uid_max), | |
2647 | 'minimum container UID base: @0@'.format(container_uid_base_min), | |
2648 | 'maximum container UID base: @0@'.format(container_uid_base_max), | |
829257d1 | 2649 | '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')), |
4e15a734 | 2650 | 'render group access mode: @0@'.format(get_option('group-render-mode')), |
359b496f | 2651 | 'certificate root directory: @0@'.format(get_option('certificate-root')), |
829257d1 | 2652 | 'support URL: @0@'.format(support_url), |
afde4574 LP |
2653 | 'nobody user name: @0@'.format(nobody_user), |
2654 | 'nobody group name: @0@'.format(nobody_group), | |
829257d1 | 2655 | 'fallback hostname: @0@'.format(get_option('fallback-hostname')), |
5248e7e1 | 2656 | 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)), |
829257d1 ZJS |
2657 | |
2658 | 'default DNSSEC mode: @0@'.format(default_dnssec), | |
2659 | 'default cgroup hierarchy: @0@'.format(default_hierarchy), | |
2660 | 'default KillUserProcesses setting: @0@'.format(kill_user_processes)] | |
2661 | ||
2662 | alt_dns_servers = '\n '.join(dns_servers.split(' ')) | |
2663 | alt_ntp_servers = '\n '.join(ntp_servers.split(' ')) | |
2664 | status += [ | |
2665 | 'default DNS servers: @0@'.format(alt_dns_servers), | |
2666 | 'default NTP servers: @0@'.format(alt_ntp_servers)] | |
2667 | ||
2668 | alt_time_epoch = run_command('date', '-Is', '-u', '-d', | |
2669 | '@@0@'.format(time_epoch)).stdout().strip() | |
2670 | status += [ | |
2671 | 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)] | |
2672 | ||
2673 | # TODO: | |
2674 | # CFLAGS: ${OUR_CFLAGS} ${CFLAGS} | |
2675 | # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} | |
2676 | # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS} | |
2677 | ||
349cc4a5 | 2678 | if conf.get('ENABLE_EFI') == 1 |
829257d1 ZJS |
2679 | status += [ |
2680 | 'efi arch: @0@'.format(efi_arch)] | |
2681 | ||
2682 | if have_gnu_efi | |
2683 | status += [ | |
2684 | 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME), | |
2685 | 'EFI CC @0@'.format(efi_cc), | |
359b496f YW |
2686 | 'EFI lib directory: @0@'.format(efi_libdir), |
2687 | 'EFI lds directory: @0@'.format(efi_ldsdir), | |
2688 | 'EFI include directory: @0@'.format(efi_incdir)] | |
829257d1 ZJS |
2689 | endif |
2690 | endif | |
2691 | ||
2692 | found = [] | |
2693 | missing = [] | |
2694 | ||
2695 | foreach tuple : [ | |
2696 | ['libcryptsetup'], | |
2697 | ['PAM'], | |
2698 | ['AUDIT'], | |
2699 | ['IMA'], | |
2700 | ['AppArmor'], | |
2701 | ['SELinux'], | |
2702 | ['SECCOMP'], | |
2703 | ['SMACK'], | |
2704 | ['zlib'], | |
2705 | ['xz'], | |
2706 | ['lz4'], | |
2707 | ['bzip2'], | |
2708 | ['ACL'], | |
2709 | ['gcrypt'], | |
2710 | ['qrencode'], | |
2711 | ['microhttpd'], | |
2712 | ['gnutls'], | |
2713 | ['libcurl'], | |
d1bf5675 | 2714 | ['idn'], |
87057e24 | 2715 | ['libidn2'], |
829257d1 | 2716 | ['libidn'], |
e7e11bbf | 2717 | ['nss-systemd'], |
829257d1 ZJS |
2718 | ['libiptc'], |
2719 | ['elfutils'], | |
2720 | ['binfmt'], | |
2721 | ['vconsole'], | |
2722 | ['quotacheck'], | |
2723 | ['tmpfiles'], | |
2724 | ['environment.d'], | |
2725 | ['sysusers'], | |
2726 | ['firstboot'], | |
2727 | ['randomseed'], | |
2728 | ['backlight'], | |
2729 | ['rfkill'], | |
2730 | ['logind'], | |
2731 | ['machined'], | |
2732 | ['importd'], | |
2733 | ['hostnamed'], | |
2734 | ['timedated'], | |
2735 | ['timesyncd'], | |
2736 | ['localed'], | |
2737 | ['networkd'], | |
a7456af5 | 2738 | ['resolve'], |
829257d1 ZJS |
2739 | ['coredump'], |
2740 | ['polkit'], | |
2741 | ['legacy pkla', install_polkit_pkla], | |
2742 | ['efi'], | |
2743 | ['gnu-efi', have_gnu_efi], | |
2744 | ['kmod'], | |
2745 | ['xkbcommon'], | |
2746 | ['blkid'], | |
2747 | ['dbus'], | |
2748 | ['glib'], | |
08cf5b8d | 2749 | ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1], |
829257d1 ZJS |
2750 | ['hwdb'], |
2751 | ['tpm'], | |
2752 | ['man pages', want_man], | |
2753 | ['html pages', want_html], | |
2754 | ['man page indices', want_man and have_lxml], | |
349cc4a5 | 2755 | ['split /usr', conf.get('HAVE_SPLIT_USR') == 1], |
829257d1 ZJS |
2756 | ['SysV compat'], |
2757 | ['utmp'], | |
2758 | ['ldconfig'], | |
2759 | ['hibernate'], | |
2760 | ['adm group', get_option('adm-group')], | |
2761 | ['wheel group', get_option('wheel-group')], | |
b14e1b43 | 2762 | ['gshadow'], |
829257d1 ZJS |
2763 | ['debug hashmap'], |
2764 | ['debug mmap cache'], | |
2765 | ] | |
2766 | ||
2767 | cond = tuple.get(1, '') | |
2768 | if cond == '' | |
2769 | ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() | |
2770 | ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() | |
349cc4a5 | 2771 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 |
829257d1 ZJS |
2772 | endif |
2773 | if cond | |
2774 | found += [tuple[0]] | |
2775 | else | |
2776 | missing += [tuple[0]] | |
2777 | endif | |
2778 | endforeach | |
2779 | ||
2780 | status += [ | |
9d39c1bf | 2781 | '', |
829257d1 | 2782 | 'enabled features: @0@'.format(', '.join(found)), |
9d39c1bf ZJS |
2783 | '', |
2784 | 'disabled features: @0@'.format(', '.join(missing)), | |
2785 | ''] | |
829257d1 | 2786 | message('\n '.join(status)) |
9a8e64b0 ZJS |
2787 | |
2788 | if rootprefixdir != rootprefix_default | |
2789 | message('WARNING:\n' + | |
2790 | ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) + | |
2791 | ' systemd used fixed names for unit file directories and other paths, so anything\n' + | |
2792 | ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default)) | |
2793 | endif |