3 project('systemd', 'c',
12 meson_version : '>= 0.39.1',
15 # We need the same data in three different formats, ugh!
16 # Also, for hysterical reasons, we use different variable
17 # names, sometimes. Not all variables are included in every
19 conf = configuration_data()
20 conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
21 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
23 substs = configuration_data()
24 substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
25 substs.set('PACKAGE_VERSION', meson.project_version())
29 #####################################################################
31 if get_option('split-usr')
32 conf.set('HAVE_SPLIT_USR', 1)
35 rootprefixdir = '/usr'
38 sysvinit_path = get_option('sysvinit-path')
39 sysvrcnd_path = get_option('sysvrcnd-path')
40 if sysvinit_path != '' or sysvrcnd_path != ''
41 conf.set('HAVE_SYSV_COMPAT', 1,
42 description : 'SysV init scripts and rcN.d links are supported')
45 # join_paths ignore the preceding arguments if an absolute component is
46 # encountered, so this should canonicalize various paths when they are
47 # absolute or relative.
48 prefixdir = get_option('prefix')
49 if not prefixdir.startswith('/')
50 error('Prefix is not absolute: "@0@"'.format(prefixdir))
52 bindir = join_paths(prefixdir, get_option('bindir'))
53 libdir = join_paths(prefixdir, get_option('libdir'))
54 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
55 includedir = join_paths(prefixdir, get_option('includedir'))
56 datadir = join_paths(prefixdir, get_option('datadir'))
57 localstatedir = join_paths('/', get_option('localstatedir'))
59 rootbindir = join_paths(rootprefixdir, 'bin')
60 rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
62 rootlibdir = get_option('rootlibdir')
64 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
67 # Dirs of external packages
68 pkgconfigdatadir = datadir + '/pkgconfig'
69 pkgconfiglibdir = libdir + '/pkgconfig'
70 polkitpolicydir = datadir + '/polkit-1/actions'
71 polkitrulesdir = datadir + '/polkit-1/rules.d'
72 polkitpkladir = localstatedir + '/lib/polkit-1/localauthority/10-vendor.d'
73 varlogdir = localstatedir + '/log'
74 xinitrcdir = sysconfdir + '/X11/xinit/xinitrc.d'
75 rpmmacrosdir = get_option('rpmmacrosdir')
78 pkgdatadir = datadir + '/systemd'
79 environmentdir = prefixdir + '/lib/environment.d'
80 pkgsysconfdir = sysconfdir + '/systemd'
81 userunitdir = prefixdir + '/lib/systemd/user'
82 userpresetdir = prefixdir + '/lib/systemd/user-preset'
83 tmpfilesdir = prefixdir + '/lib/tmpfiles.d'
84 sysusersdir = prefixdir + '/lib/sysusers.d'
85 sysctldir = prefixdir + '/lib/sysctl.d'
86 binfmtdir = prefixdir + '/lib/binfmt.d'
87 modulesloaddir = prefixdir + '/lib/modules-load.d'
88 networkdir = rootprefixdir + '/lib/systemd/network'
89 pkgincludedir = includedir + '/systemd'
90 systemgeneratordir = rootlibexecdir + '/system-generators'
91 usergeneratordir = prefixdir + '/lib/systemd/user-generators'
92 systemenvgeneratordir = prefixdir + '/lib/systemd/system-environment-generators'
93 userenvgeneratordir = prefixdir + '/lib/systemd/user-environment-generators'
94 systemshutdowndir = rootlibexecdir + '/system-shutdown'
95 systemsleepdir = rootlibexecdir + '/system-sleep'
96 systemunitdir = rootprefixdir + '/lib/systemd/system'
97 systempresetdir = rootprefixdir + '/lib/systemd/system-preset'
98 udevlibexecdir = rootprefixdir + '/lib/udev'
99 udevhomedir = udevlibexecdir + ''
100 udevrulesdir = udevlibexecdir + '/rules.d'
101 udevhwdbdir = udevlibexecdir + '/hwdb.d'
102 catalogdir = prefixdir + '/lib/systemd/catalog'
103 kernelinstalldir = prefixdir + '/lib/kernel/install.d'
104 factorydir = datadir + '/factory'
105 docdir = datadir + '/doc/systemd'
106 bootlibdir = prefixdir + '/lib/systemd/boot/efi'
107 testsdir = prefixdir + '/lib/systemd/tests'
108 systemdstatedir = localstatedir + '/lib/systemd'
109 catalogstatedir = systemdstatedir + '/catalog'
111 dbuspolicydir = get_option('dbuspolicydir')
112 if dbuspolicydir == ''
113 dbuspolicydir = datadir + '/dbus-1/system.d'
116 dbussessionservicedir = get_option('dbussessionservicedir')
117 if dbussessionservicedir == ''
118 dbussessionservicedir = datadir + '/dbus-1/services'
121 dbussystemservicedir = get_option('dbussystemservicedir')
122 if dbussystemservicedir == ''
123 dbussystemservicedir = datadir + '/dbus-1/system-services'
126 pamlibdir = get_option('pamlibdir')
128 pamlibdir = rootlibdir + '/security'
131 pamconfdir = get_option('pamconfdir')
133 pamconfdir = sysconfdir + '/pam.d'
136 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
137 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', pkgsysconfdir + '/system')
138 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
139 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
140 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
141 conf.set_quoted('USER_CONFIG_UNIT_PATH', pkgsysconfdir + '/user')
142 conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
143 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
144 conf.set_quoted('CATALOG_DATABASE', catalogstatedir + '/database')
145 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', rootlibexecdir + '/systemd-cgroups-agent')
146 conf.set_quoted('SYSTEMD_BINARY_PATH', rootlibexecdir + '/systemd')
147 conf.set_quoted('SYSTEMD_FSCK_PATH', rootlibexecdir + '/systemd-fsck')
148 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', rootlibexecdir + '/systemd-shutdown')
149 conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', rootlibexecdir + '/systemd-sleep')
150 conf.set_quoted('SYSTEMCTL_BINARY_PATH', rootbindir + '/systemctl')
151 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', rootbindir + '/systemd-tty-ask-password-agent')
152 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', bindir + '/systemd-stdio-bridge')
153 conf.set_quoted('ROOTPREFIX', rootprefixdir)
154 conf.set_quoted('RANDOM_SEED_DIR', localstatedir + '/lib/systemd/')
155 conf.set_quoted('RANDOM_SEED', localstatedir + '/lib/systemd/random-seed')
156 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', rootlibexecdir + '/systemd-cryptsetup')
157 conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
158 conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
159 conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
160 conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
161 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
162 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
163 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', pkgdatadir + '/kbd-model-map')
164 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', pkgdatadir + '/language-fallback-map')
165 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
166 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', bindir + '/pkttyagent')
167 conf.set_quoted('LIBDIR', libdir)
168 conf.set_quoted('ROOTLIBDIR', rootlibdir)
169 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
170 conf.set_quoted('BOOTLIBDIR', bootlibdir)
171 conf.set_quoted('SYSTEMD_PULL_PATH', rootlibexecdir + '/systemd-pull')
172 conf.set_quoted('SYSTEMD_IMPORT_PATH', rootlibexecdir + '/systemd-import')
173 conf.set_quoted('SYSTEMD_EXPORT_PATH', rootlibexecdir + '/systemd-export')
174 conf.set_quoted('VENDOR_KEYRING_PATH', rootlibexecdir + '/import-pubring.gpg')
175 conf.set_quoted('USER_KEYRING_PATH', pkgsysconfdir + '/import-pubring.gpg')
176 conf.set_quoted('DOCUMENT_ROOT', pkgdatadir + '/gatewayd')
178 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
179 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
181 substs.set('prefix', prefixdir)
182 substs.set('pkgsysconfdir', pkgsysconfdir)
183 substs.set('rootlibexecdir', rootlibexecdir)
184 substs.set('systemunitdir', systemunitdir)
185 substs.set('userunitdir', userunitdir)
186 substs.set('systempresetdir', systempresetdir)
187 substs.set('userpresetdir', userpresetdir)
188 substs.set('udevhwdbdir', udevhwdbdir)
189 substs.set('udevrulesdir', udevrulesdir)
190 substs.set('catalogdir', catalogdir)
191 substs.set('tmpfilesdir', tmpfilesdir)
192 substs.set('sysusersdir', sysusersdir)
193 substs.set('sysctldir', sysctldir)
194 substs.set('binfmtdir', binfmtdir)
195 substs.set('modulesloaddir', modulesloaddir)
196 substs.set('systemgeneratordir', systemgeneratordir)
197 substs.set('usergeneratordir', usergeneratordir)
198 substs.set('systemenvgeneratordir', systemenvgeneratordir)
199 substs.set('userenvgeneratordir', userenvgeneratordir)
200 substs.set('systemshutdowndir', systemshutdowndir)
201 substs.set('systemsleepdir', systemsleepdir)
203 #####################################################################
205 cc = meson.get_compiler('c')
206 pkgconfig = import('pkgconfig')
208 foreach arg : ['-Wundef',
210 '-Wmissing-include-dirs',
211 '-Wold-style-definition',
214 '-Wdeclaration-after-statement',
216 '-Wsuggest-attribute=noreturn',
217 '-Werror=missing-prototypes',
218 '-Werror=implicit-function-declaration',
219 '-Werror=missing-declarations',
220 '-Werror=return-type',
221 '-Werror=incompatible-pointer-types',
223 '-Wstrict-prototypes',
225 '-Wmissing-noreturn',
228 '-Wstrict-aliasing=2',
230 '-Wno-unused-parameter',
231 '-Wno-missing-field-initializers',
232 '-Wno-unused-result',
233 '-Wno-format-signedness',
239 '-fdiagnostics-show-option',
240 '-fno-strict-aliasing',
241 '-fvisibility=hidden',
243 '-fstack-protector-strong',
245 '--param=ssp-buffer-size=4',
247 if cc.has_argument(arg)
248 add_project_arguments(arg, language : 'c')
254 #include <inttypes.h>
255 typedef uint64_t usec_t;
256 usec_t now(clockid_t clock);
263 add_project_arguments('-Werror=shadow', language : 'c')
266 if cc.get_id() == 'clang'
267 foreach arg : ['-Wno-typedef-redefinition',
268 '-Wno-gnu-variable-sized-type-not-at-end',
270 if cc.has_argument(arg)
271 add_project_arguments(arg, language : 'c')
276 # --as-needed and --no-undefined are provided by meson by default,
277 # run mesonconf to see what is enabled
278 foreach arg : ['-Wl,-z,relro',
283 if cc.has_argument(arg)
284 add_project_link_arguments(arg, language : 'c')
288 #####################################################################
289 # compilation result tests
291 conf.set('_GNU_SOURCE', 1)
292 conf.set('__SANE_USERSPACE_TYPES__', 1)
294 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
295 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
296 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
297 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
298 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
299 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
300 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
304 #include <linux/ethtool.h>
306 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
308 foreach decl : ['char16_t',
311 'struct ethtool_link_settings',
313 if cc.sizeof(decl, prefix : decl_headers) > 0
314 # We get -1 if the size cannot be determined
315 conf.set('HAVE_' + decl.underscorify().to_upper(), 1)
319 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
320 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
321 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
322 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
323 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
324 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
325 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
326 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
327 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
328 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
329 # if_tunnel.h is buggy and cannot be included on its own
330 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
331 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
332 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
333 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
334 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
335 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
336 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
337 ['NDA_IFINDEX', 'linux/neighbour.h'],
338 ['IFA_FLAGS', 'linux/if_addr.h'],
339 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
341 prefix = decl.length() > 2 ? decl[2] : ''
342 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
343 conf.set10('HAVE_DECL_' + decl[0], have)
347 foreach ident : ['secure_getenv', '__secure_getenv']
348 if not skip and cc.has_function(ident)
349 conf.set('HAVE_' + ident.to_upper(), 1)
355 ['memfd_create', '''#include <sys/memfd.h>'''],
356 ['gettid', '''#include <sys/types.h>'''],
357 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
358 ['name_to_handle_at', '''#define _GNU_SOURCE
359 #include <sys/types.h>
360 #include <sys/stat.h>
361 #include <fcntl.h>'''],
362 ['setns', '''#define _GNU_SOURCE
363 #include <sched.h>'''],
364 ['getrandom', '''#include <sys/random.h>'''],
365 ['renameat2', '''#include <stdio.h>'''],
366 ['kcmp', '''#include <linux/kcmp.h>'''],
367 ['keyctl', '''#include <sys/types.h>
368 #include <keyutils.h>'''],
369 ['copy_file_range', '''#include <sys/syscall.h>
370 #include <unistd.h>'''],
371 ['explicit_bzero' , '''#include <strings.h>'''],
374 have = cc.has_function(ident[0], prefix : ident[1])
375 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
378 #####################################################################
380 sed = find_program('sed')
381 grep = find_program('grep')
382 awk = find_program('awk')
383 m4 = find_program('/usr/bin/m4')
384 stat = find_program('stat')
385 git = find_program('git', required : false)
386 etags = find_program('etags', required : false)
388 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
389 # /usr/sbin, /sbin, and fall back to the default from middle column.
390 progs = [['telinit', '/lib/sysvinit/telinit'],
391 ['quotaon', '/usr/sbin/quotaon' ],
392 ['quotacheck', '/usr/sbin/quotacheck' ],
393 ['kill', '/usr/bin/kill' ],
394 ['kmod', '/usr/bin/kmod' ],
395 ['kexec', '/usr/sbin/kexec' ],
396 ['sulogin', '/usr/sbin/sulogin' ],
397 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
398 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
399 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
400 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
403 path = get_option(prog[0] + '-path')
405 message('Using @1@ for @0@'.format(prog[0], path))
407 exe = find_program(prog[0], '/usr/sbin/' + prog[0], '/sbin/' + prog[0], required: false)
408 path = exe.found() ? exe.path() : prog[1]
410 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
411 conf.set_quoted(name, path)
414 # TODO: add ln --relative check
415 # AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
417 ############################################################
419 gperf = find_program('gperf')
421 gperf_test_format = '''
423 const char * in_word_set(const char *, @0@);
426 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
427 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
428 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
429 if cc.compiles(gperf_test)
430 gperf_len_type = 'size_t'
432 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
433 if cc.compiles(gperf_test)
434 gperf_len_type = 'unsigned'
436 error('unable to determine gperf len type')
439 message('gperf len type is @0@'.format(gperf_len_type))
440 conf.set('GPERF_LEN_TYPE', gperf_len_type, description : 'The type of gperf "len" parameter')
442 ############################################################
444 if not cc.has_header('sys/capability.h')
445 error('POSIX caps headers not found')
447 foreach header : ['linux/btrfs.h',
449 'linux/vm_sockets.h',
450 'valgrind/memcheck.h',
451 'valgrind/valgrind.h',
453 if cc.has_header(header)
454 conf.set('HAVE_' + header.underscorify().to_upper(), 1)
458 ############################################################
460 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
462 default_hierarchy = get_option('default-hierarchy')
463 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
464 description : 'default cgroup hierarchy as string')
465 if default_hierarchy == 'legacy'
466 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
467 elif default_hierarchy == 'hybrid'
468 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
470 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
473 time_epoch = get_option('time-epoch')
476 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
478 time_epoch = time_epoch.to_int()
479 conf.set('TIME_EPOCH', time_epoch)
481 system_uid_max = get_option('system-uid-max')
482 if system_uid_max == ''
483 system_uid_max = run_command(
485 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
486 '/etc/login.defs').stdout()
488 system_uid_max = system_uid_max.to_int()
489 conf.set('SYSTEM_UID_MAX', system_uid_max)
490 substs.set('systemuidmax', system_uid_max)
491 message('Maximum system UID is @0@'.format(system_uid_max))
493 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
494 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
496 system_gid_max = get_option('system-gid-max')
497 if system_gid_max == ''
498 system_gid_max = run_command(
500 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
501 '/etc/login.defs').stdout()
503 system_gid_max = system_gid_max.to_int()
504 conf.set('SYSTEM_GID_MAX', system_gid_max)
505 substs.set('systemgidmax', system_gid_max)
506 message('Maximum system GID is @0@'.format(system_gid_max))
508 tty_gid = get_option('tty-gid')
509 conf.set('TTY_GID', tty_gid)
510 m4_defines += ['-DTTY_GID=' + tty_gid]
512 if get_option('adm-group')
513 m4_defines += ['-DENABLE_ADM_GROUP']
516 if get_option('wheel-group')
517 m4_defines += ['-DENABLE_WHEEL_GROUP']
520 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
522 conf.set10('KILL_USER_PROCESSES', get_option('default-kill-user-processes'))
524 default_dnssec = get_option('default-dnssec')
525 conf.set('DEFAULT_DNSSEC_MODE',
526 'DNSSEC_' + default_dnssec.underscorify().to_upper())
528 conf.set_quoted('DNS_SERVERS', get_option('dns-servers'))
530 conf.set_quoted('NTP_SERVERS', get_option('ntp-servers'))
532 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
534 #####################################################################
536 threads = dependency('threads')
537 librt = cc.find_library('rt')
538 libm = cc.find_library('m')
539 libdl = cc.find_library('dl')
540 libcrypt = cc.find_library('crypt')
542 libcap = dependency('libcap')
543 libmount = dependency('mount',
546 want_seccomp = get_option('seccomp')
547 if want_seccomp != 'no'
548 libseccomp = dependency('libseccomp',
549 required : want_seccomp == 'yes')
550 if libseccomp.found()
551 conf.set('HAVE_SECCOMP', 1)
552 m4_defines += ['-DHAVE_SECCOMP']
558 want_selinux = get_option('selinux')
559 if want_selinux != 'no'
560 libselinux = dependency('libselinux',
561 version : '>= 2.1.9',
562 required : want_selinux == 'yes')
563 if libselinux.found()
564 conf.set('HAVE_SELINUX', 1)
565 m4_defines += ['-DHAVE_SELINUX']
571 want_apparmor = get_option('apparmor')
572 if want_apparmor != 'no'
573 libapparmor = dependency('libapparmor',
574 required : want_apparmor == 'yes')
575 if libapparmor.found()
576 conf.set('HAVE_APPARMOR', 1)
577 m4_defines += ['-DHAVE_APPARMOR']
583 want_smack = get_option('smack')
584 if want_smack != 'no'
585 libsmack = dependency('libsmack',
586 required : want_smack == 'yes')
588 conf.set('HAVE_SMACK', 1)
589 m4_defines += ['-DHAVE_SMACK']
595 smack_run_label = get_option('smack-run-label')
596 if smack_run_label != ''
597 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
598 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
601 want_audit = get_option('audit')
602 if want_audit != 'no'
603 libaudit = dependency('audit', required : want_audit == 'yes')
605 conf.set('HAVE_AUDIT', 1)
611 want_blkid = get_option('blkid')
612 if want_blkid != 'no'
613 libblkid = dependency('blkid', required : want_blkid == 'yes')
615 conf.set('HAVE_BLKID', 1)
621 want_kmod = get_option('kmod')
623 libkmod = dependency('libkmod',
625 required : want_kmod == 'yes')
627 conf.set('HAVE_KMOD', 1)
633 want_pam = get_option('pam')
635 libpam = cc.find_library('pam', required : want_pam == 'yes')
636 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'yes')
637 if libpam.found() and libpam_misc.found()
638 conf.set('HAVE_PAM', 1)
639 m4_defines += ['-DHAVE_PAM']
646 want_microhttpd = get_option('microhttpd')
647 if want_microhttpd != 'no'
648 libmicrohttpd = dependency('libmicrohttpd',
649 version : '>= 0.9.33',
650 required : want_microhttpd == 'yes')
651 if libmicrohttpd.found()
652 conf.set('HAVE_MICROHTTPD', 1)
653 m4_defines += ['-DHAVE_MICROHTTPD']
659 want_libcryptsetup = get_option('libcryptsetup')
660 if want_libcryptsetup != 'no'
661 libcryptsetup = dependency('libcryptsetup',
662 version : '>= 1.6.0',
663 required : want_libcryptsetup == 'yes')
664 if libcryptsetup.found()
665 conf.set('HAVE_LIBCRYPTSETUP', 1)
671 want_libcurl = get_option('libcurl')
672 if want_libcurl != 'no'
673 libcurl = dependency('libcurl',
674 version : '>= 7.32.0',
675 required : want_libcurl == 'yes')
677 conf.set('HAVE_LIBCURL', 1)
678 m4_defines += ['-DHAVE_LIBCURL']
684 want_libidn = get_option('libidn')
685 if want_libidn != 'no'
686 libidn = dependency('libidn',
687 required : want_libidn == 'yes')
689 conf.set('HAVE_LIBIDN', 1)
690 m4_defines += ['-DHAVE_LIBIDN']
696 want_libiptc = get_option('libiptc')
697 if want_libiptc != 'no'
698 libiptc = dependency('libiptc',
699 required : want_libiptc == 'yes')
701 conf.set('HAVE_LIBIPTC', 1)
702 m4_defines += ['-DHAVE_LIBIPTC']
708 want_qrencode = get_option('qrencode')
709 if want_qrencode != 'no'
710 libqrencode = dependency('libqrencode',
711 required : want_qrencode == 'yes')
712 if libqrencode.found()
713 conf.set('HAVE_QRENCODE', 1)
719 want_gnutls = get_option('gnutls')
720 if want_gnutls != 'no'
721 libgnutls = dependency('gnutls',
722 version : '>= 3.1.4',
723 required : want_gnutls == 'yes')
725 conf.set('HAVE_GNUTLS', 1)
731 want_elfutils = get_option('elfutils')
732 if want_elfutils != 'no'
733 libdw = dependency('libdw',
734 required : want_elfutils == 'yes')
736 conf.set('HAVE_ELFUTILS', 1)
742 want_zlib = get_option('zlib')
744 libz = dependency('zlib',
745 required : want_zlib == 'yes')
747 conf.set('HAVE_ZLIB', 1)
753 want_bzip2 = get_option('bzip2')
754 if want_bzip2 != 'no'
755 libbzip2 = cc.find_library('bz2',
756 required : want_bzip2 == 'yes')
758 conf.set('HAVE_BZIP2', 1)
764 want_xz = get_option('xz')
766 libxz = dependency('liblzma',
767 required : want_xz == 'yes')
769 conf.set('HAVE_XZ', 1)
775 want_lz4 = get_option('lz4')
777 liblz4 = dependency('liblz4',
778 required : want_lz4 == 'yes')
780 conf.set('HAVE_LZ4', 1)
786 libacl = cc.find_library('acl', required : false)
788 conf.set('HAVE_ACL', 1)
789 m4_defines += ['-DHAVE_ACL']
792 want_libgcrypt = get_option('libgcrypt')
793 if want_libgcrypt != 'no'
794 libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'yes')
796 conf.set('HAVE_LIBGCRYPT', 1)
802 want_importd = get_option('importd')
803 if want_importd != 'no'
804 have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and
805 conf.get('HAVE_ZLIB', 0) == 1 and
806 conf.get('HAVE_BZIP2', 0) == 1 and
807 conf.get('HAVE_XZ', 0) == 1 and
808 conf.get('HAVE_LZ4', 0) == 1)
810 conf.set('ENABLE_IMPORTD', 1)
811 elif want_importd == 'yes'
812 error('importd support was requested, but dependencies are not available')
816 want_remote = get_option('remote')
817 if want_remote != 'no'
818 have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1,
819 conf.get('HAVE_LIBCURL', 0) == 1]
820 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
821 # it's possible to build one without the other. Complain only if
822 # support was explictly requested. The auxiliary files like sysusers
823 # config should be installed when any of the programs are built.
824 if want_remote == 'yes' and not (have_deps[0] and have_deps[1])
825 error('remote support was requested, but dependencies are not available')
827 if have_deps[0] or have_deps[1]
828 conf.set('ENABLE_REMOTE', 1)
832 foreach pair : [['utmp', 'HAVE_UTMP'],
833 ['hibernate', 'ENABLE_HIBERNATE'],
834 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
835 ['binfmt', 'ENABLE_BINFMT'],
836 ['coredump', 'ENABLE_COREDUMP'],
837 ['resolve', 'ENABLE_RESOLVED'],
838 ['logind', 'ENABLE_LOGIND'],
839 ['hostnamed', 'ENABLE_HOSTNAMED'],
840 ['localed', 'ENABLE_LOCALED'],
841 ['machined', 'ENABLE_MACHINED'],
842 ['networkd', 'ENABLE_NETWORKD'],
843 ['timedated', 'ENABLE_TIMEDATED'],
844 ['timesyncd', 'ENABLE_TIMESYNCD'],
845 ['myhostname', 'HAVE_MYHOSTNAME'],
846 ['firstboot', 'ENABLE_FIRSTBOOT'],
847 ['randomseed', 'ENABLE_RANDOMSEED'],
848 ['backlight', 'ENABLE_BACKLIGHT'],
849 ['vconsole', 'ENABLE_VCONSOLE'],
850 ['quotacheck', 'ENABLE_QUOTACHECK'],
851 ['sysusers', 'ENABLE_SYSUSERS'],
852 ['tmpfiles', 'ENABLE_TMPFILES'],
853 ['hwdb', 'ENABLE_HWDB'],
854 ['rfkill', 'ENABLE_RFKILL'],
855 ['ldconfig', 'ENABLE_LDCONFIG'],
858 if get_option(pair[0])
863 #####################################################################
866 efi_arch = host_machine.cpu_family() # TODO: check this works at all
867 if efi_arch == 'ia32'
868 EFI_MACHINE_TYPE_NAME = 'ia32'
869 elif efi_arch == 'x86_64'
870 EFI_MACHINE_TYPE_NAME = 'x64'
871 elif efi_arch == 'aarch64'
872 EFI_MACHINE_TYPE_NAME = 'x64'
874 EFI_MACHINE_TYPE_NAME = efi_arch
877 conf.set('ENABLE_EFI', 1)
878 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
881 #####################################################################
883 config_h = configure_file(
885 configuration : conf)
887 includes = include_directories('src/basic',
897 'src/libsystemd/sd-bus',
898 'src/libsystemd/sd-device',
899 'src/libsystemd/sd-hwdb',
900 'src/libsystemd/sd-id128',
901 'src/libsystemd/sd-netlink',
902 'src/libsystemd/sd-network',
903 'src/libsystemd-network',
906 add_project_arguments('-include', 'config.h', language : 'c')
908 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
909 'src/shared/gcrypt-util.c')
913 subdir('src/systemd')
915 subdir('src/libsystemd')
916 subdir('src/libsystemd-network')
917 subdir('src/analyze')
918 subdir('src/coredump')
919 subdir('src/hostname')
921 subdir('src/journal')
922 subdir('src/journal-remote')
923 subdir('src/kernel-install')
926 subdir('src/machine')
928 subdir('src/resolve')
929 subdir('src/timedate')
930 subdir('src/timesync')
931 subdir('src/vconsole')
933 libjournal_core = static_library(
935 libjournal_core_sources,
937 include_directories : includes,
938 link_with : [libbasic,
940 libsystemd_journal_internal],
943 libsystemd = shared_library(
945 libsystemd_internal_sources,
947 include_directories : includes,
948 link_args : ['-shared',
949 '-Wl,--version-script=' + libsystemd_sym],
950 link_with : [libbasic,
952 libsystemd_journal_internal],
953 dependencies : [threads],
955 install_dir : rootlibdir)
957 ############################################################
959 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
961 ['mymachines', 'ENABLE_MACHINED', []],
962 ['resolve', 'ENABLE_RESOLVED', [libdl]]]
964 condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1
967 extra_deps = tuple[2]
969 sym = meson.current_source_dir() + '/src/nss-@0@/nss-@0@.sym'.format(module)
973 'src/nss-@0@/nss-@0@.c'.format(module),
975 include_directories : includes,
976 link_args : ['-shared',
977 '-Wl,--version-script=' + sym,
979 link_with : [libsystemd_internal,
981 dependencies : [threads,
984 install_dir : rootlibdir)
988 ############################################################
990 subdir('src/libudev')
994 subdir('src/network')
996 executable('systemd',
998 include_directories : includes,
999 link_with : [libcore,
1001 dependencies : [threads,
1007 install_dir : rootlibexecdir)
1009 executable('systemd-analyze',
1010 systemd_analyze_sources,
1011 include_directories : includes,
1012 link_with : [libcore,
1014 dependencies : [threads,
1021 executable('systemd-journald',
1022 systemd_journald_sources,
1023 include_directories : includes,
1024 link_with : [libsystemd_journal_internal,
1028 dependencies : [threads,
1032 install_dir : rootlibexecdir)
1034 executable('systemd-cat',
1035 systemd_cat_sources,
1036 include_directories : includes,
1037 link_with : [libjournal_core,
1040 dependencies : [threads],
1043 executable('journalctl',
1045 include_directories : includes,
1046 link_with : [libshared,
1048 dependencies : [threads,
1053 install_dir : rootbindir)
1055 executable('systemd-getty-generator',
1056 'src/getty-generator/getty-generator.c',
1058 install_dir : systemgeneratordir,
1059 include_directories : includes,
1060 link_with : [libshared])
1062 executable('systemd-debug-generator',
1063 'src/debug-generator/debug-generator.c',
1065 install_dir : systemgeneratordir,
1066 include_directories : includes,
1067 link_with : [libshared])
1069 executable('systemd-fstab-generator',
1070 'src/fstab-generator/fstab-generator.c',
1071 'src/core/mount-setup.c',
1073 install_dir : systemgeneratordir,
1074 include_directories : includes,
1075 link_with : [libshared])
1077 if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1
1078 executable('30-systemd-environment-d-generator',
1079 'src/environment-d-generator/environment-d-generator.c',
1081 install_dir : userenvgeneratordir,
1082 include_directories : includes,
1083 link_with : [libshared])
1086 if conf.get('ENABLE_HIBERNATE', 0) == 1
1087 executable('systemd-hibernate-resume-generator',
1088 'src/hibernate-resume/hibernate-resume-generator.c',
1089 include_directories : includes,
1090 link_with : [libshared],
1092 install_dir : systemgeneratordir)
1094 executable('systemd-hibernate-resume',
1095 'src/hibernate-resume/hibernate-resume.c',
1096 include_directories : includes,
1097 link_with : [libshared],
1099 install_dir : rootlibexecdir)
1102 if conf.get('HAVE_BLKID', 0) == 1
1103 executable('systemd-gpt-auto-generator',
1104 'src/gpt-auto-generator/gpt-auto-generator.c',
1105 'src/basic/blkid-util.h',
1107 install_dir : systemgeneratordir,
1108 include_directories : includes,
1109 link_with : libshared,
1110 dependencies : libblkid)
1112 executable('systemd-dissect',
1113 'src/dissect/dissect.c',
1114 include_directories : includes,
1115 link_with : [libshared],
1117 install_dir : rootlibexecdir)
1120 if conf.get('ENABLE_RESOLVED', 0) == 1
1121 executable('systemd-resolved',
1122 systemd_resolved_sources,
1123 include_directories : includes,
1124 link_with : [libshared,
1126 dependencies : [threads,
1130 install_dir : rootlibexecdir)
1132 executable('systemd-resolve',
1133 systemd_resolve_sources,
1134 include_directories : includes,
1135 link_with : [libshared,
1137 dependencies : [threads,
1143 if conf.get('ENABLE_LOGIND', 0) == 1
1144 executable('systemd-logind',
1145 systemd_logind_sources,
1146 include_directories : includes,
1147 link_with : [liblogind_core,
1149 dependencies : [threads,
1152 install_dir : rootlibexecdir)
1154 executable('loginctl',
1156 include_directories : includes,
1157 link_with : [libshared],
1158 dependencies : [threads,
1162 install_dir : rootbindir)
1164 executable('systemd-inhibit',
1165 'src/login/inhibit.c',
1166 include_directories : includes,
1167 link_with : [libshared],
1169 install_dir : rootbindir)
1171 if conf.get('HAVE_PAM', 0) == 1
1176 include_directories : includes,
1177 link_args : ['-shared',
1178 '-Wl,--version-script=' + pam_systemd_sym],
1179 link_with : [libshared],
1180 dependencies : [libpam,
1183 install_dir : pamlibdir)
1187 if conf.get('HAVE_PAM', 0) == 1
1188 executable('systemd-user-sessions',
1189 'src/user-sessions/user-sessions.c',
1190 include_directories : includes,
1191 link_with : [libshared],
1193 install_dir : rootlibexecdir)
1196 if conf.get('ENABLE_EFI', 0) == 1
1197 executable('bootctl',
1198 'src/boot/bootctl.c',
1199 include_directories : includes,
1200 link_with : [libshared],
1201 dependencies : [libblkid],
1205 executable('systemd-socket-activate', 'src/activate/activate.c',
1206 include_directories : includes,
1207 link_with : [libshared],
1208 dependencies : [threads],
1211 executable('systemctl', 'src/systemctl/systemctl.c',
1212 include_directories : includes,
1213 link_with : [libshared],
1214 dependencies : [threads,
1220 install_dir : rootbindir)
1222 if conf.get('ENABLE_BACKLIGHT', 0) == 1
1223 executable('systemd-backlight',
1224 'src/backlight/backlight.c',
1225 include_directories : includes,
1226 link_with : [libshared],
1228 install_dir : rootlibexecdir)
1231 if conf.get('ENABLE_RFKILL', 0) == 1
1232 executable('systemd-rfkill',
1233 'src/rfkill/rfkill.c',
1234 include_directories : includes,
1235 link_with : [libshared],
1237 install_dir : rootlibexecdir)
1240 executable('systemd-system-update-generator',
1241 'src/system-update-generator/system-update-generator.c',
1242 include_directories : includes,
1243 link_with : [libshared],
1245 install_dir : systemgeneratordir)
1247 if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1
1248 executable('systemd-cryptsetup',
1249 'src/cryptsetup/cryptsetup.c',
1250 include_directories : includes,
1251 link_with : [libshared],
1252 dependencies : [libcryptsetup],
1254 install_dir : rootlibexecdir)
1256 executable('systemd-cryptsetup-generator',
1257 'src/cryptsetup/cryptsetup-generator.c',
1258 include_directories : includes,
1259 link_with : [libshared],
1260 dependencies : [libcryptsetup],
1262 install_dir : systemgeneratordir)
1264 executable('systemd-veritysetup',
1265 'src/veritysetup/veritysetup.c',
1266 include_directories : includes,
1267 link_with : [libshared],
1268 dependencies : [libcryptsetup],
1270 install_dir : rootlibexecdir)
1272 executable('systemd-veritysetup-generator',
1273 'src/veritysetup/veritysetup-generator.c',
1274 include_directories : includes,
1275 link_with : [libshared],
1276 dependencies : [libcryptsetup],
1278 install_dir : systemgeneratordir)
1281 if conf.get('HAVE_SYSV_COMPAT', 0) == 1
1282 executable('systemd-sysv-generator',
1283 'src/sysv-generator/sysv-generator.c',
1284 include_directories : includes,
1285 link_with : [libshared],
1287 install_dir : systemgeneratordir)
1289 executable('systemd-rc-local-generator',
1290 'src/rc-local-generator/rc-local-generator.c',
1291 include_directories : includes,
1292 link_with : [libshared],
1294 install_dir : systemgeneratordir)
1297 if conf.get('ENABLE_HOSTNAMED', 0) == 1
1298 executable('systemd-hostnamed',
1299 'src/hostname/hostnamed.c',
1300 include_directories : includes,
1301 link_with : [libshared],
1303 install_dir : rootlibexecdir)
1305 executable('hostnamectl',
1306 'src/hostname/hostnamectl.c',
1307 include_directories : includes,
1308 link_with : [libshared],
1312 if conf.get('ENABLE_LOCALED', 0) == 1
1313 executable('systemd-localed',
1314 systemd_localed_sources,
1315 include_directories : includes,
1316 link_with : [libshared],
1317 dependencies : [libdl],
1319 install_dir : rootlibexecdir)
1321 executable('localectl',
1323 include_directories : includes,
1324 link_with : [libshared],
1328 if conf.get('ENABLE_TIMEDATED', 0) == 1
1329 executable('systemd-timedated',
1330 'src/timedate/timedated.c',
1331 include_directories : includes,
1332 link_with : [libshared],
1334 install_dir : rootlibexecdir)
1336 executable('timedatectl',
1337 'src/timedate/timedatectl.c',
1338 include_directories : includes,
1339 link_with : [libshared],
1343 if conf.get('ENABLE_TIMESYNCD', 0) == 1
1344 executable('systemd-timesyncd',
1345 systemd_timesyncd_sources,
1346 include_directories : includes,
1347 link_with : [libshared],
1348 dependencies : [threads,
1351 install_dir : rootlibexecdir)
1354 if conf.get('ENABLE_MACHINED', 0) == 1
1355 executable('systemd-machined',
1356 systemd_machined_sources,
1357 include_directories : includes,
1358 link_with : [libmachine_core,
1361 install_dir : rootlibexecdir)
1363 executable('machinectl',
1364 'src/machine/machinectl.c',
1365 include_directories : includes,
1366 link_with : [libshared],
1367 dependencies : [threads,
1371 install_dir : rootbindir)
1374 if conf.get('ENABLE_IMPORTD', 0) == 1
1375 executable('systemd-importd',
1376 systemd_importd_sources,
1377 include_directories : includes,
1378 link_with : [libshared],
1380 install_dir : rootlibexecdir)
1382 executable('systemd-pull',
1383 systemd_pull_sources,
1384 include_directories : includes,
1385 link_with : [libshared],
1386 dependencies : [libcurl,
1392 install_dir : rootlibexecdir)
1394 executable('systemd-import',
1395 systemd_import_sources,
1396 include_directories : includes,
1397 link_with : [libshared],
1398 dependencies : [libcurl,
1403 install_dir : rootlibexecdir)
1405 executable('systemd-export',
1406 systemd_export_sources,
1407 include_directories : includes,
1408 link_with : [libshared],
1409 dependencies : [libcurl,
1414 install_dir : rootlibexecdir)
1417 if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1
1418 executable('systemd-journal-upload',
1419 systemd_journal_upload_sources,
1420 include_directories : includes,
1421 link_with : [libshared],
1422 dependencies : [threads,
1428 install_dir : rootlibexecdir)
1431 if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1
1432 executable('systemd-journal-remote',
1433 systemd_journal_remote_sources,
1434 include_directories : includes,
1435 link_with : [libshared],
1436 dependencies : [threads,
1442 install_dir : rootlibexecdir)
1444 executable('systemd-journal-gatewayd',
1445 systemd_journal_gatewayd_sources,
1446 include_directories : includes,
1447 link_with : [libshared],
1448 dependencies : [threads,
1454 install_dir : rootlibexecdir)
1457 if conf.get('ENABLE_COREDUMP', 0) == 1
1458 executable('systemd-coredump',
1459 systemd_coredump_sources,
1460 include_directories : includes,
1461 link_with : [libshared],
1462 dependencies : [threads,
1468 install_dir : rootlibexecdir)
1470 executable('coredumpctl',
1471 coredumpctl_sources,
1472 include_directories : includes,
1473 link_with : [libshared],
1474 dependencies : [threads,
1480 if conf.get('ENABLE_BINFMT', 0) == 1
1481 executable('systemd-binfmt',
1482 'src/binfmt/binfmt.c',
1483 include_directories : includes,
1484 link_with : [libshared],
1486 install_dir : rootlibexecdir)
1489 if conf.get('ENABLE_VCONSOLE', 0) == 1
1490 executable('systemd-vconsole-setup',
1491 'src/vconsole/vconsole-setup.c',
1492 include_directories : includes,
1493 link_with : [libshared],
1495 install_dir : rootlibexecdir)
1498 if conf.get('ENABLE_RANDOMSEED', 0) == 1
1499 executable('systemd-random-seed',
1500 'src/random-seed/random-seed.c',
1501 include_directories : includes,
1502 link_with : [libshared],
1504 install_dir : rootlibexecdir)
1507 if conf.get('ENABLE_FIRSTBOOT', 0) == 1
1508 executable('systemd-firstboot',
1509 'src/firstboot/firstboot.c',
1510 include_directories : includes,
1511 link_with : [libshared],
1512 dependencies : [libcrypt],
1514 install_dir : rootbindir)
1517 executable('systemd-remount-fs',
1518 'src/remount-fs/remount-fs.c',
1519 'src/core/mount-setup.c',
1520 'src/core/mount-setup.h',
1521 include_directories : includes,
1522 link_with : [libshared],
1524 install_dir : rootlibexecdir)
1526 executable('systemd-machine-id-setup',
1527 'src/machine-id-setup/machine-id-setup-main.c',
1528 'src/core/machine-id-setup.c',
1529 'src/core/machine-id-setup.h',
1530 include_directories : includes,
1531 link_with : [libshared],
1533 install_dir : rootbindir)
1535 executable('systemd-fsck',
1537 include_directories : includes,
1538 link_with : [libshared],
1540 install_dir : rootlibexecdir)
1542 executable('systemd-sleep',
1543 'src/sleep/sleep.c',
1544 include_directories : includes,
1545 link_with : [libshared],
1547 install_dir : rootlibexecdir)
1549 executable('systemd-sysctl',
1550 'src/sysctl/sysctl.c',
1551 include_directories : includes,
1552 link_with : [libshared],
1554 install_dir : rootlibexecdir)
1556 executable('systemd-ac-power',
1557 'src/ac-power/ac-power.c',
1558 include_directories : includes,
1559 link_with : [libshared],
1561 install_dir : rootlibexecdir)
1563 executable('systemd-detect-virt',
1564 'src/detect-virt/detect-virt.c',
1565 include_directories : includes,
1566 link_with : [libshared],
1569 executable('systemd-delta',
1570 'src/delta/delta.c',
1571 include_directories : includes,
1572 link_with : [libshared],
1575 executable('systemd-escape',
1576 'src/escape/escape.c',
1577 include_directories : includes,
1578 link_with : [libshared],
1580 install_dir : rootbindir)
1582 executable('systemd-notify',
1583 'src/notify/notify.c',
1584 include_directories : includes,
1585 link_with : [libshared],
1587 install_dir : rootbindir)
1589 executable('systemd-volatile-root',
1590 'src/volatile-root/volatile-root.c',
1591 include_directories : includes,
1592 link_with : [libshared],
1594 install_dir : rootlibexecdir)
1596 executable('systemd-cgroups-agent',
1597 'src/cgroups-agent/cgroups-agent.c',
1598 include_directories : includes,
1599 link_with : [libshared],
1601 install_dir : rootlibexecdir)
1603 executable('systemd-path',
1605 include_directories : includes,
1606 link_with : [libshared],
1609 executable('systemd-ask-password',
1610 'src/ask-password/ask-password.c',
1611 include_directories : includes,
1612 link_with : [libshared],
1614 install_dir : rootbindir)
1616 executable('systemd-reply-password',
1617 'src/reply-password/reply-password.c',
1618 include_directories : includes,
1619 link_with : [libshared],
1621 install_dir : rootlibexecdir)
1623 executable('systemd-tty-ask-password-agent',
1624 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1625 include_directories : includes,
1626 link_with : [libshared],
1628 install_dir : rootbindir)
1630 executable('systemd-cgls',
1632 include_directories : includes,
1633 link_with : [libshared],
1636 executable('systemd-cgtop',
1637 'src/cgtop/cgtop.c',
1638 include_directories : includes,
1639 link_with : [libshared],
1642 executable('systemd-initctl',
1643 'src/initctl/initctl.c',
1644 include_directories : includes,
1645 link_with : [libshared],
1647 install_dir : rootlibexecdir)
1649 executable('systemd-mount',
1650 'src/mount/mount-tool.c',
1651 include_directories : includes,
1652 link_with : [libshared],
1655 executable('systemd-run',
1657 include_directories : includes,
1658 link_with : [libshared],
1661 executable('systemd-stdio-bridge',
1662 'src/stdio-bridge/stdio-bridge.c',
1663 include_directories : includes,
1664 link_with : [libshared],
1667 executable('busctl',
1668 'src/busctl/busctl.c',
1669 'src/busctl/busctl-introspect.c',
1670 'src/busctl/busctl-introspect.h',
1671 include_directories : includes,
1672 link_with : [libshared],
1675 if conf.get('ENABLE_SYSUSERS', 0) == 1
1676 executable('systemd-sysusers',
1677 'src/sysusers/sysusers.c',
1678 include_directories : includes,
1679 link_with : [libshared],
1681 install_dir : rootbindir)
1684 if conf.get('ENABLE_TMPFILES', 0) == 1
1685 executable('systemd-tmpfiles',
1686 'src/tmpfiles/tmpfiles.c',
1687 include_directories : includes,
1688 link_with : [libshared],
1689 dependencies : [libacl],
1691 install_dir : rootbindir)
1694 if conf.get('ENABLE_HWDB', 0) == 1
1695 executable('systemd-hwdb',
1697 'src/libsystemd/sd-hwdb/hwdb-internal.h',
1698 include_directories : includes,
1699 link_with : [libshared],
1701 install_dir : rootbindir)
1704 if conf.get('ENABLE_QUOTACHECK', 0) == 1
1705 executable('systemd-quotacheck',
1706 'src/quotacheck/quotacheck.c',
1707 include_directories : includes,
1708 link_with : [libshared],
1710 install_dir : rootlibexecdir)
1713 executable('systemd-socket-proxyd',
1714 'src/socket-proxy/socket-proxyd.c',
1715 include_directories : includes,
1716 link_with : [libshared,
1718 dependencies : [threads],
1720 install_dir : rootlibexecdir)
1722 executable('systemd-udevd',
1723 systemd_udevd_sources,
1724 include_directories : includes,
1725 link_with : [libudev_core,
1729 dependencies : [libkmod,
1733 install_dir : rootlibexecdir)
1735 executable('udevadm',
1737 include_directories : includes,
1738 link_with : [libudev_core,
1742 dependencies : [libkmod,
1746 install_dir : rootbindir)
1748 executable('systemd-shutdown',
1749 systemd_shutdown_sources,
1750 include_directories : includes,
1751 link_with : [libshared],
1753 install_dir : rootlibexecdir)
1755 executable('systemd-update-done',
1756 'src/update-done/update-done.c',
1757 include_directories : includes,
1758 link_with : [libshared],
1760 install_dir : rootlibexecdir)
1762 executable('systemd-update-utmp',
1763 'src/update-utmp/update-utmp.c',
1764 include_directories : includes,
1765 link_with : [libshared],
1766 dependencies : [libaudit],
1768 install_dir : rootlibexecdir)
1770 if conf.get('HAVE_KMOD', 0) == 1
1771 executable('systemd-modules-load',
1772 'src/modules-load/modules-load.c',
1773 include_directories : includes,
1774 link_with : [libshared],
1775 dependencies : [libkmod],
1777 install_dir : rootlibexecdir)
1780 executable('systemd-nspawn',
1781 systemd_nspawn_sources,
1782 'src/core/mount-setup.c', # FIXME: use a variable?
1783 'src/core/mount-setup.h',
1784 'src/core/loopback-setup.c',
1785 'src/core/loopback-setup.h',
1786 include_directories : [includes, include_directories('src/nspawn')],
1787 link_with : [libfirewall,
1789 dependencies : [libacl,
1795 executable('systemd-networkd',
1796 systemd_networkd_sources,
1797 include_directories : includes,
1798 link_with : [libnetworkd_core,
1804 install_dir : rootlibexecdir)
1806 executable('systemd-networkd-wait-online',
1807 systemd_networkd_wait_online_sources,
1808 include_directories : includes,
1809 link_with : [libnetworkd_core,
1812 install_dir : rootlibexecdir)
1814 executable('networkctl',
1816 include_directories : includes,
1817 link_with : [libsystemd_network,
1820 install_dir : rootbindir)
1822 executable('test-sizeof', 'src/test/test-sizeof.c',
1823 include_directories : includes)
1825 make_directive_index_py = find_program('tools/make-directive-index.py')
1826 make_man_index_py = find_program('tools/make-man-index.py')
1830 subdir('sysusers.d')
1831 subdir('tmpfiles.d')
1836 subdir('shell-completion/bash')
1837 subdir('shell-completion/zsh')
1838 subdir('docs/sysvinit')
1839 subdir('docs/var-log')
1841 # FIXME: figure out if the warning is true:
1842 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
1843 install_subdir('factory/etc',
1844 install_dir : factorydir)
1847 install_data('xorg/50-systemd-user.sh',
1848 install_dir : xinitrcdir)
1849 install_data('system-preset/90-systemd.preset',
1850 install_dir : systempresetdir)
1851 install_data('README',
1858 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
1859 install_dir : docdir)
1861 ############################################################
1863 if git.found() and etags.found()
1864 all_files = run_command(
1866 ['--git-dir=@0@/.git'.format(meson.source_root()),
1869 all_files = files(all_files.stdout().split())
1875 command : [etags, '-o', '@OUTPUT@'] + all_files)