1 project('elogind', 'c',
10 meson_version : '>= 0.40',
13 # We need the same data in three different formats, ugh!
14 # Also, for hysterical reasons, we use different variable
15 # names, sometimes. Not all variables are included in every
17 conf = configuration_data()
18 conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
19 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
21 substs = configuration_data()
22 substs.set('PACKAGE_URL', 'https://github.com/elogind/elogind')
23 substs.set('PACKAGE_VERSION', meson.project_version())
27 #####################################################################
28 #if 0 /// elogind does not need this
29 # # Try to install the git pre-commit hook
30 # git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
31 # if git_hook.returncode() == 0
32 # message(git_hook.stdout().strip())
35 # elogind Note: We use precompiler masks for two reasons:
36 # 1) The masking is consistent with the sources
37 # 2) The git patch creator we use for preparing upstream patches
38 # manipulates commits to not take those masks out. Therefore
39 # it can be used to add commits updating the meson files, too.
42 #####################################################################
44 rootprefixdir = get_option('rootprefix')
45 if get_option('split-usr')
46 conf.set('HAVE_SPLIT_USR', true)
47 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
49 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
52 #if 0 /// UNNEEDED by elogind
53 # sysvinit_path = get_option('sysvinit-path')
54 # sysvrcnd_path = get_option('sysvrcnd-path')
55 # if sysvinit_path != '' or sysvrcnd_path != ''
56 # conf.set('HAVE_SYSV_COMPAT', true,
57 # description : 'SysV init scripts and rcN.d links are supported')
58 # m4_defines += ['-DHAVE_SYSV_COMPAT']
62 # join_paths ignore the preceding arguments if an absolute component is
63 # encountered, so this should canonicalize various paths when they are
64 # absolute or relative.
65 prefixdir = get_option('prefix')
66 if not prefixdir.startswith('/')
67 error('Prefix is not absolute: "@0@"'.format(prefixdir))
69 bindir = join_paths(prefixdir, get_option('bindir'))
70 libdir = join_paths(prefixdir, get_option('libdir'))
71 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
72 includedir = join_paths(prefixdir, get_option('includedir'))
73 datadir = join_paths(prefixdir, get_option('datadir'))
74 localstatedir = join_paths('/', get_option('localstatedir'))
76 rootbindir = join_paths(rootprefixdir, 'bin')
77 #if 0 /// elogind has a different default
78 # rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
80 rootlibexecdir = get_option('rootlibexecdir')
81 rootlibexecdir = rootlibexecdir != '' ? rootlibexecdir : join_paths(rootprefixdir, 'lib/elogind')
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 #if 0 /// UNNEEDED by elogind
97 # xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
98 # rpmmacrosdir = get_option('rpmmacrosdir')
99 # modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
103 #if 0 /// elogind has a bit different layout and does not need all of theses
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 pkgdatadir = join_paths(datadir, 'elogind')
139 pkgsysconfdir = join_paths(sysconfdir, 'elogind')
140 pkgincludedir = join_paths(includedir, 'elogind/systemd')
141 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
142 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
144 # in elogind, udev is external and hus configurable
145 udevlibexecdir = get_option('udevbindir')
146 udevlibexecdir = udevlibexecdir != '' ? udevlibexecdir : join_paths(rootprefixdir, 'lib/udev')
147 udevrulesdir = get_option('udevrulesdir')
148 udevrulesdir = udevrulesdir != '' ? udevrulesdir : join_paths(udevlibexecdir, 'rules.d')
149 udevhomedir = udevlibexecdir
150 factorydir = join_paths(datadir, 'factory')
151 docdir = '-'.join([join_paths(datadir, 'doc/elogind'),
152 meson.project_version()])
153 testsdir = join_paths(prefixdir, 'lib/elogind/tests')
154 systemdstatedir = join_paths(localstatedir, 'lib/elogind')
155 randomseeddir = join_paths(localstatedir, 'lib/elogind')
158 dbuspolicydir = get_option('dbuspolicydir')
159 if dbuspolicydir == ''
160 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
163 dbussessionservicedir = get_option('dbussessionservicedir')
164 if dbussessionservicedir == ''
165 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
168 dbussystemservicedir = get_option('dbussystemservicedir')
169 if dbussystemservicedir == ''
170 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
173 pamlibdir = get_option('pamlibdir')
175 pamlibdir = join_paths(rootlibdir, 'security')
178 pamconfdir = get_option('pamconfdir')
180 pamconfdir = join_paths(sysconfdir, 'pam.d')
183 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
184 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
185 #if 0 /// UNNEEDED by elogind
186 # conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
187 # conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
188 # conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
189 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
190 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
191 # conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
192 # conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
193 # conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
194 # conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
195 # conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
196 # conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
197 # conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
198 # conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
199 # conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
200 # conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
201 # conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
202 # conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
204 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'elogind-cgroups-agent'))
205 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'elogind'))
207 conf.set_quoted('ROOTPREFIX', rootprefixdir)
208 #if 0 /// UNNEEDED by elogind
209 # conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
210 # conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
211 # conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
212 # conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
213 # conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
214 # conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
215 # conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
217 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
218 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
219 #if 0 /// UNNEEDED by elogind
220 # conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
221 # conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
223 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
224 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
225 conf.set_quoted('LIBDIR', libdir)
226 conf.set_quoted('ROOTLIBDIR', rootlibdir)
227 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
228 #if 0 /// UNNEEDED by elogind
229 # conf.set_quoted('BOOTLIBDIR', bootlibdir)
230 # conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
231 # conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
232 # conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
233 # conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
234 # conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
235 # conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
238 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
239 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
241 substs.set('prefix', prefixdir)
242 substs.set('exec_prefix', prefixdir)
243 substs.set('libdir', libdir)
244 substs.set('rootlibdir', rootlibdir)
245 substs.set('includedir', includedir)
246 substs.set('pkgsysconfdir', pkgsysconfdir)
247 substs.set('bindir', bindir)
248 substs.set('rootbindir', rootbindir)
249 substs.set('rootlibexecdir', rootlibexecdir)
250 #if 0 /// UNNEEDED by elogind
251 # substs.set('systemunitdir', systemunitdir)
252 # substs.set('userunitdir', userunitdir)
253 # substs.set('systempresetdir', systempresetdir)
254 # substs.set('userpresetdir', userpresetdir)
255 # substs.set('udevhwdbdir', udevhwdbdir)
257 substs.set('udevrulesdir', udevrulesdir)
258 substs.set('udevlibexecdir', udevlibexecdir)
259 #if 0 /// UNNEEDED by elogind
260 # substs.set('catalogdir', catalogdir)
261 # substs.set('tmpfilesdir', tmpfilesdir)
262 # substs.set('sysusersdir', sysusersdir)
263 # substs.set('sysctldir', sysctldir)
264 # substs.set('binfmtdir', binfmtdir)
265 # substs.set('modulesloaddir', modulesloaddir)
266 # substs.set('systemgeneratordir', systemgeneratordir)
267 # substs.set('usergeneratordir', usergeneratordir)
268 # substs.set('systemenvgeneratordir', systemenvgeneratordir)
269 # substs.set('userenvgeneratordir', userenvgeneratordir)
271 substs.set('systemshutdowndir', systemshutdowndir)
272 substs.set('systemsleepdir', systemsleepdir)
273 substs.set('VARLOGDIR', varlogdir)
274 #if 0 /// UNNEEDED by elogind
275 # substs.set('CERTIFICATEROOT', get_option('certificate-root'))
276 # substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
277 # substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
278 # substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
279 # substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
280 # substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
281 # substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
284 #####################################################################
286 cc = meson.get_compiler('c')
287 pkgconfig = import('pkgconfig')
288 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
290 cxx = find_program('c++', required : false)
292 # Used only for tests
296 foreach arg : ['-Wextra',
299 '-Wmissing-include-dirs',
300 '-Wold-style-definition',
303 '-Wdeclaration-after-statement',
305 '-Wsuggest-attribute=noreturn',
306 '-Werror=missing-prototypes',
307 '-Werror=implicit-function-declaration',
308 '-Werror=missing-declarations',
309 '-Werror=return-type',
310 '-Werror=incompatible-pointer-types',
312 '-Wstrict-prototypes',
314 '-Wmissing-noreturn',
317 '-Wstrict-aliasing=2',
324 '-fdiagnostics-show-option',
325 '-fno-strict-aliasing',
326 '-fvisibility=hidden',
328 '-fstack-protector-strong',
330 '--param=ssp-buffer-size=4',
332 if cc.has_argument(arg)
333 add_project_arguments(arg, language : 'c')
337 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
338 # arguments, just emits a warnings. So test for the "positive" version instead.
339 foreach arg : ['unused-parameter',
340 'missing-field-initializers',
343 if cc.has_argument('-W' + arg)
344 add_project_arguments('-Wno-' + arg, language : 'c')
350 #include <inttypes.h>
351 typedef uint64_t usec_t;
352 usec_t now(clockid_t clock);
357 ', name : '-Werror=shadow with local shadowing')
358 add_project_arguments('-Werror=shadow', language : 'c')
361 if cc.get_id() == 'clang'
362 foreach arg : ['-Wno-typedef-redefinition',
363 '-Wno-gnu-variable-sized-type-not-at-end',
365 if cc.has_argument(arg,
366 name : '@0@ is supported'.format(arg))
367 add_project_arguments(arg, language : 'c')
372 link_test_c = files('tools/meson-link-test.c')
374 # --as-needed and --no-undefined are provided by meson by default,
375 # run mesonconf to see what is enabled
376 foreach arg : ['-Wl,-z,relro',
381 have = run_command(check_compilation_sh,
382 cc.cmd_array(), '-x', 'c', arg,
383 '-include', link_test_c).returncode() == 0
384 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
386 add_project_link_arguments(arg, language : 'c')
390 if get_option('buildtype') != 'debug'
391 foreach arg : ['-ffunction-sections',
393 if cc.has_argument(arg,
394 name : '@0@ is supported'.format(arg))
395 add_project_arguments(arg, language : 'c')
399 foreach arg : ['-Wl,--gc-sections']
400 have = run_command(check_compilation_sh,
401 cc.cmd_array(), '-x', 'c', arg,
402 '-include', link_test_c).returncode() == 0
403 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
405 add_project_link_arguments(arg, language : 'c')
410 cpp = ' '.join(cc.cmd_array()) + ' -E'
412 #####################################################################
413 # compilation result tests
415 conf.set('_GNU_SOURCE', true)
416 conf.set('__SANE_USERSPACE_TYPES__', true)
418 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
419 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
420 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
421 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
422 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
423 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
424 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
428 #include <linux/ethtool.h>
430 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
432 foreach decl : ['char16_t',
435 'struct ethtool_link_settings',
438 # We get -1 if the size cannot be determined
439 have = cc.sizeof(decl, prefix : decl_headers) > 0
440 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
443 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
444 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
445 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
446 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
447 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
448 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
449 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
450 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
451 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
452 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
453 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
454 # if_tunnel.h is buggy and cannot be included on its own
455 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
456 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
457 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
458 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
459 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
460 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
461 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
462 ['NDA_IFINDEX', 'linux/neighbour.h'],
463 ['IFA_FLAGS', 'linux/if_addr.h'],
464 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
466 prefix = decl.length() > 2 ? decl[2] : ''
467 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
468 conf.set10('HAVE_DECL_' + decl[0], have)
472 foreach ident : ['secure_getenv', '__secure_getenv']
473 if not skip and cc.has_function(ident)
474 conf.set('HAVE_' + ident.to_upper(), true)
480 ['memfd_create', '''#include <sys/memfd.h>'''],
481 ['gettid', '''#include <sys/types.h>'''],
482 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
483 ['name_to_handle_at', '''#define _GNU_SOURCE
484 #include <sys/types.h>
485 #include <sys/stat.h>
486 #include <fcntl.h>'''],
487 ['setns', '''#define _GNU_SOURCE
488 #include <sched.h>'''],
489 ['renameat2', '''#include <stdio.h>'''],
490 ['kcmp', '''#include <linux/kcmp.h>'''],
491 ['keyctl', '''#include <sys/types.h>
492 #include <keyutils.h>'''],
493 ['copy_file_range', '''#include <sys/syscall.h>
494 #include <unistd.h>'''],
495 ['explicit_bzero' , '''#include <string.h>'''],
498 have = cc.has_function(ident[0], prefix : ident[1])
499 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
502 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
503 conf.set('USE_SYS_RANDOM_H', true)
504 conf.set10('HAVE_DECL_GETRANDOM', true)
506 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
507 conf.set10('HAVE_DECL_GETRANDOM', have)
510 #####################################################################
512 sed = find_program('sed')
513 grep = find_program('grep')
514 awk = find_program('awk')
515 m4 = find_program('m4')
516 stat = find_program('stat')
517 git = find_program('git', required : false)
519 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
520 mkdir_p = 'mkdir -p $DESTDIR/@0@'
521 #if 0 /// unneeded by elogind
522 # test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
523 # splash_bmp = files('test/splash.bmp')
526 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
527 # /usr/sbin, /sbin, and fall back to the default from middle column.
528 #if 0 /// elogind has a bit different list and some adaptions
529 # progs = [['telinit', '/lib/sysvinit/telinit'],
530 # ['quotaon', '/usr/sbin/quotaon' ],
531 # ['quotacheck', '/usr/sbin/quotacheck' ],
532 # ['kill', '/usr/bin/kill' ],
533 # ['kmod', '/usr/bin/kmod' ],
534 # ['kexec', '/usr/sbin/kexec' ],
535 # ['sulogin', '/usr/sbin/sulogin' ],
536 # ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
537 # ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
538 # ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
539 # ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
542 progs = [['kexec', '/usr/sbin/kexec', 'KEXEC'],
543 ['reboot', '/sbin/reboot', 'REBOOT'],
544 ['halt', '/sbin/halt', 'HALT'],
548 path = get_option(prog[0] + '-path')
550 message('Using @1@ for @0@'.format(prog[0], path))
552 exe = find_program(prog[0],
553 '/usr/sbin/' + prog[0],
556 path = exe.found() ? exe.path() : prog[1]
558 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
559 conf.set_quoted(name, path)
560 substs.set(name, path)
563 if run_command('ln', '--relative', '--help').returncode() != 0
564 error('ln does not support --relative')
567 ############################################################
569 gperf = find_program('gperf')
571 gperf_test_format = '''
573 const char * in_word_set(const char *, @0@);
576 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
577 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
578 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
579 if cc.compiles(gperf_test)
580 gperf_len_type = 'size_t'
582 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
583 if cc.compiles(gperf_test)
584 gperf_len_type = 'unsigned'
586 error('unable to determine gperf len type')
589 message('gperf len type is @0@'.format(gperf_len_type))
590 conf.set('GPERF_LEN_TYPE', gperf_len_type,
591 description : 'The type of gperf "len" parameter')
593 ############################################################
595 if not cc.has_header('sys/capability.h')
596 error('POSIX caps headers not found')
598 foreach header : ['linux/btrfs.h',
600 'linux/vm_sockets.h',
601 'valgrind/memcheck.h',
602 'valgrind/valgrind.h',
605 conf.set('HAVE_' + header.underscorify().to_upper(),
606 cc.has_header(header))
609 ############################################################
611 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
612 #if 0 /// UNNEEDED by elogind
613 # conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
614 # gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
617 default_hierarchy = get_option('default-hierarchy')
618 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
619 description : 'default cgroup hierarchy as string')
620 if default_hierarchy == 'legacy'
621 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
622 elif default_hierarchy == 'hybrid'
623 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
625 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
628 #if 0 /// UNNEEDED by elogind
629 # time_epoch = get_option('time-epoch')
630 # if time_epoch == ''
631 # NEWS = files('NEWS')
632 # time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
634 # time_epoch = time_epoch.to_int()
635 # conf.set('TIME_EPOCH', time_epoch)
637 ############################################################
638 # elogind needs to know which cgroups controller to follow.
639 get_cg_ctrl_sh = find_program('tools/meson-get-cg-controller.sh')
640 with_cgroupctrl = get_option('cgroup-controller')
641 if with_cgroupctrl == '' or with_cgroupctrl == 'auto'
642 with_cgroupctrl = run_command(get_cg_ctrl_sh, []).stdout().strip()
643 elif with_cgroupctrl == 'none'
644 with_cgroupctrl = 'elogind'
647 # No controller now is a problem:
648 if with_cgroupctrl == ''
649 error('Unable to determine cgroup controller, but cgroups support is mandatory!')
652 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER', '_'.join(['',with_cgroupctrl]),
653 description : 'name of the cgroup controller to use')
654 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_LEGACY',
655 '='.join(['name', with_cgroupctrl]))
656 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_HYBRID',
657 '='.join(['name', with_cgroupctrl]))
658 ############################################################
661 system_uid_max = get_option('system-uid-max')
662 if system_uid_max == ''
663 system_uid_max = run_command(
665 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
666 '/etc/login.defs').stdout()
668 system_uid_max = system_uid_max.to_int()
669 conf.set('SYSTEM_UID_MAX', system_uid_max)
670 substs.set('systemuidmax', system_uid_max)
671 message('maximum system UID is @0@'.format(system_uid_max))
673 #if 0 /// UNNEEDED by elogind
674 # conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
675 # conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
678 system_gid_max = get_option('system-gid-max')
679 if system_gid_max == ''
680 system_gid_max = run_command(
682 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
683 '/etc/login.defs').stdout()
685 system_gid_max = system_gid_max.to_int()
686 conf.set('SYSTEM_GID_MAX', system_gid_max)
687 substs.set('systemgidmax', system_gid_max)
688 message('maximum system GID is @0@'.format(system_gid_max))
690 tty_gid = get_option('tty-gid')
691 conf.set('TTY_GID', tty_gid)
692 substs.set('TTY_GID', tty_gid)
694 #if 0 /// UNNEEDED by elogind
695 # if get_option('adm-group')
696 # m4_defines += ['-DENABLE_ADM_GROUP']
699 # if get_option('wheel-group')
700 # m4_defines += ['-DENABLE_WHEEL_GROUP']
703 # substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
706 kill_user_processes = get_option('default-kill-user-processes')
707 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
708 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
710 #if 0 /// UNNEEDED by elogind
711 # dns_servers = get_option('dns-servers')
712 # conf.set_quoted('DNS_SERVERS', dns_servers)
713 # substs.set('DNS_SERVERS', dns_servers)
715 # ntp_servers = get_option('ntp-servers')
716 # conf.set_quoted('NTP_SERVERS', ntp_servers)
717 # substs.set('NTP_SERVERS', ntp_servers)
720 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
722 #if 0 /// UNNEEDED by elogind
723 # substs.set('SUSHELL', get_option('debug-shell'))
724 # substs.set('DEBUGTTY', get_option('debug-tty'))
727 debug = get_option('debug')
729 foreach name : debug.split(',')
731 conf.set('ENABLE_DEBUG_HASHMAP', true)
732 elif name == 'mmap-cache'
733 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
734 #if 1 /// additional elogind debug mode
735 elif name == 'elogind'
736 conf.set('ENABLE_DEBUG_ELOGIND', true)
739 message('unknown debug option "@0@", ignoring'.format(name))
744 #####################################################################
746 threads = dependency('threads')
747 librt = cc.find_library('rt')
748 libm = cc.find_library('m')
749 libdl = cc.find_library('dl')
750 libcrypt = cc.find_library('crypt')
752 libcap = dependency('libcap', required : false)
753 if not libcap.found()
754 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
755 libcap = cc.find_library('cap')
758 #if 0 /// UNNEEDED by elogind
759 # libmount = dependency('mount',
760 # version : '>= 2.27')
762 # want_seccomp = get_option('seccomp')
763 # if want_seccomp != 'false'
764 # libseccomp = dependency('libseccomp',
765 # version : '>= 2.3.1',
766 # required : want_seccomp == 'true')
767 # if libseccomp.found()
768 # conf.set('HAVE_SECCOMP', true)
769 # m4_defines += ['-DHAVE_SECCOMP']
778 want_selinux = get_option('selinux')
779 if want_selinux != 'false'
780 libselinux = dependency('libselinux',
781 version : '>= 2.1.9',
782 required : want_selinux == 'true')
783 if libselinux.found()
784 conf.set('HAVE_SELINUX', true)
785 m4_defines += ['-DHAVE_SELINUX']
791 #if 0 /// UNNEEDED by elogind
792 # want_apparmor = get_option('apparmor')
793 # if want_apparmor != 'false'
794 # libapparmor = dependency('libapparmor',
795 # required : want_apparmor == 'true')
796 # if libapparmor.found()
797 # conf.set('HAVE_APPARMOR', true)
798 # m4_defines += ['-DHAVE_APPARMOR']
807 smack_run_label = get_option('smack-run-label')
808 if smack_run_label != ''
809 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
810 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
813 want_polkit = get_option('polkit')
814 install_polkit = false
815 install_polkit_pkla = false
816 if want_polkit != 'false'
817 conf.set('ENABLE_POLKIT', true)
818 install_polkit = true
820 libpolkit = dependency('polkit-gobject-1',
822 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
823 message('Old polkit detected, will install pkla files')
824 install_polkit_pkla = true
828 want_acl = get_option('acl')
829 if want_acl != 'false'
830 libacl = cc.find_library('acl', required : want_acl == 'true')
832 conf.set('HAVE_ACL', true)
833 m4_defines += ['-DHAVE_ACL']
839 want_audit = get_option('audit')
840 if want_audit != 'false'
841 libaudit = dependency('audit', required : want_audit == 'true')
842 conf.set('HAVE_AUDIT', libaudit.found())
847 #if 0 /// UNNEEDED by elogind
848 # want_blkid = get_option('blkid')
849 # if want_blkid != 'false'
850 # libblkid = dependency('blkid', required : want_blkid == 'true')
851 # conf.set('HAVE_BLKID', libblkid.found())
856 # want_kmod = get_option('kmod')
857 # if want_kmod != 'false'
858 # libkmod = dependency('libkmod',
860 # required : want_kmod == 'true')
861 # conf.set('HAVE_KMOD', libkmod.found())
870 want_pam = get_option('pam')
871 if want_pam != 'false'
872 libpam = cc.find_library('pam', required : want_pam == 'true')
873 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
874 if libpam.found() and libpam_misc.found()
875 conf.set('HAVE_PAM', true)
876 m4_defines += ['-DHAVE_PAM']
883 #if 0 /// UNNEEDED by elogind
884 # want_microhttpd = get_option('microhttpd')
885 # if want_microhttpd != 'false'
886 # libmicrohttpd = dependency('libmicrohttpd',
887 # version : '>= 0.9.33',
888 # required : want_microhttpd == 'true')
889 # if libmicrohttpd.found()
890 # conf.set('HAVE_MICROHTTPD', true)
891 # m4_defines += ['-DHAVE_MICROHTTPD']
897 # want_libcryptsetup = get_option('libcryptsetup')
898 # if want_libcryptsetup != 'false'
899 # libcryptsetup = dependency('libcryptsetup',
900 # version : '>= 1.6.0',
901 # required : want_libcryptsetup == 'true')
902 # conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
907 # want_libcurl = get_option('libcurl')
908 # if want_libcurl != 'false'
909 # libcurl = dependency('libcurl',
910 # version : '>= 7.32.0',
911 # required : want_libcurl == 'true')
913 # conf.set('HAVE_LIBCURL', true)
914 # m4_defines += ['-DHAVE_LIBCURL']
920 # want_libidn = get_option('libidn')
921 # want_libidn2 = get_option('libidn2')
922 # if want_libidn == 'true' and want_libidn2 == 'true'
923 # error('libidn and libidn2 cannot be requested simultaneously')
926 # if want_libidn != 'false' and want_libidn2 != 'true'
927 # libidn = dependency('libidn',
928 # required : want_libidn == 'true')
930 # conf.set('HAVE_LIBIDN', true)
931 # m4_defines += ['-DHAVE_LIBIDN']
936 # if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
937 # # libidn is used for both libidn and libidn2 objects
938 # libidn = dependency('libidn2',
939 # required : want_libidn2 == 'true')
941 # conf.set('HAVE_LIBIDN2', true)
942 # m4_defines += ['-DHAVE_LIBIDN2']
946 # want_libiptc = get_option('libiptc')
947 # if want_libiptc != 'false'
948 # libiptc = dependency('libiptc',
949 # required : want_libiptc == 'true')
951 # conf.set('HAVE_LIBIPTC', true)
952 # m4_defines += ['-DHAVE_LIBIPTC']
958 # want_qrencode = get_option('qrencode')
959 # if want_qrencode != 'false'
960 # libqrencode = dependency('libqrencode',
961 # required : want_qrencode == 'true')
962 # conf.set('HAVE_QRENCODE', libqrencode.found())
967 # want_gcrypt = get_option('gcrypt')
968 # if want_gcrypt != 'false'
969 # libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
970 # libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
972 # have_deps = libgcrypt.found() and libgpg_error.found()
973 # conf.set('HAVE_GCRYPT', have_deps)
975 # # link to neither of the libs if one is not found
984 # want_gnutls = get_option('gnutls')
985 # if want_gnutls != 'false'
986 # libgnutls = dependency('gnutls',
987 # version : '>= 3.1.4',
988 # required : want_gnutls == 'true')
989 # conf.set('HAVE_GNUTLS', libgnutls.found())
994 # want_elfutils = get_option('elfutils')
995 # if want_elfutils != 'false'
996 # libdw = dependency('libdw',
997 # required : want_elfutils == 'true')
998 # conf.set('HAVE_ELFUTILS', libdw.found())
1003 # want_zlib = get_option('zlib')
1004 # if want_zlib != 'false'
1005 # libz = dependency('zlib',
1006 # required : want_zlib == 'true')
1007 # conf.set('HAVE_ZLIB', libz.found())
1012 # want_bzip2 = get_option('bzip2')
1013 # if want_bzip2 != 'false'
1014 # libbzip2 = cc.find_library('bz2',
1015 # required : want_bzip2 == 'true')
1016 # conf.set('HAVE_BZIP2', libbzip2.found())
1021 # want_xz = get_option('xz')
1022 # if want_xz != 'false'
1023 # libxz = dependency('liblzma',
1024 # required : want_xz == 'true')
1025 # conf.set('HAVE_XZ', libxz.found())
1030 # want_lz4 = get_option('lz4')
1031 # if want_lz4 != 'false'
1032 # liblz4 = dependency('liblz4',
1033 # required : want_lz4 == 'true')
1034 # conf.set('HAVE_LZ4', liblz4.found())
1039 # want_xkbcommon = get_option('xkbcommon')
1040 # if want_xkbcommon != 'false'
1041 # libxkbcommon = dependency('xkbcommon',
1042 # version : '>= 0.3.0',
1043 # required : want_xkbcommon == 'true')
1044 # conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
1066 want_glib = get_option('glib')
1067 if want_glib != 'false'
1068 libglib = dependency('glib-2.0',
1069 version : '>= 2.22.0',
1070 required : want_glib == 'true')
1071 libgobject = dependency('gobject-2.0',
1072 version : '>= 2.22.0',
1073 required : want_glib == 'true')
1074 libgio = dependency('gio-2.0',
1075 required : want_glib == 'true')
1076 have = libglib.found() and libgobject.found() and libgio.found()
1077 conf.set('HAVE_GLIB', have)
1084 want_dbus = get_option('dbus')
1085 if want_dbus != 'false'
1086 libdbus = dependency('dbus-1',
1087 version : '>= 1.3.2',
1088 required : want_dbus == 'true')
1089 conf.set('HAVE_DBUS', libdbus.found())
1094 #if 0 /// UNNEEDED by elogind
1095 # default_dnssec = get_option('default-dnssec')
1096 # if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
1097 # message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1098 # default_dnssec = 'no'
1100 # conf.set('DEFAULT_DNSSEC_MODE',
1101 # 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1102 # substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1104 # want_importd = get_option('importd')
1105 # if want_importd != 'false'
1106 # have_deps = (conf.get('HAVE_LIBCURL', false) and
1107 # conf.get('HAVE_ZLIB', false) and
1108 # conf.get('HAVE_BZIP2', false) and
1109 # conf.get('HAVE_XZ', false) and
1110 # conf.get('HAVE_GCRYPT', false))
1111 # conf.set('ENABLE_IMPORTD', have_deps)
1112 # if want_importd == 'true' and not have_deps
1113 # error('importd support was requested, but dependencies are not available')
1117 # want_remote = get_option('remote')
1118 # if want_remote != 'false'
1119 # have_deps = [conf.get('HAVE_MICROHTTPD', false),
1120 # conf.get('HAVE_LIBCURL', false)]
1121 # # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1122 # # it's possible to build one without the other. Complain only if
1123 # # support was explictly requested. The auxiliary files like sysusers
1124 # # config should be installed when any of the programs are built.
1125 # if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1126 # error('remote support was requested, but dependencies are not available')
1128 # conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
1132 foreach pair : [['utmp', 'HAVE_UTMP'],
1133 #if 0 /// UNNEEDED by elogind
1134 # ['hibernate', 'ENABLE_HIBERNATE'],
1135 # ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1136 # ['binfmt', 'ENABLE_BINFMT'],
1137 # ['coredump', 'ENABLE_COREDUMP'],
1138 # ['resolve', 'ENABLE_RESOLVED'],
1139 # ['logind', 'ENABLE_LOGIND'],
1140 # ['hostnamed', 'ENABLE_HOSTNAMED'],
1141 # ['localed', 'ENABLE_LOCALED'],
1142 # ['machined', 'ENABLE_MACHINED'],
1143 # ['networkd', 'ENABLE_NETWORKD'],
1144 # ['timedated', 'ENABLE_TIMEDATED'],
1145 # ['timesyncd', 'ENABLE_TIMESYNCD'],
1146 # ['myhostname', 'HAVE_MYHOSTNAME'],
1147 # ['firstboot', 'ENABLE_FIRSTBOOT'],
1148 # ['randomseed', 'ENABLE_RANDOMSEED'],
1149 # ['backlight', 'ENABLE_BACKLIGHT'],
1150 # ['vconsole', 'ENABLE_VCONSOLE'],
1151 # ['quotacheck', 'ENABLE_QUOTACHECK'],
1152 # ['sysusers', 'ENABLE_SYSUSERS'],
1153 # ['tmpfiles', 'ENABLE_TMPFILES'],
1154 # ['hwdb', 'ENABLE_HWDB'],
1155 # ['rfkill', 'ENABLE_RFKILL'],
1156 # ['ldconfig', 'ENABLE_LDCONFIG'],
1157 # ['efi', 'ENABLE_EFI'],
1158 # ['tpm', 'ENABLE_TPM'],
1159 # ['ima', 'HAVE_IMA'],
1161 ['smack', 'HAVE_SMACK'],
1162 #if 0 /// UNNEEDED by elogind
1163 # ['gshadow', 'ENABLE_GSHADOW'],
1164 # ['idn', 'ENABLE_IDN'],
1165 # ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
1169 if get_option(pair[0])
1170 conf.set(pair[1], true)
1171 m4_defines += ['-D' + pair[1]]
1175 want_tests = get_option('tests')
1176 install_tests = get_option('install-tests')
1179 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1181 #####################################################################
1183 #if 0 /// UNNEEDED by elogind
1184 # if get_option('efi')
1185 # efi_arch = host_machine.cpu_family()
1187 # if efi_arch == 'x86'
1188 # EFI_MACHINE_TYPE_NAME = 'ia32'
1189 # gnu_efi_arch = 'ia32'
1190 # elif efi_arch == 'x86_64'
1191 # EFI_MACHINE_TYPE_NAME = 'x64'
1192 # gnu_efi_arch = 'x86_64'
1193 # elif efi_arch == 'arm'
1194 # EFI_MACHINE_TYPE_NAME = 'arm'
1195 # gnu_efi_arch = 'arm'
1196 # elif efi_arch == 'aarch64'
1197 # EFI_MACHINE_TYPE_NAME = 'aa64'
1198 # gnu_efi_arch = 'aarch64'
1200 # EFI_MACHINE_TYPE_NAME = ''
1204 # conf.set('ENABLE_EFI', true)
1205 # conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1207 # conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1211 #####################################################################
1213 config_h = configure_file(
1214 output : 'config.h',
1215 configuration : conf)
1217 includes = include_directories('src/basic',
1220 #if 0 /// UNNEEDED by elogind
1226 #if 0 /// UNNEEDED by elogind
1231 #if 0 /// elogind has a different list
1232 # 'src/libsystemd/sd-bus',
1233 # 'src/libsystemd/sd-device',
1234 # 'src/libsystemd/sd-hwdb',
1235 # 'src/libsystemd/sd-id128',
1236 # 'src/libsystemd/sd-netlink',
1237 # 'src/libsystemd/sd-network',
1238 # 'src/libsystemd-network',
1240 'src/libelogind/sd-bus',
1241 'src/libelogind/sd-id128',
1247 add_project_arguments('-include', 'config.h', language : 'c')
1249 #if 0 /// UNNEEDED by elogind
1250 # gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1251 # 'src/shared/gcrypt-util.c')
1255 #if 0 /// UNNEEDED by elogind
1258 subdir('src/systemd')
1260 #if 0 /// UNNEEDED by elogind
1261 # subdir('src/libsystemd')
1262 # subdir('src/libsystemd-network')
1263 # subdir('src/journal')
1266 subdir('src/libelogind')
1268 subdir('src/update-utmp')
1272 #if 0 /// UNNEEDED by elogind
1273 # libjournal_core = static_library(
1275 # libjournal_core_sources,
1277 # include_directories : includes,
1280 # libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1281 # libsystemd = shared_library(
1283 # libsystemd_internal_sources,
1284 # journal_internal_sources,
1285 # version : '0.19.0',
1286 # include_directories : includes,
1287 # link_args : ['-shared',
1288 # '-Wl,--version-script=' + libsystemd_sym_path],
1289 # link_with : [libbasic],
1290 # dependencies : [threads,
1295 # link_depends : libsystemd_sym,
1297 # install_dir : rootlibdir)
1299 libelogind_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libelogind_sym)
1300 libelogind = shared_library(
1302 libelogind_internal_sources,
1304 include_directories : includes,
1305 link_args : ['-shared',
1306 '-Wl,--version-script=' + libelogind_sym_path],
1307 link_with : [libbasic],
1308 dependencies : [threads],
1309 link_depends : libelogind_sym,
1311 install_dir : rootlibdir)
1314 ############################################################
1316 # binaries that have --help and are intended for use by humans,
1317 # usually, but not always, installed in /bin.
1318 public_programs = []
1320 #if 0 /// UNNEEDED by elogind
1321 # subdir('src/libudev')
1323 # elogind depends on external libudev:
1324 libudev = dependency('libudev', required : true)
1326 subdir('src/shared')
1327 #if 0 /// UNNEEDED by elogind
1328 # subdir('src/core')
1329 # subdir('src/udev')
1330 # subdir('src/network')
1332 # subdir('src/analyze')
1333 # subdir('src/journal-remote')
1334 # subdir('src/coredump')
1335 # subdir('src/hostname')
1336 # subdir('src/import')
1337 # subdir('src/kernel-install')
1338 # subdir('src/locale')
1339 # subdir('src/machine')
1340 # subdir('src/nspawn')
1341 # subdir('src/resolve')
1342 # subdir('src/timedate')
1343 # subdir('src/timesync')
1344 # subdir('src/vconsole')
1345 # subdir('src/sulogin-shell')
1346 # subdir('src/boot/efi')
1350 #if 0 /// UNNEEDED in elogind
1354 ############################################################
1356 # only static linking apart from libdl, to make sure that the
1357 # module is linked to all libraries that it uses.
1358 #if 0 /// UNNEEDED by elogind
1359 # test_dlopen = executable(
1362 # include_directories : includes,
1363 # link_with : [libbasic],
1364 # dependencies : [libdl])
1366 # foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
1367 # ['systemd', 'ENABLE_NSS_SYSTEMD'],
1368 # ['mymachines', 'ENABLE_MACHINED'],
1369 # ['resolve', 'ENABLE_RESOLVED']]
1371 # condition = tuple[1] == '' or conf.get(tuple[1], false)
1375 # sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1376 # version_script_arg = join_paths(meson.current_source_dir(), sym)
1378 # nss = shared_library(
1380 # 'src/nss-@0@/nss-@0@.c'.format(module),
1382 # include_directories : includes,
1383 # link_args : ['-shared',
1384 # '-Wl,--version-script=' + version_script_arg,
1385 # '-Wl,--undefined'],
1386 # link_with : [libsystemd_internal,
1388 # dependencies : [threads,
1390 # link_depends : sym,
1392 # install_dir : rootlibdir)
1394 # # We cannot use shared_module because it does not support version suffix.
1395 # # Unfortunately shared_library insists on creating the symlink…
1396 # meson.add_install_script('sh', '-c',
1397 # 'rm $DESTDIR@0@/libnss_@1@.so'
1398 # .format(rootlibdir, module))
1400 # test('dlopen-nss_' + module,
1402 # args : [nss.full_path()]) # path to dlopen must include a slash
1407 ############################################################
1409 #if 0 /// UNNEEDED by elogind
1410 # executable('systemd',
1412 # include_directories : includes,
1413 # link_with : [libcore,
1415 # dependencies : [threads,
1421 # install_rpath : rootlibexecdir,
1423 # install_dir : rootlibexecdir)
1425 # exe = executable('systemd-analyze',
1426 # systemd_analyze_sources,
1427 # include_directories : includes,
1428 # link_with : [libcore,
1430 # dependencies : [threads,
1436 # install_rpath : rootlibexecdir,
1438 # public_programs += [exe]
1440 # executable('systemd-journald',
1441 # systemd_journald_sources,
1442 # include_directories : includes,
1443 # link_with : [libjournal_core,
1445 # dependencies : [threads,
1449 # install_rpath : rootlibexecdir,
1451 # install_dir : rootlibexecdir)
1453 # exe = executable('systemd-cat',
1454 # systemd_cat_sources,
1455 # include_directories : includes,
1456 # link_with : [libjournal_core,
1458 # dependencies : [threads],
1459 # install_rpath : rootlibexecdir,
1461 # public_programs += [exe]
1463 # exe = executable('journalctl',
1464 # journalctl_sources,
1465 # include_directories : includes,
1466 # link_with : [libshared],
1467 # dependencies : [threads,
1471 # install_rpath : rootlibexecdir,
1473 # install_dir : rootbindir)
1474 # public_programs += [exe]
1476 # executable('systemd-getty-generator',
1477 # 'src/getty-generator/getty-generator.c',
1478 # include_directories : includes,
1479 # link_with : [libshared],
1480 # install_rpath : rootlibexecdir,
1482 # install_dir : systemgeneratordir)
1484 # executable('systemd-debug-generator',
1485 # 'src/debug-generator/debug-generator.c',
1486 # include_directories : includes,
1487 # link_with : [libshared],
1488 # install_rpath : rootlibexecdir,
1490 # install_dir : systemgeneratordir)
1492 # executable('systemd-fstab-generator',
1493 # 'src/fstab-generator/fstab-generator.c',
1494 # 'src/core/mount-setup.c',
1495 # include_directories : includes,
1496 # link_with : [libshared],
1497 # install_rpath : rootlibexecdir,
1499 # install_dir : systemgeneratordir)
1501 # if conf.get('ENABLE_ENVIRONMENT_D', false)
1502 # executable('30-systemd-environment-d-generator',
1503 # 'src/environment-d-generator/environment-d-generator.c',
1504 # include_directories : includes,
1505 # link_with : [libshared],
1506 # install_rpath : rootlibexecdir,
1508 # install_dir : userenvgeneratordir)
1510 # meson.add_install_script(meson_make_symlink,
1511 # join_paths(sysconfdir, 'environment'),
1512 # join_paths(environmentdir, '99-environment.conf'))
1515 # if conf.get('ENABLE_HIBERNATE', false)
1516 # executable('systemd-hibernate-resume-generator',
1517 # 'src/hibernate-resume/hibernate-resume-generator.c',
1518 # include_directories : includes,
1519 # link_with : [libshared],
1520 # install_rpath : rootlibexecdir,
1522 # install_dir : systemgeneratordir)
1524 # executable('systemd-hibernate-resume',
1525 # 'src/hibernate-resume/hibernate-resume.c',
1526 # include_directories : includes,
1527 # link_with : [libshared],
1528 # install_rpath : rootlibexecdir,
1530 # install_dir : rootlibexecdir)
1533 # if conf.get('HAVE_BLKID', false)
1534 # executable('systemd-gpt-auto-generator',
1535 # 'src/gpt-auto-generator/gpt-auto-generator.c',
1536 # 'src/basic/blkid-util.h',
1537 # include_directories : includes,
1538 # link_with : [libshared],
1539 # dependencies : libblkid,
1540 # install_rpath : rootlibexecdir,
1542 # install_dir : systemgeneratordir)
1544 # exe = executable('systemd-dissect',
1545 # 'src/dissect/dissect.c',
1546 # include_directories : includes,
1547 # link_with : [libshared],
1548 # install_rpath : rootlibexecdir,
1550 # install_dir : rootlibexecdir)
1551 # public_programs += [exe]
1554 # if conf.get('ENABLE_RESOLVED', false)
1555 # executable('systemd-resolved',
1556 # systemd_resolved_sources,
1557 # gcrypt_util_sources,
1558 # include_directories : includes,
1559 # link_with : [libshared],
1560 # dependencies : [threads,
1565 # install_rpath : rootlibexecdir,
1567 # install_dir : rootlibexecdir)
1569 # exe = executable('systemd-resolve',
1570 # systemd_resolve_sources,
1571 # gcrypt_util_sources,
1572 # include_directories : includes,
1573 # link_with : [libshared],
1574 # dependencies : [threads,
1579 # install_rpath : rootlibexecdir,
1581 # public_programs += [exe]
1584 # if conf.get('ENABLE_LOGIND', false)
1585 # executable('systemd-logind',
1586 # systemd_logind_sources,
1587 # include_directories : includes,
1588 # link_with : [liblogind_core,
1590 # dependencies : [threads,
1592 # install_rpath : rootlibexecdir,
1594 # install_dir : rootlibexecdir)
1596 # exe = executable('loginctl',
1598 # include_directories : includes,
1599 # link_with : [libshared],
1600 # dependencies : [threads,
1603 # install_rpath : rootlibexecdir,
1605 # install_dir : rootbindir)
1606 # public_programs += [exe]
1608 # exe = executable('systemd-inhibit',
1609 # 'src/login/inhibit.c',
1610 # include_directories : includes,
1611 # link_with : [libshared],
1612 # install_rpath : rootlibexecdir,
1614 # install_dir : rootbindir)
1615 # public_programs += [exe]
1617 # if conf.get('HAVE_PAM', false)
1618 # version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1619 # pam_systemd = shared_library(
1623 # include_directories : includes,
1624 # link_args : ['-shared',
1625 # '-Wl,--version-script=' + version_script_arg],
1626 # link_with : [libsystemd_internal,
1627 # libshared_static],
1628 # dependencies : [threads,
1631 # link_depends : pam_systemd_sym,
1633 # install_dir : pamlibdir)
1635 # test('dlopen-pam_systemd',
1637 # args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1642 executable('elogind',
1644 include_directories : includes,
1645 link_with : [liblogind_core,
1647 dependencies : [threads,
1650 install_rpath : rootlibexecdir,
1652 install_dir : rootlibexecdir)
1654 exe = executable('loginctl',
1656 include_directories : includes,
1657 link_with : [libshared],
1658 dependencies : [threads,
1660 install_rpath : rootlibexecdir,
1662 install_dir : rootbindir)
1663 public_programs += [exe]
1665 exe = executable('elogind-inhibit',
1666 'src/login/inhibit.c',
1667 include_directories : includes,
1668 link_with : [libshared],
1669 dependencies : [threads],
1670 install_rpath : rootlibexecdir,
1672 install_dir : rootbindir)
1673 public_programs += [exe]
1675 if conf.get('HAVE_PAM', false)
1676 version_script_arg = join_paths(meson.current_source_dir(), pam_elogind_sym)
1677 pam_elogind = shared_library(
1681 include_directories : includes,
1682 link_args : ['-shared',
1683 '-Wl,--version-script=' + version_script_arg],
1684 link_with : [libelogind,
1686 dependencies : [threads,
1689 link_depends : pam_elogind_sym,
1691 install_dir : pamlibdir)
1694 #if 0 /// UNNEEDED by elogind
1695 # executable('systemd-user-sessions',
1696 # 'src/user-sessions/user-sessions.c',
1697 # include_directories : includes,
1698 # link_with : [libshared],
1699 # install_rpath : rootlibexecdir,
1701 # install_dir : rootlibexecdir)
1704 # if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
1705 # exe = executable('bootctl',
1706 # 'src/boot/bootctl.c',
1707 # include_directories : includes,
1708 # link_with : [libshared],
1709 # dependencies : [libblkid],
1710 # install_rpath : rootlibexecdir,
1712 # public_programs += [exe]
1715 # exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1716 # include_directories : includes,
1717 # link_with : [libshared],
1718 # dependencies : [threads],
1719 # install_rpath : rootlibexecdir,
1721 # public_programs += [exe]
1723 # exe = executable('systemctl', 'src/systemctl/systemctl.c',
1724 # include_directories : includes,
1725 # link_with : [libshared],
1726 # dependencies : [threads,
1731 # install_rpath : rootlibexecdir,
1733 # install_dir : rootbindir)
1734 # public_programs += [exe]
1736 # if conf.get('ENABLE_BACKLIGHT', false)
1737 # executable('systemd-backlight',
1738 # 'src/backlight/backlight.c',
1739 # include_directories : includes,
1740 # link_with : [libshared],
1741 # install_rpath : rootlibexecdir,
1743 # install_dir : rootlibexecdir)
1746 # if conf.get('ENABLE_RFKILL', false)
1747 # executable('systemd-rfkill',
1748 # 'src/rfkill/rfkill.c',
1749 # include_directories : includes,
1750 # link_with : [libshared],
1751 # install_rpath : rootlibexecdir,
1753 # install_dir : rootlibexecdir)
1756 # executable('systemd-system-update-generator',
1757 # 'src/system-update-generator/system-update-generator.c',
1758 # include_directories : includes,
1759 # link_with : [libshared],
1760 # install_rpath : rootlibexecdir,
1762 # install_dir : systemgeneratordir)
1764 # if conf.get('HAVE_LIBCRYPTSETUP', false)
1765 # executable('systemd-cryptsetup',
1766 # 'src/cryptsetup/cryptsetup.c',
1767 # include_directories : includes,
1768 # link_with : [libshared],
1769 # dependencies : [libcryptsetup],
1770 # install_rpath : rootlibexecdir,
1772 # install_dir : rootlibexecdir)
1774 # executable('systemd-cryptsetup-generator',
1775 # 'src/cryptsetup/cryptsetup-generator.c',
1776 # include_directories : includes,
1777 # link_with : [libshared],
1778 # dependencies : [libcryptsetup],
1779 # install_rpath : rootlibexecdir,
1781 # install_dir : systemgeneratordir)
1783 # executable('systemd-veritysetup',
1784 # 'src/veritysetup/veritysetup.c',
1785 # include_directories : includes,
1786 # link_with : [libshared],
1787 # dependencies : [libcryptsetup],
1788 # install_rpath : rootlibexecdir,
1790 # install_dir : rootlibexecdir)
1792 # executable('systemd-veritysetup-generator',
1793 # 'src/veritysetup/veritysetup-generator.c',
1794 # include_directories : includes,
1795 # link_with : [libshared],
1796 # dependencies : [libcryptsetup],
1797 # install_rpath : rootlibexecdir,
1799 # install_dir : systemgeneratordir)
1802 # if conf.get('HAVE_SYSV_COMPAT', false)
1803 # executable('systemd-sysv-generator',
1804 # 'src/sysv-generator/sysv-generator.c',
1805 # include_directories : includes,
1806 # link_with : [libshared],
1807 # install_rpath : rootlibexecdir,
1809 # install_dir : systemgeneratordir)
1811 # executable('systemd-rc-local-generator',
1812 # 'src/rc-local-generator/rc-local-generator.c',
1813 # include_directories : includes,
1814 # link_with : [libshared],
1815 # install_rpath : rootlibexecdir,
1817 # install_dir : systemgeneratordir)
1820 # if conf.get('ENABLE_HOSTNAMED', false)
1821 # executable('systemd-hostnamed',
1822 # 'src/hostname/hostnamed.c',
1823 # include_directories : includes,
1824 # link_with : [libshared],
1825 # install_rpath : rootlibexecdir,
1827 # install_dir : rootlibexecdir)
1829 # exe = executable('hostnamectl',
1830 # 'src/hostname/hostnamectl.c',
1831 # include_directories : includes,
1832 # link_with : [libshared],
1833 # install_rpath : rootlibexecdir,
1835 # public_programs += [exe]
1838 # if conf.get('ENABLE_LOCALED', false)
1839 # if conf.get('HAVE_XKBCOMMON', false)
1840 # # logind will load libxkbcommon.so dynamically on its own
1846 # executable('systemd-localed',
1847 # systemd_localed_sources,
1848 # include_directories : includes,
1849 # link_with : [libshared],
1850 # dependencies : deps,
1851 # install_rpath : rootlibexecdir,
1853 # install_dir : rootlibexecdir)
1855 # exe = executable('localectl',
1856 # localectl_sources,
1857 # include_directories : includes,
1858 # link_with : [libshared],
1859 # install_rpath : rootlibexecdir,
1861 # public_programs += [exe]
1864 # if conf.get('ENABLE_TIMEDATED', false)
1865 # executable('systemd-timedated',
1866 # 'src/timedate/timedated.c',
1867 # include_directories : includes,
1868 # link_with : [libshared],
1869 # install_rpath : rootlibexecdir,
1871 # install_dir : rootlibexecdir)
1873 # exe = executable('timedatectl',
1874 # 'src/timedate/timedatectl.c',
1875 # include_directories : includes,
1876 # install_rpath : rootlibexecdir,
1877 # link_with : [libshared],
1879 # public_programs += [exe]
1882 # if conf.get('ENABLE_TIMESYNCD', false)
1883 # executable('systemd-timesyncd',
1884 # systemd_timesyncd_sources,
1885 # include_directories : includes,
1886 # link_with : [libshared],
1887 # dependencies : [threads,
1889 # install_rpath : rootlibexecdir,
1891 # install_dir : rootlibexecdir)
1894 # if conf.get('ENABLE_MACHINED', false)
1895 # executable('systemd-machined',
1896 # systemd_machined_sources,
1897 # include_directories : includes,
1898 # link_with : [libmachine_core,
1900 # install_rpath : rootlibexecdir,
1902 # install_dir : rootlibexecdir)
1904 # exe = executable('machinectl',
1905 # 'src/machine/machinectl.c',
1906 # include_directories : includes,
1907 # link_with : [libshared],
1908 # dependencies : [threads,
1911 # install_rpath : rootlibexecdir,
1913 # install_dir : rootbindir)
1914 # public_programs += [exe]
1917 # if conf.get('ENABLE_IMPORTD', false)
1918 # executable('systemd-importd',
1919 # systemd_importd_sources,
1920 # include_directories : includes,
1921 # link_with : [libshared],
1922 # dependencies : [threads],
1923 # install_rpath : rootlibexecdir,
1925 # install_dir : rootlibexecdir)
1927 # systemd_pull = executable('systemd-pull',
1928 # systemd_pull_sources,
1929 # include_directories : includes,
1930 # link_with : [libshared],
1931 # dependencies : [libcurl,
1936 # install_rpath : rootlibexecdir,
1938 # install_dir : rootlibexecdir)
1940 # systemd_import = executable('systemd-import',
1941 # systemd_import_sources,
1942 # include_directories : includes,
1943 # link_with : [libshared],
1944 # dependencies : [libcurl,
1948 # install_rpath : rootlibexecdir,
1950 # install_dir : rootlibexecdir)
1952 # systemd_export = executable('systemd-export',
1953 # systemd_export_sources,
1954 # include_directories : includes,
1955 # link_with : [libshared],
1956 # dependencies : [libcurl,
1960 # install_rpath : rootlibexecdir,
1962 # install_dir : rootlibexecdir)
1963 # public_programs += [systemd_pull, systemd_import, systemd_export]
1966 # if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
1967 # exe = executable('systemd-journal-upload',
1968 # systemd_journal_upload_sources,
1969 # include_directories : includes,
1970 # link_with : [libshared],
1971 # dependencies : [threads,
1976 # install_rpath : rootlibexecdir,
1978 # install_dir : rootlibexecdir)
1979 # public_programs += [exe]
1982 # if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
1983 # s_j_remote = executable('systemd-journal-remote',
1984 # systemd_journal_remote_sources,
1985 # include_directories : includes,
1986 # link_with : [libshared],
1987 # dependencies : [threads,
1992 # install_rpath : rootlibexecdir,
1994 # install_dir : rootlibexecdir)
1996 # s_j_gatewayd = executable('systemd-journal-gatewayd',
1997 # systemd_journal_gatewayd_sources,
1998 # include_directories : includes,
1999 # link_with : [libshared],
2000 # dependencies : [threads,
2005 # install_rpath : rootlibexecdir,
2007 # install_dir : rootlibexecdir)
2008 # public_programs += [s_j_remote, s_j_gatewayd]
2011 # if conf.get('ENABLE_COREDUMP', false)
2012 # executable('systemd-coredump',
2013 # systemd_coredump_sources,
2014 # include_directories : includes,
2015 # link_with : [libshared],
2016 # dependencies : [threads,
2021 # install_rpath : rootlibexecdir,
2023 # install_dir : rootlibexecdir)
2025 # exe = executable('coredumpctl',
2026 # coredumpctl_sources,
2027 # include_directories : includes,
2028 # link_with : [libshared],
2029 # dependencies : [threads,
2032 # install_rpath : rootlibexecdir,
2034 # public_programs += [exe]
2037 # if conf.get('ENABLE_BINFMT', false)
2038 # exe = executable('systemd-binfmt',
2039 # 'src/binfmt/binfmt.c',
2040 # include_directories : includes,
2041 # link_with : [libshared],
2042 # install_rpath : rootlibexecdir,
2044 # install_dir : rootlibexecdir)
2045 # public_programs += [exe]
2047 # meson.add_install_script('sh', '-c',
2048 # mkdir_p.format(binfmtdir))
2049 # meson.add_install_script('sh', '-c',
2050 # mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2053 # if conf.get('ENABLE_VCONSOLE', false)
2054 # executable('systemd-vconsole-setup',
2055 # 'src/vconsole/vconsole-setup.c',
2056 # include_directories : includes,
2057 # link_with : [libshared],
2058 # install_rpath : rootlibexecdir,
2060 # install_dir : rootlibexecdir)
2063 # if conf.get('ENABLE_RANDOMSEED', false)
2064 # executable('systemd-random-seed',
2065 # 'src/random-seed/random-seed.c',
2066 # include_directories : includes,
2067 # link_with : [libshared],
2068 # install_rpath : rootlibexecdir,
2070 # install_dir : rootlibexecdir)
2073 # if conf.get('ENABLE_FIRSTBOOT', false)
2074 # executable('systemd-firstboot',
2075 # 'src/firstboot/firstboot.c',
2076 # include_directories : includes,
2077 # link_with : [libshared],
2078 # dependencies : [libcrypt],
2079 # install_rpath : rootlibexecdir,
2081 # install_dir : rootbindir)
2084 # executable('systemd-remount-fs',
2085 # 'src/remount-fs/remount-fs.c',
2086 # 'src/core/mount-setup.c',
2087 # 'src/core/mount-setup.h',
2088 # include_directories : includes,
2089 # link_with : [libshared],
2090 # install_rpath : rootlibexecdir,
2092 # install_dir : rootlibexecdir)
2094 # executable('systemd-machine-id-setup',
2095 # 'src/machine-id-setup/machine-id-setup-main.c',
2096 # 'src/core/machine-id-setup.c',
2097 # 'src/core/machine-id-setup.h',
2098 # include_directories : includes,
2099 # link_with : [libshared],
2100 # install_rpath : rootlibexecdir,
2102 # install_dir : rootbindir)
2104 # executable('systemd-fsck',
2105 # 'src/fsck/fsck.c',
2106 # include_directories : includes,
2107 # link_with : [libshared],
2108 # install_rpath : rootlibexecdir,
2110 # install_dir : rootlibexecdir)
2112 # executable('systemd-sleep',
2113 # 'src/sleep/sleep.c',
2114 # include_directories : includes,
2115 # link_with : [libshared],
2116 # install_rpath : rootlibexecdir,
2118 # install_dir : rootlibexecdir)
2120 # exe = executable('systemd-sysctl',
2121 # 'src/sysctl/sysctl.c',
2122 # include_directories : includes,
2123 # link_with : [libshared],
2124 # install_rpath : rootlibexecdir,
2126 # install_dir : rootlibexecdir)
2127 # public_programs += [exe]
2129 # executable('systemd-ac-power',
2130 # 'src/ac-power/ac-power.c',
2131 # include_directories : includes,
2132 # link_with : [libshared],
2133 # install_rpath : rootlibexecdir,
2135 # install_dir : rootlibexecdir)
2137 # exe = executable('systemd-detect-virt',
2138 # 'src/detect-virt/detect-virt.c',
2139 # include_directories : includes,
2140 # link_with : [libshared],
2141 # install_rpath : rootlibexecdir,
2143 # public_programs += [exe]
2145 # exe = executable('systemd-delta',
2146 # 'src/delta/delta.c',
2147 # include_directories : includes,
2148 # link_with : [libshared],
2149 # install_rpath : rootlibexecdir,
2151 # public_programs += [exe]
2153 # exe = executable('systemd-escape',
2154 # 'src/escape/escape.c',
2155 # include_directories : includes,
2156 # link_with : [libshared],
2157 # install_rpath : rootlibexecdir,
2159 # install_dir : rootbindir)
2160 # public_programs += [exe]
2162 # exe = executable('systemd-notify',
2163 # 'src/notify/notify.c',
2164 # include_directories : includes,
2165 # link_with : [libshared],
2166 # install_rpath : rootlibexecdir,
2168 # install_dir : rootbindir)
2169 # public_programs += [exe]
2171 # executable('systemd-volatile-root',
2172 # 'src/volatile-root/volatile-root.c',
2173 # include_directories : includes,
2174 # link_with : [libshared],
2175 # install_rpath : rootlibexecdir,
2177 # install_dir : rootlibexecdir)
2179 # executable('systemd-cgroups-agent',
2180 # 'src/cgroups-agent/cgroups-agent.c',
2181 # include_directories : includes,
2182 # link_with : [libshared],
2183 # install_rpath : rootlibexecdir,
2185 # install_dir : rootlibexecdir)
2187 executable('elogind-cgroups-agent',
2188 'src/cgroups-agent/cgroups-agent.c',
2189 include_directories : includes,
2190 link_with : [libshared_static],
2191 install_rpath : rootlibexecdir,
2193 install_dir : rootlibexecdir)
2196 #if 0 /// UNNEEDED by elogind
2197 # exe = executable('systemd-path',
2198 # 'src/path/path.c',
2199 # include_directories : includes,
2200 # link_with : [libshared],
2201 # install_rpath : rootlibexecdir,
2203 # public_programs += [exe]
2205 # exe = executable('systemd-ask-password',
2206 # 'src/ask-password/ask-password.c',
2207 # include_directories : includes,
2208 # link_with : [libshared],
2209 # install_rpath : rootlibexecdir,
2211 # install_dir : rootbindir)
2212 # public_programs += [exe]
2214 # executable('systemd-reply-password',
2215 # 'src/reply-password/reply-password.c',
2216 # include_directories : includes,
2217 # link_with : [libshared],
2218 # install_rpath : rootlibexecdir,
2220 # install_dir : rootlibexecdir)
2222 # exe = executable('systemd-tty-ask-password-agent',
2223 # 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2224 # include_directories : includes,
2225 # link_with : [libshared],
2226 # install_rpath : rootlibexecdir,
2228 # install_dir : rootbindir)
2229 # public_programs += [exe]
2231 # exe = executable('systemd-cgls',
2232 # 'src/cgls/cgls.c',
2233 # include_directories : includes,
2234 # link_with : [libshared],
2235 # install_rpath : rootlibexecdir,
2237 # public_programs += [exe]
2239 # exe = executable('systemd-cgtop',
2240 # 'src/cgtop/cgtop.c',
2241 # include_directories : includes,
2242 # link_with : [libshared],
2243 # install_rpath : rootlibexecdir,
2245 # public_programs += [exe]
2247 # executable('systemd-initctl',
2248 # 'src/initctl/initctl.c',
2249 # include_directories : includes,
2250 # link_with : [libshared],
2251 # install_rpath : rootlibexecdir,
2253 # install_dir : rootlibexecdir)
2255 # exe = executable('systemd-mount',
2256 # 'src/mount/mount-tool.c',
2257 # include_directories : includes,
2258 # link_with : [libshared],
2259 # install_rpath : rootlibexecdir,
2261 # public_programs += [exe]
2263 # meson.add_install_script(meson_make_symlink,
2264 # 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2266 # exe = executable('systemd-run',
2268 # include_directories : includes,
2269 # link_with : [libshared],
2270 # install_rpath : rootlibexecdir,
2272 # public_programs += [exe]
2274 # exe = executable('systemd-stdio-bridge',
2275 # 'src/stdio-bridge/stdio-bridge.c',
2276 # include_directories : includes,
2277 # link_with : [libshared],
2278 # install_rpath : rootlibexecdir,
2280 # public_programs += [exe]
2282 # exe = executable('busctl',
2283 # 'src/busctl/busctl.c',
2284 # 'src/busctl/busctl-introspect.c',
2285 # 'src/busctl/busctl-introspect.h',
2286 # include_directories : includes,
2287 # link_with : [libshared],
2288 # install_rpath : rootlibexecdir,
2290 # public_programs += [exe]
2292 # if conf.get('ENABLE_SYSUSERS', false)
2293 # exe = executable('systemd-sysusers',
2294 # 'src/sysusers/sysusers.c',
2295 # include_directories : includes,
2296 # link_with : [libshared],
2297 # install_rpath : rootlibexecdir,
2299 # install_dir : rootbindir)
2300 # public_programs += [exe]
2303 # if conf.get('ENABLE_TMPFILES', false)
2304 # exe = executable('systemd-tmpfiles',
2305 # 'src/tmpfiles/tmpfiles.c',
2306 # include_directories : includes,
2307 # link_with : [libshared],
2308 # dependencies : [libacl],
2309 # install_rpath : rootlibexecdir,
2311 # install_dir : rootbindir)
2312 # public_programs += [exe]
2315 # if conf.get('ENABLE_HWDB', false)
2316 # exe = executable('systemd-hwdb',
2317 # 'src/hwdb/hwdb.c',
2318 # 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2319 # include_directories : includes,
2320 # link_with : [libudev_internal],
2321 # install_rpath : udev_rpath,
2323 # install_dir : rootbindir)
2324 # public_programs += [exe]
2327 # if conf.get('ENABLE_QUOTACHECK', false)
2328 # executable('systemd-quotacheck',
2329 # 'src/quotacheck/quotacheck.c',
2330 # include_directories : includes,
2331 # link_with : [libshared],
2332 # install_rpath : rootlibexecdir,
2334 # install_dir : rootlibexecdir)
2337 # exe = executable('systemd-socket-proxyd',
2338 # 'src/socket-proxy/socket-proxyd.c',
2339 # include_directories : includes,
2340 # link_with : [libshared],
2341 # dependencies : [threads],
2342 # install_rpath : rootlibexecdir,
2344 # install_dir : rootlibexecdir)
2345 # public_programs += [exe]
2347 # exe = executable('systemd-udevd',
2348 # systemd_udevd_sources,
2349 # include_directories : includes,
2350 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2351 # link_with : [libudev_core,
2352 # libsystemd_network,
2353 # libudev_internal],
2354 # dependencies : [threads,
2359 # install_rpath : udev_rpath,
2361 # install_dir : rootlibexecdir)
2362 # public_programs += [exe]
2364 # exe = executable('udevadm',
2366 # include_directories : includes,
2367 # link_with : [libudev_core,
2368 # libsystemd_network,
2369 # libudev_internal],
2370 # dependencies : [threads,
2375 # install_rpath : udev_rpath,
2377 # install_dir : rootbindir)
2378 # public_programs += [exe]
2380 # executable('systemd-shutdown',
2381 # systemd_shutdown_sources,
2382 # include_directories : includes,
2383 # link_with : [libshared],
2384 # install_rpath : rootlibexecdir,
2386 # install_dir : rootlibexecdir)
2388 # executable('systemd-update-done',
2389 # 'src/update-done/update-done.c',
2390 # include_directories : includes,
2391 # link_with : [libshared],
2392 # install_rpath : rootlibexecdir,
2394 # install_dir : rootlibexecdir)
2396 # executable('systemd-update-utmp',
2397 # 'src/update-utmp/update-utmp.c',
2398 # include_directories : includes,
2399 # link_with : [libshared],
2400 # dependencies : [libaudit],
2401 # install_rpath : rootlibexecdir,
2403 # install_dir : rootlibexecdir)
2405 # if conf.get('HAVE_KMOD', false)
2406 # executable('systemd-modules-load',
2407 # 'src/modules-load/modules-load.c',
2408 # include_directories : includes,
2409 # link_with : [libshared],
2410 # dependencies : [libkmod],
2411 # install_rpath : rootlibexecdir,
2413 # install_dir : rootlibexecdir)
2415 # meson.add_install_script('sh', '-c',
2416 # mkdir_p.format(modulesloaddir))
2417 # meson.add_install_script('sh', '-c',
2418 # mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2421 # exe = executable('systemd-nspawn',
2422 # systemd_nspawn_sources,
2423 # 'src/core/mount-setup.c', # FIXME: use a variable?
2424 # 'src/core/mount-setup.h',
2425 # 'src/core/loopback-setup.c',
2426 # 'src/core/loopback-setup.h',
2427 # include_directories : [includes, include_directories('src/nspawn')],
2428 # link_with : [libshared],
2429 # dependencies : [libacl,
2433 # install_rpath : rootlibexecdir,
2435 # public_programs += [exe]
2437 # if conf.get('ENABLE_NETWORKD', false)
2438 # executable('systemd-networkd',
2439 # systemd_networkd_sources,
2440 # include_directories : includes,
2441 # link_with : [libnetworkd_core,
2442 # libsystemd_network,
2445 # dependencies : [threads],
2446 # install_rpath : rootlibexecdir,
2448 # install_dir : rootlibexecdir)
2450 # executable('systemd-networkd-wait-online',
2451 # systemd_networkd_wait_online_sources,
2452 # include_directories : includes,
2453 # link_with : [libnetworkd_core,
2455 # install_rpath : rootlibexecdir,
2457 # install_dir : rootlibexecdir)
2460 # exe = executable('networkctl',
2461 # networkctl_sources,
2462 # include_directories : includes,
2463 # link_with : [libsystemd_network,
2465 # install_rpath : rootlibexecdir,
2467 # install_dir : rootbindir)
2468 # public_programs += [exe]
2471 ############################################################
2473 foreach tuple : tests
2475 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2476 dependencies = tuple[2]
2477 condition = tuple.length() >= 4 ? tuple[3] : ''
2478 type = tuple.length() >= 5 ? tuple[4] : ''
2479 defs = tuple.length() >= 6 ? tuple[5] : []
2480 incs = tuple.length() >= 7 ? tuple[6] : includes
2483 name = sources[0].split('/')[-1].split('.')[0]
2484 if type.startswith('timeout=')
2485 timeout = type.split('=')[1].to_int()
2489 if condition == '' or conf.get(condition, false)
2493 include_directories : incs,
2494 link_with : link_with,
2495 dependencies : dependencies,
2497 install_rpath : rootlibexecdir,
2498 install : install_tests,
2499 install_dir : join_paths(testsdir, type))
2502 message('@0@ is a manual test'.format(name))
2503 elif type == 'unsafe' and want_tests != 'unsafe'
2504 message('@0@ is an unsafe test'.format(name))
2511 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2515 #if 0 /// UNNEEDED by elogind
2516 # test_libsystemd_sym = executable(
2517 # 'test-libsystemd-sym',
2518 # test_libsystemd_sym_c,
2519 # include_directories : includes,
2520 # link_with : [libsystemd],
2521 # install : install_tests,
2522 # install_dir : testsdir)
2523 # test('test-libsystemd-sym',
2524 # test_libsystemd_sym)
2526 # test_libudev_sym = executable(
2527 # 'test-libudev-sym',
2528 # test_libudev_sym_c,
2529 # include_directories : includes,
2530 # c_args : ['-Wno-deprecated-declarations'],
2531 # link_with : [libudev],
2532 # install : install_tests,
2533 # install_dir : testsdir)
2534 # test('test-libudev-sym',
2537 test_libelogind_sym = executable(
2538 'test-libelogind-sym',
2539 test_libelogind_sym_c,
2540 include_directories : includes,
2541 link_with : [libelogind],
2542 install : install_tests,
2543 install_dir : testsdir)
2544 test('test-libelogind-sym',
2545 test_libelogind_sym)
2548 ############################################################
2550 make_directive_index_py = find_program('tools/make-directive-index.py')
2551 make_man_index_py = find_program('tools/make-man-index.py')
2552 xml_helper_py = find_program('tools/xml_helper.py')
2553 #if 0 /// UNNEEDED by elogind
2554 # hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2557 # subdir('sysctl.d')
2558 # subdir('sysusers.d')
2559 # subdir('tmpfiles.d')
2565 subdir('shell-completion/bash')
2566 subdir('shell-completion/zsh')
2567 #if 0 /// UNNEEDED by elogind
2568 # subdir('docs/sysvinit')
2569 # subdir('docs/var-log')
2572 # FIXME: figure out if the warning is true:
2573 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2574 install_subdir('factory/etc',
2575 install_dir : factorydir)
2578 #if 0 /// UNNEEDED by elogind
2579 # install_data('xorg/50-systemd-user.sh',
2580 # install_dir : xinitrcdir)
2581 # install_data('system-preset/90-systemd.preset',
2582 # install_dir : systempresetdir)
2583 # install_data('modprobe.d/systemd.conf',
2584 # install_dir : modprobedir)
2586 install_data('README',
2589 #if 0 /// UNNEEDED by elogind
2595 'src/libelogind/sd-bus/GVARIANT-SERIALIZATION',
2596 install_dir : docdir)
2598 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2599 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2601 ############################################################
2603 meson_check_help = find_program('tools/meson-check-help.sh')
2605 foreach exec : public_programs
2606 name = exec.full_path().split('/')[-1]
2607 test('check-help-' + name,
2609 args : [exec.full_path()])
2612 ############################################################
2615 all_files = run_command(
2617 ['--git-dir=@0@/.git'.format(meson.source_root()),
2620 all_files = files(all_files.stdout().split())
2625 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
2629 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.source_root())] + all_files)
2633 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2636 command : [meson_git_contrib_sh])
2640 git_head = run_command(
2642 ['--git-dir=@0@/.git'.format(meson.source_root()),
2643 'rev-parse', 'HEAD']).stdout().strip()
2644 git_head_short = run_command(
2646 ['--git-dir=@0@/.git'.format(meson.source_root()),
2647 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2651 command : ['git', 'archive',
2652 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2654 '--prefix', 'systemd-@0@/'.format(git_head),
2658 ############################################################
2661 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2663 'prefix: @0@'.format(prefixdir),
2664 'rootprefix: @0@'.format(rootprefixdir),
2665 'sysconf dir: @0@'.format(sysconfdir),
2666 'includedir: @0@'.format(includedir),
2667 'lib dir: @0@'.format(libdir),
2668 'rootlib dir: @0@'.format(rootlibdir),
2669 #if 0 /// UNSUPPORTED by elogind
2670 # 'SysV init scripts: @0@'.format(sysvinit_path),
2671 # 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2673 'rootexeclib dir: @0@'.format(rootlibexecdir),
2675 'PAM modules dir: @0@'.format(pamlibdir),
2676 'PAM configuration dir: @0@'.format(pamconfdir),
2677 #if 0 /// UNSUPPORTED by elogind
2678 # 'RPM macros dir: @0@'.format(rpmmacrosdir),
2679 # 'modprobe.d dir: @0@'.format(modprobedir),
2681 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2682 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2683 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2684 'bash completions dir: @0@'.format(bashcompletiondir),
2685 'zsh completions dir: @0@'.format(zshcompletiondir),
2686 #if 0 /// UNSUPPORTED by elogind
2687 # 'extra start script: @0@'.format(get_option('rc-local')),
2688 # 'extra stop script: @0@'.format(get_option('halt-local')),
2689 # 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2690 # get_option('debug-tty')),
2692 'TTY GID: @0@'.format(tty_gid),
2693 'maximum system UID: @0@'.format(system_uid_max),
2694 'maximum system GID: @0@'.format(system_gid_max),
2695 #if 0 /// UNSUPPORTED by elogind
2696 # '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2697 # 'certificate root: @0@'.format(get_option('certificate-root')),
2698 # 'support URL: @0@'.format(support_url),
2699 # 'nobody user name: @0@'.format(get_option('nobody-user')),
2700 # 'nobody group name: @0@'.format(get_option('nobody-group')),
2701 # 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2702 # 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2704 # 'default DNSSEC mode: @0@'.format(default_dnssec),
2705 # 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2707 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2709 #if 0 /// UNSUPPORTED by elogind
2710 # alt_dns_servers = '\n '.join(dns_servers.split(' '))
2711 # alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2713 # 'default DNS servers: @0@'.format(alt_dns_servers),
2714 # 'default NTP servers: @0@'.format(alt_ntp_servers)]
2716 # alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2717 # '@@0@'.format(time_epoch)).stdout().strip()
2719 # 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2723 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2724 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2725 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2727 #if 0 /// UNNEEDED by elogind
2728 # if conf.get('ENABLE_EFI', false)
2730 # 'efi arch: @0@'.format(efi_arch)]
2734 # 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2735 # 'EFI CC @0@'.format(efi_cc),
2736 # 'EFI libdir: @0@'.format(efi_libdir),
2737 # 'EFI ldsdir: @0@'.format(efi_ldsdir),
2738 # 'EFI includedir: @0@'.format(efi_incdir)]
2747 #if 0 /// UNNEEDED by elogind
2748 # ['libcryptsetup'],
2752 #if 0 /// UNNEEDED by elogind
2757 #if 0 /// UNNEEDED by elogind
2761 #if 0 /// UNNEEDED by elogind
2768 #if 0 /// UNNEEDED by elogind
2784 # ['environment.d'],
2802 ['legacy pkla', install_polkit_pkla],
2803 #if 0 /// UNNEEDED by elogind
2805 # ['gnu-efi', have_gnu_efi],
2812 #if 0 /// UNNEEDED by elogind
2813 # ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
2817 ['man pages', want_man],
2818 ['html pages', want_html],
2819 ['man page indices', want_man and have_lxml],
2820 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
2821 #if 0 /// UNNEEDED by elogind
2825 #if 0 /// UNNEEDED by elogind
2828 # ['adm group', get_option('adm-group')],
2829 # ['wheel group', get_option('wheel-group')],
2835 ['debug mmap cache'],
2838 cond = tuple.get(1, '')
2840 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2841 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2842 cond = conf.get(ident1, false) or conf.get(ident2, false)
2847 missing += [tuple[0]]
2853 'enabled features: @0@'.format(', '.join(found)),
2855 'disabled features: @0@'.format(', '.join(missing)),
2857 message('\n '.join(status))