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