1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
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.
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.
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/>.
18 project('systemd', 'c',
27 meson_version : '>= 0.41',
30 libsystemd_version = '0.19.1'
31 libudev_version = '1.6.7'
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
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())
41 substs = configuration_data()
42 substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
43 substs.set('PACKAGE_VERSION', meson.project_version())
47 #####################################################################
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())
55 #####################################################################
57 conf.set10('HAVE_SPLIT_USR', get_option('split-usr'))
58 rootprefixdir = get_option('split-usr') ? '/' : '/usr'
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'] : []
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))
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'))
81 rootbindir = join_paths(rootprefixdir, 'bin')
82 rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
84 rootlibdir = get_option('rootlibdir')
86 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
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 = get_option('rpmmacrosdir')
98 if rpmmacrosdir != 'no'
99 rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
101 modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
104 pkgdatadir = join_paths(datadir, 'systemd')
105 environmentdir = join_paths(prefixdir, 'lib/environment.d')
106 pkgsysconfdir = join_paths(sysconfdir, 'systemd')
107 userunitdir = join_paths(prefixdir, 'lib/systemd/user')
108 userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
109 tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
110 sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
111 sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
112 binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
113 modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
114 networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
115 pkgincludedir = join_paths(includedir, 'systemd')
116 systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
117 usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
118 systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
119 userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
120 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
121 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
122 systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
123 systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
124 udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
125 udevhomedir = udevlibexecdir
126 udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
127 udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
128 catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
129 kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
130 factorydir = join_paths(datadir, 'factory')
131 docdir = join_paths(datadir, 'doc/systemd')
132 bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
133 testsdir = join_paths(prefixdir, 'lib/systemd/tests')
134 systemdstatedir = join_paths(localstatedir, 'lib/systemd')
135 catalogstatedir = join_paths(systemdstatedir, 'catalog')
136 randomseeddir = join_paths(localstatedir, 'lib/systemd')
138 dbuspolicydir = get_option('dbuspolicydir')
139 if dbuspolicydir == ''
140 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
143 dbussessionservicedir = get_option('dbussessionservicedir')
144 if dbussessionservicedir == ''
145 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
148 dbussystemservicedir = get_option('dbussystemservicedir')
149 if dbussystemservicedir == ''
150 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
153 pamlibdir = get_option('pamlibdir')
155 pamlibdir = join_paths(rootlibdir, 'security')
158 pamconfdir = get_option('pamconfdir')
160 pamconfdir = join_paths(sysconfdir, 'pam.d')
163 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
164 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
165 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
166 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
167 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
168 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
169 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
170 conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
171 conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
172 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
173 conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
174 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
175 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
176 conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
177 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
178 conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
179 conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
180 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
181 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
182 conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
183 conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
184 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
185 conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
186 conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
187 conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
188 conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
189 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
190 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
191 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
192 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
193 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
194 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
195 conf.set_quoted('LIBDIR', libdir)
196 conf.set_quoted('ROOTLIBDIR', rootlibdir)
197 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
198 conf.set_quoted('BOOTLIBDIR', bootlibdir)
199 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
200 conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
201 conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
202 conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
203 conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
204 conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
206 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
207 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
209 substs.set('prefix', prefixdir)
210 substs.set('exec_prefix', prefixdir)
211 substs.set('libdir', libdir)
212 substs.set('rootlibdir', rootlibdir)
213 substs.set('includedir', includedir)
214 substs.set('pkgsysconfdir', pkgsysconfdir)
215 substs.set('bindir', bindir)
216 substs.set('rootbindir', rootbindir)
217 substs.set('rootlibexecdir', rootlibexecdir)
218 substs.set('systemunitdir', systemunitdir)
219 substs.set('userunitdir', userunitdir)
220 substs.set('systempresetdir', systempresetdir)
221 substs.set('userpresetdir', userpresetdir)
222 substs.set('udevhwdbdir', udevhwdbdir)
223 substs.set('udevrulesdir', udevrulesdir)
224 substs.set('udevlibexecdir', udevlibexecdir)
225 substs.set('catalogdir', catalogdir)
226 substs.set('tmpfilesdir', tmpfilesdir)
227 substs.set('sysusersdir', sysusersdir)
228 substs.set('sysctldir', sysctldir)
229 substs.set('binfmtdir', binfmtdir)
230 substs.set('modulesloaddir', modulesloaddir)
231 substs.set('systemgeneratordir', systemgeneratordir)
232 substs.set('usergeneratordir', usergeneratordir)
233 substs.set('systemenvgeneratordir', systemenvgeneratordir)
234 substs.set('userenvgeneratordir', userenvgeneratordir)
235 substs.set('systemshutdowndir', systemshutdowndir)
236 substs.set('systemsleepdir', systemsleepdir)
237 substs.set('VARLOGDIR', varlogdir)
238 substs.set('CERTIFICATEROOT', get_option('certificate-root'))
239 substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
240 substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
241 substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
242 substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
243 substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
244 substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
246 #####################################################################
248 cc = meson.get_compiler('c')
249 pkgconfig = import('pkgconfig')
250 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
252 cxx = find_program('c++', required : false)
254 # Used only for tests
258 foreach arg : ['-Wextra',
261 '-Wmissing-include-dirs',
262 '-Wold-style-definition',
265 '-Wdeclaration-after-statement',
267 '-Wsuggest-attribute=noreturn',
268 '-Werror=missing-prototypes',
269 '-Werror=implicit-function-declaration',
270 '-Werror=missing-declarations',
271 '-Werror=return-type',
272 '-Werror=incompatible-pointer-types',
274 '-Wstrict-prototypes',
276 '-Wmissing-noreturn',
277 '-Wimplicit-fallthrough=5',
280 '-Wstrict-aliasing=2',
287 '-fdiagnostics-show-option',
288 '-fno-strict-aliasing',
289 '-fvisibility=hidden',
291 '-fstack-protector-strong',
293 '--param=ssp-buffer-size=4',
295 if cc.has_argument(arg)
296 add_project_arguments(arg, language : 'c')
300 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
301 # arguments, just emits a warnings. So test for the "positive" version instead.
302 foreach arg : ['unused-parameter',
303 'missing-field-initializers',
306 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
308 if cc.has_argument('-W' + arg)
309 add_project_arguments('-Wno-' + arg, language : 'c')
315 #include <inttypes.h>
316 typedef uint64_t usec_t;
317 usec_t now(clockid_t clock);
322 ', name : '-Werror=shadow with local shadowing')
323 add_project_arguments('-Werror=shadow', language : 'c')
326 if cc.get_id() == 'clang'
327 foreach arg : ['-Wno-typedef-redefinition',
328 '-Wno-gnu-variable-sized-type-not-at-end',
330 if cc.has_argument(arg,
331 name : '@0@ is supported'.format(arg))
332 add_project_arguments(arg, language : 'c')
337 link_test_c = files('tools/meson-link-test.c')
339 # --as-needed and --no-undefined are provided by meson by default,
340 # run mesonconf to see what is enabled
341 foreach arg : ['-Wl,-z,relro',
346 have = run_command(check_compilation_sh,
347 cc.cmd_array(), '-x', 'c', arg,
348 '-include', link_test_c).returncode() == 0
349 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
351 add_project_link_arguments(arg, language : 'c')
355 if get_option('buildtype') != 'debug'
356 foreach arg : ['-ffunction-sections',
358 if cc.has_argument(arg,
359 name : '@0@ is supported'.format(arg))
360 add_project_arguments(arg, language : 'c')
364 foreach arg : ['-Wl,--gc-sections']
365 have = run_command(check_compilation_sh,
366 cc.cmd_array(), '-x', 'c', arg,
367 '-include', link_test_c).returncode() == 0
368 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
370 add_project_link_arguments(arg, language : 'c')
375 cpp = ' '.join(cc.cmd_array()) + ' -E'
377 #####################################################################
378 # compilation result tests
380 conf.set('_GNU_SOURCE', true)
381 conf.set('__SANE_USERSPACE_TYPES__', true)
383 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
384 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
385 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
386 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
387 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
388 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
389 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
393 #include <linux/ethtool.h>
394 #include <linux/fib_rules.h>
396 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
398 foreach decl : ['char16_t',
401 'struct ethtool_link_settings',
402 'struct fib_rule_uid_range',
405 # We get -1 if the size cannot be determined
406 have = cc.sizeof(decl, prefix : decl_headers) > 0
407 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
410 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
411 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
412 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
413 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
414 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
415 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
416 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
417 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
418 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
419 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
420 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
421 # if_tunnel.h is buggy and cannot be included on its own
422 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
423 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
424 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
425 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
426 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
427 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
428 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
429 ['NDA_IFINDEX', 'linux/neighbour.h'],
430 ['IFA_FLAGS', 'linux/if_addr.h'],
431 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
432 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
433 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
435 prefix = decl.length() > 2 ? decl[2] : ''
436 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
437 conf.set10('HAVE_' + decl[0], have)
440 foreach ident : ['secure_getenv', '__secure_getenv']
441 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
445 ['memfd_create', '''#include <sys/memfd.h>'''],
446 ['gettid', '''#include <sys/types.h>'''],
447 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
448 ['name_to_handle_at', '''#define _GNU_SOURCE
449 #include <sys/types.h>
450 #include <sys/stat.h>
451 #include <fcntl.h>'''],
452 ['setns', '''#define _GNU_SOURCE
453 #include <sched.h>'''],
454 ['renameat2', '''#include <stdio.h>'''],
455 ['kcmp', '''#include <linux/kcmp.h>'''],
456 ['keyctl', '''#include <sys/types.h>
457 #include <keyutils.h>'''],
458 ['copy_file_range', '''#include <sys/syscall.h>
459 #include <unistd.h>'''],
460 ['bpf', '''#include <sys/syscall.h>
461 #include <unistd.h>'''],
462 ['explicit_bzero' , '''#include <string.h>'''],
465 have = cc.has_function(ident[0], prefix : ident[1])
466 conf.set10('HAVE_' + ident[0].to_upper(), have)
469 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
470 conf.set10('USE_SYS_RANDOM_H', true)
471 conf.set10('HAVE_GETRANDOM', true)
473 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
474 conf.set10('USE_SYS_RANDOM_H', false)
475 conf.set10('HAVE_GETRANDOM', have)
478 #####################################################################
480 sed = find_program('sed')
481 awk = find_program('awk')
482 m4 = find_program('m4')
483 stat = find_program('stat')
484 git = find_program('git', required : false)
486 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
487 mkdir_p = 'mkdir -p $DESTDIR/@0@'
488 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
489 splash_bmp = files('test/splash.bmp')
491 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
492 # /usr/sbin, /sbin, and fall back to the default from middle column.
493 progs = [['telinit', '/lib/sysvinit/telinit'],
494 ['quotaon', '/usr/sbin/quotaon' ],
495 ['quotacheck', '/usr/sbin/quotacheck' ],
496 ['kill', '/usr/bin/kill' ],
497 ['kmod', '/usr/bin/kmod' ],
498 ['kexec', '/usr/sbin/kexec' ],
499 ['sulogin', '/usr/sbin/sulogin' ],
500 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
501 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
502 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
503 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
506 path = get_option(prog[0] + '-path')
508 message('Using @1@ for @0@'.format(prog[0], path))
510 exe = find_program(prog[0],
511 '/usr/sbin/' + prog[0],
514 path = exe.found() ? exe.path() : prog[1]
516 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
517 conf.set_quoted(name, path)
518 substs.set(name, path)
521 if run_command('ln', '--relative', '--help').returncode() != 0
522 error('ln does not support --relative')
525 ############################################################
527 gperf = find_program('gperf')
529 gperf_test_format = '''
531 const char * in_word_set(const char *, @0@);
534 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
535 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
536 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
537 if cc.compiles(gperf_test)
538 gperf_len_type = 'size_t'
540 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
541 if cc.compiles(gperf_test)
542 gperf_len_type = 'unsigned'
544 error('unable to determine gperf len type')
547 message('gperf len type is @0@'.format(gperf_len_type))
548 conf.set('GPERF_LEN_TYPE', gperf_len_type,
549 description : 'The type of gperf "len" parameter')
551 ############################################################
553 if not cc.has_header('sys/capability.h')
554 error('POSIX caps headers not found')
556 foreach header : ['linux/btrfs.h',
558 'linux/vm_sockets.h',
560 'valgrind/memcheck.h',
561 'valgrind/valgrind.h',
564 conf.set10('HAVE_' + header.underscorify().to_upper(),
565 cc.has_header(header))
568 ############################################################
570 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
571 conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
572 gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
574 default_hierarchy = get_option('default-hierarchy')
575 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
576 description : 'default cgroup hierarchy as string')
577 if default_hierarchy == 'legacy'
578 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
579 elif default_hierarchy == 'hybrid'
580 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
582 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
585 time_epoch = get_option('time-epoch')
588 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
590 time_epoch = time_epoch.to_int()
591 conf.set('TIME_EPOCH', time_epoch)
593 system_uid_max = get_option('system-uid-max')
594 if system_uid_max == ''
595 system_uid_max = run_command(
597 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
598 '/etc/login.defs').stdout()
600 system_uid_max = system_uid_max.to_int()
601 conf.set('SYSTEM_UID_MAX', system_uid_max)
602 substs.set('systemuidmax', system_uid_max)
603 message('maximum system UID is @0@'.format(system_uid_max))
605 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
606 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
608 system_gid_max = get_option('system-gid-max')
609 if system_gid_max == ''
610 system_gid_max = run_command(
612 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
613 '/etc/login.defs').stdout()
615 system_gid_max = system_gid_max.to_int()
616 conf.set('SYSTEM_GID_MAX', system_gid_max)
617 substs.set('systemgidmax', system_gid_max)
618 message('maximum system GID is @0@'.format(system_gid_max))
620 tty_gid = get_option('tty-gid')
621 conf.set('TTY_GID', tty_gid)
622 substs.set('TTY_GID', tty_gid)
624 if get_option('adm-group')
625 m4_defines += ['-DENABLE_ADM_GROUP']
628 if get_option('wheel-group')
629 m4_defines += ['-DENABLE_WHEEL_GROUP']
632 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
633 substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
635 kill_user_processes = get_option('default-kill-user-processes')
636 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
637 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
639 dns_servers = get_option('dns-servers')
640 conf.set_quoted('DNS_SERVERS', dns_servers)
641 substs.set('DNS_SERVERS', dns_servers)
643 ntp_servers = get_option('ntp-servers')
644 conf.set_quoted('NTP_SERVERS', ntp_servers)
645 substs.set('NTP_SERVERS', ntp_servers)
647 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
649 substs.set('SUSHELL', get_option('debug-shell'))
650 substs.set('DEBUGTTY', get_option('debug-tty'))
652 debug = get_option('debug')
653 enable_debug_hashmap = false
654 enable_debug_mmap_cache = false
656 foreach name : debug.split(',')
658 enable_debug_hashmap = true
659 elif name == 'mmap-cache'
660 enable_debug_mmap_cache = true
662 message('unknown debug option "@0@", ignoring'.format(name))
666 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
667 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
669 #####################################################################
671 threads = dependency('threads')
672 librt = cc.find_library('rt')
673 libm = cc.find_library('m')
674 libdl = cc.find_library('dl')
675 libcrypt = cc.find_library('crypt')
677 libcap = dependency('libcap', required : false)
678 if not libcap.found()
679 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
680 libcap = cc.find_library('cap')
683 libmount = dependency('mount',
686 want_seccomp = get_option('seccomp')
687 if want_seccomp != 'false'
688 libseccomp = dependency('libseccomp',
689 version : '>= 2.3.1',
690 required : want_seccomp == 'true')
691 have = libseccomp.found()
696 conf.set10('HAVE_SECCOMP', have)
697 m4_defines += have ? ['-DHAVE_SECCOMP'] : []
699 want_selinux = get_option('selinux')
700 if want_selinux != 'false'
701 libselinux = dependency('libselinux',
702 version : '>= 2.1.9',
703 required : want_selinux == 'true')
704 have = libselinux.found()
709 conf.set10('HAVE_SELINUX', have)
710 m4_defines += have ? ['-DHAVE_SELINUX'] : []
712 want_apparmor = get_option('apparmor')
713 if want_apparmor != 'false'
714 libapparmor = dependency('libapparmor',
715 required : want_apparmor == 'true')
716 have = libapparmor.found()
721 conf.set10('HAVE_APPARMOR', have)
722 m4_defines += have ? ['-DHAVE_APPARMOR'] : []
724 smack_run_label = get_option('smack-run-label')
725 if smack_run_label != ''
726 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
727 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
730 want_polkit = get_option('polkit')
731 install_polkit = false
732 install_polkit_pkla = false
733 if want_polkit != 'false'
734 install_polkit = true
736 libpolkit = dependency('polkit-gobject-1',
738 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
739 message('Old polkit detected, will install pkla files')
740 install_polkit_pkla = true
743 conf.set10('ENABLE_POLKIT', install_polkit)
745 want_acl = get_option('acl')
746 if want_acl != 'false'
747 libacl = cc.find_library('acl', required : want_acl == 'true')
748 have = libacl.found()
753 conf.set10('HAVE_ACL', have)
754 m4_defines += have ? ['-DHAVE_ACL'] : []
756 want_audit = get_option('audit')
757 if want_audit != 'false'
758 libaudit = dependency('audit', required : want_audit == 'true')
759 have = libaudit.found()
764 conf.set10('HAVE_AUDIT', have)
766 want_blkid = get_option('blkid')
767 if want_blkid != 'false'
768 libblkid = dependency('blkid', required : want_blkid == 'true')
769 have = libblkid.found()
774 conf.set10('HAVE_BLKID', have)
776 want_kmod = get_option('kmod')
777 if want_kmod != 'false'
778 libkmod = dependency('libkmod',
780 required : want_kmod == 'true')
781 have = libkmod.found()
786 conf.set10('HAVE_KMOD', have)
788 want_pam = get_option('pam')
789 if want_pam != 'false'
790 libpam = cc.find_library('pam', required : want_pam == 'true')
791 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
792 have = libpam.found() and libpam_misc.found()
798 conf.set10('HAVE_PAM', have)
799 m4_defines += have ? ['-DHAVE_PAM'] : []
801 want_microhttpd = get_option('microhttpd')
802 if want_microhttpd != 'false'
803 libmicrohttpd = dependency('libmicrohttpd',
804 version : '>= 0.9.33',
805 required : want_microhttpd == 'true')
806 have = libmicrohttpd.found()
811 conf.set10('HAVE_MICROHTTPD', have)
812 m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
814 want_libcryptsetup = get_option('libcryptsetup')
815 if want_libcryptsetup != 'false'
816 libcryptsetup = dependency('libcryptsetup',
817 version : '>= 1.6.0',
818 required : want_libcryptsetup == 'true')
819 have = libcryptsetup.found()
824 conf.set10('HAVE_LIBCRYPTSETUP', have)
826 want_libcurl = get_option('libcurl')
827 if want_libcurl != 'false'
828 libcurl = dependency('libcurl',
829 version : '>= 7.32.0',
830 required : want_libcurl == 'true')
831 have = libcurl.found()
836 conf.set10('HAVE_LIBCURL', have)
837 m4_defines += have ? ['-DHAVE_LIBCURL'] : []
839 want_libidn = get_option('libidn')
840 want_libidn2 = get_option('libidn2')
841 if want_libidn == 'true' and want_libidn2 == 'true'
842 error('libidn and libidn2 cannot be requested simultaneously')
845 if want_libidn != 'false' and want_libidn2 != 'true'
846 libidn = dependency('libidn',
847 required : want_libidn == 'true')
848 have = libidn.found()
853 conf.set10('HAVE_LIBIDN', have)
854 m4_defines += have ? ['-DHAVE_LIBIDN'] : []
855 if not have and want_libidn2 != 'false'
856 # libidn is used for both libidn and libidn2 objects
857 libidn = dependency('libidn2',
858 required : want_libidn2 == 'true')
859 have = libidn.found()
863 conf.set10('HAVE_LIBIDN2', have)
864 m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
866 want_libiptc = get_option('libiptc')
867 if want_libiptc != 'false'
868 libiptc = dependency('libiptc',
869 required : want_libiptc == 'true')
870 have = libiptc.found()
875 conf.set10('HAVE_LIBIPTC', have)
876 m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
878 want_qrencode = get_option('qrencode')
879 if want_qrencode != 'false'
880 libqrencode = dependency('libqrencode',
881 required : want_qrencode == 'true')
882 have = libqrencode.found()
887 conf.set10('HAVE_QRENCODE', have)
889 want_gcrypt = get_option('gcrypt')
890 if want_gcrypt != 'false'
891 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
892 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
893 have = libgcrypt.found() and libgpg_error.found()
898 # link to neither of the libs if one is not found
902 conf.set10('HAVE_GCRYPT', have)
904 want_gnutls = get_option('gnutls')
905 if want_gnutls != 'false'
906 libgnutls = dependency('gnutls',
907 version : '>= 3.1.4',
908 required : want_gnutls == 'true')
909 have = libgnutls.found()
914 conf.set10('HAVE_GNUTLS', have)
916 want_elfutils = get_option('elfutils')
917 if want_elfutils != 'false'
918 libdw = dependency('libdw',
919 required : want_elfutils == 'true')
925 conf.set10('HAVE_ELFUTILS', have)
927 want_zlib = get_option('zlib')
928 if want_zlib != 'false'
929 libz = dependency('zlib',
930 required : want_zlib == 'true')
936 conf.set10('HAVE_ZLIB', have)
938 want_bzip2 = get_option('bzip2')
939 if want_bzip2 != 'false'
940 libbzip2 = cc.find_library('bz2',
941 required : want_bzip2 == 'true')
942 have = libbzip2.found()
947 conf.set10('HAVE_BZIP2', have)
949 want_xz = get_option('xz')
950 if want_xz != 'false'
951 libxz = dependency('liblzma',
952 required : want_xz == 'true')
958 conf.set10('HAVE_XZ', have)
960 want_lz4 = get_option('lz4')
961 if want_lz4 != 'false'
962 liblz4 = dependency('liblz4',
963 required : want_lz4 == 'true')
964 have = liblz4.found()
969 conf.set10('HAVE_LZ4', have)
971 want_xkbcommon = get_option('xkbcommon')
972 if want_xkbcommon != 'false'
973 libxkbcommon = dependency('xkbcommon',
974 version : '>= 0.3.0',
975 required : want_xkbcommon == 'true')
976 have = libxkbcommon.found()
981 conf.set10('HAVE_XKBCOMMON', have)
983 want_glib = get_option('glib')
984 if want_glib != 'false'
985 libglib = dependency('glib-2.0',
986 version : '>= 2.22.0',
987 required : want_glib == 'true')
988 libgobject = dependency('gobject-2.0',
989 version : '>= 2.22.0',
990 required : want_glib == 'true')
991 libgio = dependency('gio-2.0',
992 required : want_glib == 'true')
993 have = libglib.found() and libgobject.found() and libgio.found()
1000 conf.set10('HAVE_GLIB', have)
1002 want_dbus = get_option('dbus')
1003 if want_dbus != 'false'
1004 libdbus = dependency('dbus-1',
1005 version : '>= 1.3.2',
1006 required : want_dbus == 'true')
1007 have = libdbus.found()
1012 conf.set10('HAVE_DBUS', have)
1014 default_dnssec = get_option('default-dnssec')
1015 if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1016 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1017 default_dnssec = 'no'
1019 conf.set('DEFAULT_DNSSEC_MODE',
1020 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1021 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1023 want_importd = get_option('importd')
1024 if want_importd != 'false'
1025 have = (conf.get('HAVE_LIBCURL') == 1 and
1026 conf.get('HAVE_ZLIB') == 1 and
1027 conf.get('HAVE_BZIP2') == 1 and
1028 conf.get('HAVE_XZ') == 1 and
1029 conf.get('HAVE_GCRYPT') == 1)
1030 if want_importd == 'true' and not have
1031 error('importd support was requested, but dependencies are not available')
1036 conf.set10('ENABLE_IMPORTD', have)
1038 want_remote = get_option('remote')
1039 if want_remote != 'false'
1040 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1041 conf.get('HAVE_LIBCURL') == 1]
1042 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1043 # it's possible to build one without the other. Complain only if
1044 # support was explictly requested. The auxiliary files like sysusers
1045 # config should be installed when any of the programs are built.
1046 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1047 error('remote support was requested, but dependencies are not available')
1049 have = have_deps[0] or have_deps[1]
1053 conf.set10('ENABLE_REMOTE', have)
1055 foreach term : ['utmp',
1086 have = get_option(term)
1087 name = 'ENABLE_' + term.underscorify().to_upper()
1088 conf.set10(name, have)
1089 m4_defines += have ? ['-D' + name] : []
1092 want_tests = get_option('tests')
1093 install_tests = get_option('install-tests')
1096 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1098 #####################################################################
1100 if get_option('efi')
1101 efi_arch = host_machine.cpu_family()
1103 if efi_arch == 'x86'
1104 EFI_MACHINE_TYPE_NAME = 'ia32'
1105 gnu_efi_arch = 'ia32'
1106 elif efi_arch == 'x86_64'
1107 EFI_MACHINE_TYPE_NAME = 'x64'
1108 gnu_efi_arch = 'x86_64'
1109 elif efi_arch == 'arm'
1110 EFI_MACHINE_TYPE_NAME = 'arm'
1111 gnu_efi_arch = 'arm'
1112 elif efi_arch == 'aarch64'
1113 EFI_MACHINE_TYPE_NAME = 'aa64'
1114 gnu_efi_arch = 'aarch64'
1116 EFI_MACHINE_TYPE_NAME = ''
1121 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1123 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1127 conf.set10('ENABLE_EFI', have)
1129 #####################################################################
1131 config_h = configure_file(
1132 output : 'config.h',
1133 configuration : conf)
1135 includes = include_directories('src/basic',
1145 'src/libsystemd/sd-bus',
1146 'src/libsystemd/sd-device',
1147 'src/libsystemd/sd-hwdb',
1148 'src/libsystemd/sd-id128',
1149 'src/libsystemd/sd-netlink',
1150 'src/libsystemd/sd-network',
1151 'src/libsystemd-network',
1155 add_project_arguments('-include', 'config.h', language : 'c')
1157 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1158 'src/shared/gcrypt-util.c')
1162 subdir('src/systemd')
1164 subdir('src/libsystemd')
1165 subdir('src/libsystemd-network')
1166 subdir('src/journal')
1169 libjournal_core = static_library(
1171 libjournal_core_sources,
1173 include_directories : includes,
1176 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1177 libsystemd = shared_library(
1179 libsystemd_internal_sources,
1180 journal_internal_sources,
1181 version : libsystemd_version,
1182 include_directories : includes,
1183 link_args : ['-shared',
1184 '-Wl,--version-script=' + libsystemd_sym_path],
1185 link_with : [libbasic],
1186 dependencies : [threads,
1191 link_depends : libsystemd_sym,
1193 install_dir : rootlibdir)
1195 ############################################################
1197 # binaries that have --help and are intended for use by humans,
1198 # usually, but not always, installed in /bin.
1199 public_programs = []
1201 subdir('src/libudev')
1202 subdir('src/shared')
1205 subdir('src/network')
1207 subdir('src/analyze')
1208 subdir('src/journal-remote')
1209 subdir('src/coredump')
1210 subdir('src/hostname')
1211 subdir('src/import')
1212 subdir('src/kernel-install')
1213 subdir('src/locale')
1214 subdir('src/machine')
1215 subdir('src/nspawn')
1216 subdir('src/resolve')
1217 subdir('src/timedate')
1218 subdir('src/timesync')
1219 subdir('src/vconsole')
1220 subdir('src/sulogin-shell')
1221 subdir('src/boot/efi')
1227 ############################################################
1229 # only static linking apart from libdl, to make sure that the
1230 # module is linked to all libraries that it uses.
1231 test_dlopen = executable(
1234 include_directories : includes,
1235 link_with : [libbasic],
1236 dependencies : [libdl])
1238 foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
1239 ['systemd', 'ENABLE_NSS_SYSTEMD'],
1240 ['mymachines', 'ENABLE_MACHINED'],
1241 ['resolve', 'ENABLE_RESOLVE']]
1243 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1247 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1248 version_script_arg = join_paths(meson.current_source_dir(), sym)
1250 nss = shared_library(
1252 'src/nss-@0@/nss-@0@.c'.format(module),
1254 include_directories : includes,
1255 link_args : ['-shared',
1256 '-Wl,--version-script=' + version_script_arg,
1258 link_with : [libsystemd_internal,
1260 dependencies : [threads,
1264 install_dir : rootlibdir)
1266 # We cannot use shared_module because it does not support version suffix.
1267 # Unfortunately shared_library insists on creating the symlink…
1268 meson.add_install_script('sh', '-c',
1269 'rm $DESTDIR@0@/libnss_@1@.so'
1270 .format(rootlibdir, module))
1272 test('dlopen-nss_' + module,
1274 args : [nss.full_path()]) # path to dlopen must include a slash
1278 ############################################################
1280 executable('systemd',
1282 include_directories : includes,
1283 link_with : [libcore,
1285 dependencies : [threads,
1291 install_rpath : rootlibexecdir,
1293 install_dir : rootlibexecdir)
1295 exe = executable('systemd-analyze',
1296 systemd_analyze_sources,
1297 include_directories : includes,
1298 link_with : [libcore,
1300 dependencies : [threads,
1306 install_rpath : rootlibexecdir,
1308 public_programs += [exe]
1310 executable('systemd-journald',
1311 systemd_journald_sources,
1312 include_directories : includes,
1313 link_with : [libjournal_core,
1315 dependencies : [threads,
1319 install_rpath : rootlibexecdir,
1321 install_dir : rootlibexecdir)
1323 exe = executable('systemd-cat',
1324 systemd_cat_sources,
1325 include_directories : includes,
1326 link_with : [libjournal_core,
1328 dependencies : [threads],
1329 install_rpath : rootlibexecdir,
1331 public_programs += [exe]
1333 exe = executable('journalctl',
1335 include_directories : includes,
1336 link_with : [libshared],
1337 dependencies : [threads,
1341 install_rpath : rootlibexecdir,
1343 install_dir : rootbindir)
1344 public_programs += [exe]
1346 executable('systemd-getty-generator',
1347 'src/getty-generator/getty-generator.c',
1348 include_directories : includes,
1349 link_with : [libshared],
1350 install_rpath : rootlibexecdir,
1352 install_dir : systemgeneratordir)
1354 executable('systemd-debug-generator',
1355 'src/debug-generator/debug-generator.c',
1356 include_directories : includes,
1357 link_with : [libshared],
1358 install_rpath : rootlibexecdir,
1360 install_dir : systemgeneratordir)
1362 executable('systemd-fstab-generator',
1363 'src/fstab-generator/fstab-generator.c',
1364 'src/core/mount-setup.c',
1365 include_directories : includes,
1366 link_with : [libshared],
1367 install_rpath : rootlibexecdir,
1369 install_dir : systemgeneratordir)
1371 if conf.get('ENABLE_ENVIRONMENT_D') == 1
1372 executable('30-systemd-environment-d-generator',
1373 'src/environment-d-generator/environment-d-generator.c',
1374 include_directories : includes,
1375 link_with : [libshared],
1376 install_rpath : rootlibexecdir,
1378 install_dir : userenvgeneratordir)
1380 meson.add_install_script(meson_make_symlink,
1381 join_paths(sysconfdir, 'environment'),
1382 join_paths(environmentdir, '99-environment.conf'))
1385 if conf.get('ENABLE_HIBERNATE') == 1
1386 executable('systemd-hibernate-resume-generator',
1387 'src/hibernate-resume/hibernate-resume-generator.c',
1388 include_directories : includes,
1389 link_with : [libshared],
1390 install_rpath : rootlibexecdir,
1392 install_dir : systemgeneratordir)
1394 executable('systemd-hibernate-resume',
1395 'src/hibernate-resume/hibernate-resume.c',
1396 include_directories : includes,
1397 link_with : [libshared],
1398 install_rpath : rootlibexecdir,
1400 install_dir : rootlibexecdir)
1403 if conf.get('HAVE_BLKID') == 1
1404 executable('systemd-gpt-auto-generator',
1405 'src/gpt-auto-generator/gpt-auto-generator.c',
1406 'src/basic/blkid-util.h',
1407 include_directories : includes,
1408 link_with : [libshared],
1409 dependencies : libblkid,
1410 install_rpath : rootlibexecdir,
1412 install_dir : systemgeneratordir)
1414 exe = executable('systemd-dissect',
1415 'src/dissect/dissect.c',
1416 include_directories : includes,
1417 link_with : [libshared],
1418 install_rpath : rootlibexecdir,
1420 install_dir : rootlibexecdir)
1421 public_programs += [exe]
1424 if conf.get('ENABLE_RESOLVE') == 1
1425 executable('systemd-resolved',
1426 systemd_resolved_sources,
1427 gcrypt_util_sources,
1428 include_directories : includes,
1429 link_with : [libshared],
1430 dependencies : [threads,
1435 install_rpath : rootlibexecdir,
1437 install_dir : rootlibexecdir)
1439 exe = executable('systemd-resolve',
1440 systemd_resolve_sources,
1441 gcrypt_util_sources,
1442 include_directories : includes,
1443 link_with : [libshared],
1444 dependencies : [threads,
1449 install_rpath : rootlibexecdir,
1451 public_programs += [exe]
1454 if conf.get('ENABLE_LOGIND') == 1
1455 executable('systemd-logind',
1456 systemd_logind_sources,
1457 include_directories : includes,
1458 link_with : [liblogind_core,
1460 dependencies : [threads,
1462 install_rpath : rootlibexecdir,
1464 install_dir : rootlibexecdir)
1466 exe = executable('loginctl',
1468 include_directories : includes,
1469 link_with : [libshared],
1470 dependencies : [threads,
1473 install_rpath : rootlibexecdir,
1475 install_dir : rootbindir)
1476 public_programs += [exe]
1478 exe = executable('systemd-inhibit',
1479 'src/login/inhibit.c',
1480 include_directories : includes,
1481 link_with : [libshared],
1482 install_rpath : rootlibexecdir,
1484 install_dir : rootbindir)
1485 public_programs += [exe]
1487 if conf.get('HAVE_PAM') == 1
1488 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1489 pam_systemd = shared_library(
1493 include_directories : includes,
1494 link_args : ['-shared',
1495 '-Wl,--version-script=' + version_script_arg],
1496 link_with : [libsystemd_internal,
1498 dependencies : [threads,
1501 link_depends : pam_systemd_sym,
1503 install_dir : pamlibdir)
1505 test('dlopen-pam_systemd',
1507 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1511 if conf.get('HAVE_PAM') == 1
1512 executable('systemd-user-sessions',
1513 'src/user-sessions/user-sessions.c',
1514 include_directories : includes,
1515 link_with : [libshared],
1516 install_rpath : rootlibexecdir,
1518 install_dir : rootlibexecdir)
1521 if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1522 exe = executable('bootctl',
1523 'src/boot/bootctl.c',
1524 include_directories : includes,
1525 link_with : [libshared],
1526 dependencies : [libblkid],
1527 install_rpath : rootlibexecdir,
1529 public_programs += [exe]
1532 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1533 include_directories : includes,
1534 link_with : [libshared],
1535 dependencies : [threads],
1536 install_rpath : rootlibexecdir,
1538 public_programs += [exe]
1540 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1541 include_directories : includes,
1542 link_with : [libshared],
1543 dependencies : [threads,
1548 install_rpath : rootlibexecdir,
1550 install_dir : rootbindir)
1551 public_programs += [exe]
1553 if conf.get('ENABLE_BACKLIGHT') == 1
1554 executable('systemd-backlight',
1555 'src/backlight/backlight.c',
1556 include_directories : includes,
1557 link_with : [libshared],
1558 install_rpath : rootlibexecdir,
1560 install_dir : rootlibexecdir)
1563 if conf.get('ENABLE_RFKILL') == 1
1564 executable('systemd-rfkill',
1565 'src/rfkill/rfkill.c',
1566 include_directories : includes,
1567 link_with : [libshared],
1568 install_rpath : rootlibexecdir,
1570 install_dir : rootlibexecdir)
1573 executable('systemd-system-update-generator',
1574 'src/system-update-generator/system-update-generator.c',
1575 include_directories : includes,
1576 link_with : [libshared],
1577 install_rpath : rootlibexecdir,
1579 install_dir : systemgeneratordir)
1581 if conf.get('HAVE_LIBCRYPTSETUP') == 1
1582 executable('systemd-cryptsetup',
1583 'src/cryptsetup/cryptsetup.c',
1584 include_directories : includes,
1585 link_with : [libshared],
1586 dependencies : [libcryptsetup],
1587 install_rpath : rootlibexecdir,
1589 install_dir : rootlibexecdir)
1591 executable('systemd-cryptsetup-generator',
1592 'src/cryptsetup/cryptsetup-generator.c',
1593 include_directories : includes,
1594 link_with : [libshared],
1595 dependencies : [libcryptsetup],
1596 install_rpath : rootlibexecdir,
1598 install_dir : systemgeneratordir)
1600 executable('systemd-veritysetup',
1601 'src/veritysetup/veritysetup.c',
1602 include_directories : includes,
1603 link_with : [libshared],
1604 dependencies : [libcryptsetup],
1605 install_rpath : rootlibexecdir,
1607 install_dir : rootlibexecdir)
1609 executable('systemd-veritysetup-generator',
1610 'src/veritysetup/veritysetup-generator.c',
1611 include_directories : includes,
1612 link_with : [libshared],
1613 dependencies : [libcryptsetup],
1614 install_rpath : rootlibexecdir,
1616 install_dir : systemgeneratordir)
1619 if conf.get('HAVE_SYSV_COMPAT') == 1
1620 executable('systemd-sysv-generator',
1621 'src/sysv-generator/sysv-generator.c',
1622 include_directories : includes,
1623 link_with : [libshared],
1624 install_rpath : rootlibexecdir,
1626 install_dir : systemgeneratordir)
1628 executable('systemd-rc-local-generator',
1629 'src/rc-local-generator/rc-local-generator.c',
1630 include_directories : includes,
1631 link_with : [libshared],
1632 install_rpath : rootlibexecdir,
1634 install_dir : systemgeneratordir)
1637 if conf.get('ENABLE_HOSTNAMED') == 1
1638 executable('systemd-hostnamed',
1639 'src/hostname/hostnamed.c',
1640 include_directories : includes,
1641 link_with : [libshared],
1642 install_rpath : rootlibexecdir,
1644 install_dir : rootlibexecdir)
1646 exe = executable('hostnamectl',
1647 'src/hostname/hostnamectl.c',
1648 include_directories : includes,
1649 link_with : [libshared],
1650 install_rpath : rootlibexecdir,
1652 public_programs += [exe]
1655 if conf.get('ENABLE_LOCALED') == 1
1656 if conf.get('HAVE_XKBCOMMON') == 1
1657 # logind will load libxkbcommon.so dynamically on its own
1663 executable('systemd-localed',
1664 systemd_localed_sources,
1665 include_directories : includes,
1666 link_with : [libshared],
1667 dependencies : deps,
1668 install_rpath : rootlibexecdir,
1670 install_dir : rootlibexecdir)
1672 exe = executable('localectl',
1674 include_directories : includes,
1675 link_with : [libshared],
1676 install_rpath : rootlibexecdir,
1678 public_programs += [exe]
1681 if conf.get('ENABLE_TIMEDATED') == 1
1682 executable('systemd-timedated',
1683 'src/timedate/timedated.c',
1684 include_directories : includes,
1685 link_with : [libshared],
1686 install_rpath : rootlibexecdir,
1688 install_dir : rootlibexecdir)
1690 exe = executable('timedatectl',
1691 'src/timedate/timedatectl.c',
1692 include_directories : includes,
1693 install_rpath : rootlibexecdir,
1694 link_with : [libshared],
1696 public_programs += [exe]
1699 if conf.get('ENABLE_TIMESYNCD') == 1
1700 executable('systemd-timesyncd',
1701 systemd_timesyncd_sources,
1702 include_directories : includes,
1703 link_with : [libshared],
1704 dependencies : [threads,
1706 install_rpath : rootlibexecdir,
1708 install_dir : rootlibexecdir)
1711 if conf.get('ENABLE_MACHINED') == 1
1712 executable('systemd-machined',
1713 systemd_machined_sources,
1714 include_directories : includes,
1715 link_with : [libmachine_core,
1717 install_rpath : rootlibexecdir,
1719 install_dir : rootlibexecdir)
1721 exe = executable('machinectl',
1722 'src/machine/machinectl.c',
1723 include_directories : includes,
1724 link_with : [libshared],
1725 dependencies : [threads,
1728 install_rpath : rootlibexecdir,
1730 install_dir : rootbindir)
1731 public_programs += [exe]
1734 if conf.get('ENABLE_IMPORTD') == 1
1735 executable('systemd-importd',
1736 systemd_importd_sources,
1737 include_directories : includes,
1738 link_with : [libshared],
1739 dependencies : [threads],
1740 install_rpath : rootlibexecdir,
1742 install_dir : rootlibexecdir)
1744 systemd_pull = executable('systemd-pull',
1745 systemd_pull_sources,
1746 include_directories : includes,
1747 link_with : [libshared],
1748 dependencies : [libcurl,
1753 install_rpath : rootlibexecdir,
1755 install_dir : rootlibexecdir)
1757 systemd_import = executable('systemd-import',
1758 systemd_import_sources,
1759 include_directories : includes,
1760 link_with : [libshared],
1761 dependencies : [libcurl,
1765 install_rpath : rootlibexecdir,
1767 install_dir : rootlibexecdir)
1769 systemd_export = executable('systemd-export',
1770 systemd_export_sources,
1771 include_directories : includes,
1772 link_with : [libshared],
1773 dependencies : [libcurl,
1777 install_rpath : rootlibexecdir,
1779 install_dir : rootlibexecdir)
1780 public_programs += [systemd_pull, systemd_import, systemd_export]
1783 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
1784 exe = executable('systemd-journal-upload',
1785 systemd_journal_upload_sources,
1786 include_directories : includes,
1787 link_with : [libshared],
1788 dependencies : [threads,
1793 install_rpath : rootlibexecdir,
1795 install_dir : rootlibexecdir)
1796 public_programs += [exe]
1799 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
1800 s_j_remote = executable('systemd-journal-remote',
1801 systemd_journal_remote_sources,
1802 include_directories : includes,
1803 link_with : [libshared],
1804 dependencies : [threads,
1809 install_rpath : rootlibexecdir,
1811 install_dir : rootlibexecdir)
1813 s_j_gatewayd = executable('systemd-journal-gatewayd',
1814 systemd_journal_gatewayd_sources,
1815 include_directories : includes,
1816 link_with : [libshared],
1817 dependencies : [threads,
1822 install_rpath : rootlibexecdir,
1824 install_dir : rootlibexecdir)
1825 public_programs += [s_j_remote, s_j_gatewayd]
1828 if conf.get('ENABLE_COREDUMP') == 1
1829 executable('systemd-coredump',
1830 systemd_coredump_sources,
1831 include_directories : includes,
1832 link_with : [libshared],
1833 dependencies : [threads,
1838 install_rpath : rootlibexecdir,
1840 install_dir : rootlibexecdir)
1842 exe = executable('coredumpctl',
1843 coredumpctl_sources,
1844 include_directories : includes,
1845 link_with : [libshared],
1846 dependencies : [threads,
1849 install_rpath : rootlibexecdir,
1851 public_programs += [exe]
1854 if conf.get('ENABLE_BINFMT') == 1
1855 exe = executable('systemd-binfmt',
1856 'src/binfmt/binfmt.c',
1857 include_directories : includes,
1858 link_with : [libshared],
1859 install_rpath : rootlibexecdir,
1861 install_dir : rootlibexecdir)
1862 public_programs += [exe]
1864 meson.add_install_script('sh', '-c',
1865 mkdir_p.format(binfmtdir))
1866 meson.add_install_script('sh', '-c',
1867 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1870 if conf.get('ENABLE_VCONSOLE') == 1
1871 executable('systemd-vconsole-setup',
1872 'src/vconsole/vconsole-setup.c',
1873 include_directories : includes,
1874 link_with : [libshared],
1875 install_rpath : rootlibexecdir,
1877 install_dir : rootlibexecdir)
1880 if conf.get('ENABLE_RANDOMSEED') == 1
1881 executable('systemd-random-seed',
1882 'src/random-seed/random-seed.c',
1883 include_directories : includes,
1884 link_with : [libshared],
1885 install_rpath : rootlibexecdir,
1887 install_dir : rootlibexecdir)
1890 if conf.get('ENABLE_FIRSTBOOT') == 1
1891 executable('systemd-firstboot',
1892 'src/firstboot/firstboot.c',
1893 include_directories : includes,
1894 link_with : [libshared],
1895 dependencies : [libcrypt],
1896 install_rpath : rootlibexecdir,
1898 install_dir : rootbindir)
1901 executable('systemd-remount-fs',
1902 'src/remount-fs/remount-fs.c',
1903 'src/core/mount-setup.c',
1904 'src/core/mount-setup.h',
1905 include_directories : includes,
1906 link_with : [libshared],
1907 install_rpath : rootlibexecdir,
1909 install_dir : rootlibexecdir)
1911 executable('systemd-machine-id-setup',
1912 'src/machine-id-setup/machine-id-setup-main.c',
1913 'src/core/machine-id-setup.c',
1914 'src/core/machine-id-setup.h',
1915 include_directories : includes,
1916 link_with : [libshared],
1917 install_rpath : rootlibexecdir,
1919 install_dir : rootbindir)
1921 executable('systemd-fsck',
1923 include_directories : includes,
1924 link_with : [libshared],
1925 install_rpath : rootlibexecdir,
1927 install_dir : rootlibexecdir)
1929 executable('systemd-sleep',
1930 'src/sleep/sleep.c',
1931 include_directories : includes,
1932 link_with : [libshared],
1933 install_rpath : rootlibexecdir,
1935 install_dir : rootlibexecdir)
1937 exe = executable('systemd-sysctl',
1938 'src/sysctl/sysctl.c',
1939 include_directories : includes,
1940 link_with : [libshared],
1941 install_rpath : rootlibexecdir,
1943 install_dir : rootlibexecdir)
1944 public_programs += [exe]
1946 executable('systemd-ac-power',
1947 'src/ac-power/ac-power.c',
1948 include_directories : includes,
1949 link_with : [libshared],
1950 install_rpath : rootlibexecdir,
1952 install_dir : rootlibexecdir)
1954 exe = executable('systemd-detect-virt',
1955 'src/detect-virt/detect-virt.c',
1956 include_directories : includes,
1957 link_with : [libshared],
1958 install_rpath : rootlibexecdir,
1960 public_programs += [exe]
1962 exe = executable('systemd-delta',
1963 'src/delta/delta.c',
1964 include_directories : includes,
1965 link_with : [libshared],
1966 install_rpath : rootlibexecdir,
1968 public_programs += [exe]
1970 exe = executable('systemd-escape',
1971 'src/escape/escape.c',
1972 include_directories : includes,
1973 link_with : [libshared],
1974 install_rpath : rootlibexecdir,
1976 install_dir : rootbindir)
1977 public_programs += [exe]
1979 exe = executable('systemd-notify',
1980 'src/notify/notify.c',
1981 include_directories : includes,
1982 link_with : [libshared],
1983 install_rpath : rootlibexecdir,
1985 install_dir : rootbindir)
1986 public_programs += [exe]
1988 executable('systemd-volatile-root',
1989 'src/volatile-root/volatile-root.c',
1990 include_directories : includes,
1991 link_with : [libshared],
1992 install_rpath : rootlibexecdir,
1994 install_dir : rootlibexecdir)
1996 executable('systemd-cgroups-agent',
1997 'src/cgroups-agent/cgroups-agent.c',
1998 include_directories : includes,
1999 link_with : [libshared],
2000 install_rpath : rootlibexecdir,
2002 install_dir : rootlibexecdir)
2004 exe = executable('systemd-path',
2006 include_directories : includes,
2007 link_with : [libshared],
2008 install_rpath : rootlibexecdir,
2010 public_programs += [exe]
2012 exe = executable('systemd-ask-password',
2013 'src/ask-password/ask-password.c',
2014 include_directories : includes,
2015 link_with : [libshared],
2016 install_rpath : rootlibexecdir,
2018 install_dir : rootbindir)
2019 public_programs += [exe]
2021 executable('systemd-reply-password',
2022 'src/reply-password/reply-password.c',
2023 include_directories : includes,
2024 link_with : [libshared],
2025 install_rpath : rootlibexecdir,
2027 install_dir : rootlibexecdir)
2029 exe = executable('systemd-tty-ask-password-agent',
2030 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2031 include_directories : includes,
2032 link_with : [libshared],
2033 install_rpath : rootlibexecdir,
2035 install_dir : rootbindir)
2036 public_programs += [exe]
2038 exe = executable('systemd-cgls',
2040 include_directories : includes,
2041 link_with : [libshared],
2042 install_rpath : rootlibexecdir,
2044 public_programs += [exe]
2046 exe = executable('systemd-cgtop',
2047 'src/cgtop/cgtop.c',
2048 include_directories : includes,
2049 link_with : [libshared],
2050 install_rpath : rootlibexecdir,
2052 public_programs += [exe]
2054 executable('systemd-initctl',
2055 'src/initctl/initctl.c',
2056 include_directories : includes,
2057 link_with : [libshared],
2058 install_rpath : rootlibexecdir,
2060 install_dir : rootlibexecdir)
2062 exe = executable('systemd-mount',
2063 'src/mount/mount-tool.c',
2064 include_directories : includes,
2065 link_with : [libshared],
2066 install_rpath : rootlibexecdir,
2068 public_programs += [exe]
2070 meson.add_install_script(meson_make_symlink,
2071 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2073 exe = executable('systemd-run',
2075 include_directories : includes,
2076 link_with : [libshared],
2077 install_rpath : rootlibexecdir,
2079 public_programs += [exe]
2081 exe = executable('systemd-stdio-bridge',
2082 'src/stdio-bridge/stdio-bridge.c',
2083 include_directories : includes,
2084 link_with : [libshared],
2085 install_rpath : rootlibexecdir,
2087 public_programs += [exe]
2089 exe = executable('busctl',
2090 'src/busctl/busctl.c',
2091 'src/busctl/busctl-introspect.c',
2092 'src/busctl/busctl-introspect.h',
2093 include_directories : includes,
2094 link_with : [libshared],
2095 install_rpath : rootlibexecdir,
2097 public_programs += [exe]
2099 if conf.get('ENABLE_SYSUSERS') == 1
2100 exe = executable('systemd-sysusers',
2101 'src/sysusers/sysusers.c',
2102 include_directories : includes,
2103 link_with : [libshared],
2104 install_rpath : rootlibexecdir,
2106 install_dir : rootbindir)
2107 public_programs += [exe]
2110 if conf.get('ENABLE_TMPFILES') == 1
2111 exe = executable('systemd-tmpfiles',
2112 'src/tmpfiles/tmpfiles.c',
2113 include_directories : includes,
2114 link_with : [libshared],
2115 dependencies : [libacl],
2116 install_rpath : rootlibexecdir,
2118 install_dir : rootbindir)
2119 public_programs += [exe]
2122 if conf.get('ENABLE_HWDB') == 1
2123 exe = executable('systemd-hwdb',
2125 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2126 include_directories : includes,
2127 link_with : [libudev_internal],
2128 install_rpath : udev_rpath,
2130 install_dir : rootbindir)
2131 public_programs += [exe]
2134 if conf.get('ENABLE_QUOTACHECK') == 1
2135 executable('systemd-quotacheck',
2136 'src/quotacheck/quotacheck.c',
2137 include_directories : includes,
2138 link_with : [libshared],
2139 install_rpath : rootlibexecdir,
2141 install_dir : rootlibexecdir)
2144 exe = executable('systemd-socket-proxyd',
2145 'src/socket-proxy/socket-proxyd.c',
2146 include_directories : includes,
2147 link_with : [libshared],
2148 dependencies : [threads],
2149 install_rpath : rootlibexecdir,
2151 install_dir : rootlibexecdir)
2152 public_programs += [exe]
2154 exe = executable('systemd-udevd',
2155 systemd_udevd_sources,
2156 include_directories : includes,
2157 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2158 link_with : [libudev_core,
2161 dependencies : [threads,
2166 install_rpath : udev_rpath,
2168 install_dir : rootlibexecdir)
2169 public_programs += [exe]
2171 exe = executable('udevadm',
2173 include_directories : includes,
2174 link_with : [libudev_core,
2177 dependencies : [threads,
2182 install_rpath : udev_rpath,
2184 install_dir : rootbindir)
2185 public_programs += [exe]
2187 executable('systemd-shutdown',
2188 systemd_shutdown_sources,
2189 include_directories : includes,
2190 link_with : [libshared],
2191 install_rpath : rootlibexecdir,
2193 install_dir : rootlibexecdir)
2195 executable('systemd-update-done',
2196 'src/update-done/update-done.c',
2197 include_directories : includes,
2198 link_with : [libshared],
2199 install_rpath : rootlibexecdir,
2201 install_dir : rootlibexecdir)
2203 executable('systemd-update-utmp',
2204 'src/update-utmp/update-utmp.c',
2205 include_directories : includes,
2206 link_with : [libshared],
2207 dependencies : [libaudit],
2208 install_rpath : rootlibexecdir,
2210 install_dir : rootlibexecdir)
2212 if conf.get('HAVE_KMOD') == 1
2213 executable('systemd-modules-load',
2214 'src/modules-load/modules-load.c',
2215 include_directories : includes,
2216 link_with : [libshared],
2217 dependencies : [libkmod],
2218 install_rpath : rootlibexecdir,
2220 install_dir : rootlibexecdir)
2222 meson.add_install_script('sh', '-c',
2223 mkdir_p.format(modulesloaddir))
2224 meson.add_install_script('sh', '-c',
2225 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2228 exe = executable('systemd-nspawn',
2229 systemd_nspawn_sources,
2230 'src/core/mount-setup.c', # FIXME: use a variable?
2231 'src/core/mount-setup.h',
2232 'src/core/loopback-setup.c',
2233 'src/core/loopback-setup.h',
2234 include_directories : [includes, include_directories('src/nspawn')],
2235 link_with : [libshared],
2236 dependencies : [libacl,
2240 install_rpath : rootlibexecdir,
2242 public_programs += [exe]
2244 if conf.get('ENABLE_NETWORKD') == 1
2245 executable('systemd-networkd',
2246 systemd_networkd_sources,
2247 include_directories : includes,
2248 link_with : [libnetworkd_core,
2252 dependencies : [threads],
2253 install_rpath : rootlibexecdir,
2255 install_dir : rootlibexecdir)
2257 executable('systemd-networkd-wait-online',
2258 systemd_networkd_wait_online_sources,
2259 include_directories : includes,
2260 link_with : [libnetworkd_core,
2262 install_rpath : rootlibexecdir,
2264 install_dir : rootlibexecdir)
2266 exe = executable('networkctl',
2268 include_directories : includes,
2269 link_with : [libsystemd_network,
2271 install_rpath : rootlibexecdir,
2273 install_dir : rootbindir)
2274 public_programs += [exe]
2276 ############################################################
2278 foreach tuple : tests
2280 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2281 dependencies = tuple[2]
2282 condition = tuple.length() >= 4 ? tuple[3] : ''
2283 type = tuple.length() >= 5 ? tuple[4] : ''
2284 defs = tuple.length() >= 6 ? tuple[5] : []
2285 incs = tuple.length() >= 7 ? tuple[6] : includes
2288 name = sources[0].split('/')[-1].split('.')[0]
2289 if type.startswith('timeout=')
2290 timeout = type.split('=')[1].to_int()
2294 if condition == '' or conf.get(condition) == 1
2298 include_directories : incs,
2299 link_with : link_with,
2300 dependencies : dependencies,
2302 install_rpath : rootlibexecdir,
2303 install : install_tests,
2304 install_dir : join_paths(testsdir, type))
2307 message('@0@ is a manual test'.format(name))
2308 elif type == 'unsafe' and want_tests != 'unsafe'
2309 message('@0@ is an unsafe test'.format(name))
2316 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2320 test_libsystemd_sym = executable(
2321 'test-libsystemd-sym',
2322 test_libsystemd_sym_c,
2323 include_directories : includes,
2324 link_with : [libsystemd],
2325 install : install_tests,
2326 install_dir : testsdir)
2327 test('test-libsystemd-sym',
2328 test_libsystemd_sym)
2330 test_libudev_sym = executable(
2333 include_directories : includes,
2334 c_args : ['-Wno-deprecated-declarations'],
2335 link_with : [libudev],
2336 install : install_tests,
2337 install_dir : testsdir)
2338 test('test-libudev-sym',
2341 ############################################################
2343 make_directive_index_py = find_program('tools/make-directive-index.py')
2344 make_man_index_py = find_program('tools/make-man-index.py')
2345 xml_helper_py = find_program('tools/xml_helper.py')
2346 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2350 subdir('sysusers.d')
2351 subdir('tmpfiles.d')
2355 subdir('shell-completion/bash')
2356 subdir('shell-completion/zsh')
2357 subdir('docs/sysvinit')
2358 subdir('docs/var-log')
2360 # FIXME: figure out if the warning is true:
2361 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2362 install_subdir('factory/etc',
2363 install_dir : factorydir)
2366 install_data('xorg/50-systemd-user.sh',
2367 install_dir : xinitrcdir)
2368 install_data('system-preset/90-systemd.preset',
2369 install_dir : systempresetdir)
2370 install_data('modprobe.d/systemd.conf',
2371 install_dir : modprobedir)
2372 install_data('README',
2379 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2380 install_dir : docdir)
2382 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2383 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2385 ############################################################
2387 meson_check_help = find_program('tools/meson-check-help.sh')
2389 foreach exec : public_programs
2390 name = exec.full_path().split('/')[-1]
2391 test('check-help-' + name,
2393 args : [exec.full_path()])
2396 ############################################################
2399 all_files = run_command(
2401 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2404 all_files = files(all_files.stdout().split())
2409 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2413 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2417 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2420 command : [meson_git_contrib_sh])
2424 git_head = run_command(
2426 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2427 'rev-parse', 'HEAD']).stdout().strip()
2428 git_head_short = run_command(
2430 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2431 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2435 command : ['git', 'archive',
2436 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2438 '--prefix', 'systemd-@0@/'.format(git_head),
2442 ############################################################
2445 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2447 'prefix directory: @0@'.format(prefixdir),
2448 'rootprefix directory: @0@'.format(rootprefixdir),
2449 'sysconf directory: @0@'.format(sysconfdir),
2450 'include directory: @0@'.format(includedir),
2451 'lib directory: @0@'.format(libdir),
2452 'rootlib directory: @0@'.format(rootlibdir),
2453 'SysV init scripts: @0@'.format(sysvinit_path),
2454 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2455 'PAM modules directory: @0@'.format(pamlibdir),
2456 'PAM configuration directory: @0@'.format(pamconfdir),
2457 'RPM macros directory: @0@'.format(rpmmacrosdir),
2458 'modprobe.d directory: @0@'.format(modprobedir),
2459 'D-Bus policy directory: @0@'.format(dbuspolicydir),
2460 'D-Bus session directory: @0@'.format(dbussessionservicedir),
2461 'D-Bus system directory: @0@'.format(dbussystemservicedir),
2462 'bash completions directory: @0@'.format(bashcompletiondir),
2463 'zsh completions directory: @0@'.format(zshcompletiondir),
2464 'extra start script: @0@'.format(get_option('rc-local')),
2465 'extra stop script: @0@'.format(get_option('halt-local')),
2466 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2467 get_option('debug-tty')),
2468 'TTY GID: @0@'.format(tty_gid),
2469 'maximum system UID: @0@'.format(system_uid_max),
2470 'maximum system GID: @0@'.format(system_gid_max),
2471 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2472 'render group access mode: @0@'.format(get_option('group-render-mode')),
2473 'certificate root directory: @0@'.format(get_option('certificate-root')),
2474 'support URL: @0@'.format(support_url),
2475 'nobody user name: @0@'.format(get_option('nobody-user')),
2476 'nobody group name: @0@'.format(get_option('nobody-group')),
2477 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2478 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2480 'default DNSSEC mode: @0@'.format(default_dnssec),
2481 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2482 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2484 alt_dns_servers = '\n '.join(dns_servers.split(' '))
2485 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2487 'default DNS servers: @0@'.format(alt_dns_servers),
2488 'default NTP servers: @0@'.format(alt_ntp_servers)]
2490 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2491 '@@0@'.format(time_epoch)).stdout().strip()
2493 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2496 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2497 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2498 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2500 if conf.get('ENABLE_EFI') == 1
2502 'efi arch: @0@'.format(efi_arch)]
2506 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2507 'EFI CC @0@'.format(efi_cc),
2508 'EFI lib directory: @0@'.format(efi_libdir),
2509 'EFI lds directory: @0@'.format(efi_ldsdir),
2510 'EFI include directory: @0@'.format(efi_incdir)]
2563 ['legacy pkla', install_polkit_pkla],
2565 ['gnu-efi', have_gnu_efi],
2571 ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
2574 ['man pages', want_man],
2575 ['html pages', want_html],
2576 ['man page indices', want_man and have_lxml],
2577 ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
2582 ['adm group', get_option('adm-group')],
2583 ['wheel group', get_option('wheel-group')],
2586 ['debug mmap cache'],
2589 cond = tuple.get(1, '')
2591 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2592 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2593 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
2598 missing += [tuple[0]]
2604 'enabled features: @0@'.format(', '.join(found)),
2606 'disabled features: @0@'.format(', '.join(missing)),
2608 message('\n '.join(status))