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