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