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