1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
5 # elogind is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
10 # elogind is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with elogind; If not, see <http://www.gnu.org/licenses/>.
18 project('elogind', 'c',
27 meson_version : '>= 0.41',
30 #if 0 /// UNNEEDED by elogind - libudev is external
31 # libsystemd_version = '0.20.0'
32 # libudev_version = '1.6.8'
34 libelogind_version = '0.20.0'
37 # We need the same data in three different formats, ugh!
38 # Also, for hysterical reasons, we use different variable
39 # names, sometimes. Not all variables are included in every
41 conf = configuration_data()
42 conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
43 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
45 substs = configuration_data()
46 #if 0 /// Set elogind Package PACKAGE_URL
47 # substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
49 substs.set('PACKAGE_URL', 'https://github.com/elogind/elogind')
51 substs.set('PACKAGE_VERSION', meson.project_version())
55 #####################################################################
56 #if 0 /// elogind does not need this
58 # # Try to install the git pre-commit hook
59 # git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
60 # if git_hook.returncode() == 0
61 # message(git_hook.stdout().strip())
64 # elogind Note: We use precompiler masks for two reasons:
65 # 1) The masking is consistent with the sources
66 # 2) The git patch creator we use for preparing upstream patches
67 # manipulates commits to not take those masks out. Therefore
68 # it can be used to add commits updating the meson files, too.
71 #####################################################################
73 split_usr = get_option('split-usr')
74 conf.set10('HAVE_SPLIT_USR', split_usr)
76 rootprefixdir = get_option('rootprefix')
77 # Unusual rootprefixdir values are used by some distros
78 # (see https://github.com/systemd/systemd/pull/7461).
79 rootprefix_default = get_option('split-usr') ? '/' : '/usr'
80 if rootprefixdir == ''
81 rootprefixdir = rootprefix_default
84 #if 0 /// UNNEEDED by elogind
85 # sysvinit_path = get_option('sysvinit-path')
86 # sysvrcnd_path = get_option('sysvrcnd-path')
87 # have = sysvinit_path != '' and sysvrcnd_path != ''
88 # conf.set10('HAVE_SYSV_COMPAT', have,
89 # description : 'SysV init scripts and rcN.d links are supported')
90 # m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
93 # join_paths ignore the preceding arguments if an absolute component is
94 # encountered, so this should canonicalize various paths when they are
95 # absolute or relative.
96 prefixdir = get_option('prefix')
97 if not prefixdir.startswith('/')
98 error('Prefix is not absolute: "@0@"'.format(prefixdir))
100 bindir = join_paths(prefixdir, get_option('bindir'))
101 libdir = join_paths(prefixdir, get_option('libdir'))
102 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
103 includedir = join_paths(prefixdir, get_option('includedir'))
104 datadir = join_paths(prefixdir, get_option('datadir'))
105 localstatedir = join_paths('/', get_option('localstatedir'))
107 rootbindir = join_paths(rootprefixdir, 'bin')
108 #if 0 /// elogind has a different default
109 # rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
111 rootlibexecdir = get_option('rootlibexecdir')
112 rootlibexecdir = rootlibexecdir != '' ? rootlibexecdir : join_paths(rootprefixdir, 'lib/elogind')
115 rootlibdir = get_option('rootlibdir')
117 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
120 # Dirs of external packages
121 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
122 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
123 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
124 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
125 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
126 varlogdir = join_paths(localstatedir, 'log')
127 #if 0 /// UNNEEDED by elogind
128 # xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
129 # rpmmacrosdir = get_option('rpmmacrosdir')
130 # if rpmmacrosdir != 'no'
131 # rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
134 modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
137 #if 0 /// elogind has a bit different layout and does not need all of theses
138 # pkgdatadir = join_paths(datadir, 'systemd')
139 # environmentdir = join_paths(prefixdir, 'lib/environment.d')
140 # pkgsysconfdir = join_paths(sysconfdir, 'systemd')
141 # userunitdir = join_paths(prefixdir, 'lib/systemd/user')
142 # userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
143 # tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
144 # sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
145 # sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
146 # binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
147 # modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
148 # networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
149 # pkgincludedir = join_paths(includedir, 'systemd')
150 # systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
151 # usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
152 # systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
153 # userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
154 # systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
155 # systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
156 # systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
157 # systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
158 # udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
159 # udevhomedir = udevlibexecdir
160 # udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
161 # udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
162 # catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
163 # kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
164 # factorydir = join_paths(datadir, 'factory')
165 # docdir = join_paths(datadir, 'doc/systemd')
166 # bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
167 # testsdir = join_paths(prefixdir, 'lib/systemd/tests')
168 # systemdstatedir = join_paths(localstatedir, 'lib/systemd')
169 # catalogstatedir = join_paths(systemdstatedir, 'catalog')
170 # randomseeddir = join_paths(localstatedir, 'lib/systemd')
172 pkgdatadir = join_paths(datadir, 'elogind')
173 pkgsysconfdir = join_paths(sysconfdir, 'elogind')
174 pkgincludedir = join_paths(includedir, 'elogind/systemd')
175 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
176 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
178 # in elogind, udev is external and thus configurable
179 udevlibexecdir = get_option('udevbindir')
180 udevlibexecdir = udevlibexecdir != '' ? udevlibexecdir : join_paths(rootprefixdir, 'lib/udev')
181 udevrulesdir = get_option('udevrulesdir')
182 udevrulesdir = udevrulesdir != '' ? udevrulesdir : join_paths(udevlibexecdir, 'rules.d')
183 udevhomedir = udevlibexecdir
184 factorydir = join_paths(datadir, 'factory')
185 docdir = get_option('docdir')
186 docdir = docdir != '' ? docdir: '-'.join([join_paths(datadir, 'doc/elogind'),
187 meson.project_version()])
188 testsdir = join_paths(prefixdir, 'lib/elogind/tests')
189 randomseeddir = join_paths(localstatedir, 'lib/elogind')
192 dbuspolicydir = get_option('dbuspolicydir')
193 if dbuspolicydir == ''
194 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
197 dbussessionservicedir = get_option('dbussessionservicedir')
198 if dbussessionservicedir == ''
199 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
202 dbussystemservicedir = get_option('dbussystemservicedir')
203 if dbussystemservicedir == ''
204 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
207 pamlibdir = get_option('pamlibdir')
209 pamlibdir = join_paths(rootlibdir, 'security')
212 pamconfdir = get_option('pamconfdir')
214 pamconfdir = join_paths(sysconfdir, 'pam.d')
217 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
218 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
219 #if 0 /// UNNEEDED by elogind
220 # conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
221 # conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
222 # conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
223 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
224 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
225 # conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
226 # conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
227 # conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
228 # conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
229 # conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
230 # conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
231 # conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
232 # conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs'))
233 # conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs'))
234 # conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
235 # conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
236 # conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
237 # conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
238 # conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
240 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'elogind-cgroups-agent'))
241 conf.set_quoted('ELOGIND_UACCESS_COMMAND_PATH', join_paths(rootlibexecdir, 'elogind-uaccess-command'))
242 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'elogind'))
244 conf.set_quoted('ROOTPREFIX', rootprefixdir)
245 #if 0 /// UNNEEDED by elogind
246 # conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
247 # conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
248 # conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
249 # conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
250 # conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
251 # conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
252 # conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
254 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
255 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
256 #if 0 /// UNNEEDED by elogind
257 # conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
258 # conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
260 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
261 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
262 conf.set_quoted('LIBDIR', libdir)
263 conf.set_quoted('ROOTLIBDIR', rootlibdir)
264 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
265 #if 0 /// UNNEEDED by elogind
266 # conf.set_quoted('BOOTLIBDIR', bootlibdir)
267 # conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
268 # conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
269 # conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
270 # conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
271 # conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
272 # conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
275 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
276 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
278 substs.set('prefix', prefixdir)
279 substs.set('exec_prefix', prefixdir)
280 substs.set('libdir', libdir)
281 substs.set('rootlibdir', rootlibdir)
282 substs.set('includedir', includedir)
283 substs.set('pkgsysconfdir', pkgsysconfdir)
284 substs.set('bindir', bindir)
285 substs.set('rootbindir', rootbindir)
286 substs.set('rootlibexecdir', rootlibexecdir)
287 #if 0 /// UNNEEDED by elogind
288 # substs.set('systemunitdir', systemunitdir)
289 # substs.set('userunitdir', userunitdir)
290 # substs.set('systempresetdir', systempresetdir)
291 # substs.set('userpresetdir', userpresetdir)
292 # substs.set('udevhwdbdir', udevhwdbdir)
294 substs.set('udevrulesdir', udevrulesdir)
295 substs.set('udevlibexecdir', udevlibexecdir)
296 #if 0 /// UNNEEDED by elogind
297 # substs.set('catalogdir', catalogdir)
298 # substs.set('tmpfilesdir', tmpfilesdir)
299 # substs.set('sysusersdir', sysusersdir)
300 # substs.set('sysctldir', sysctldir)
301 # substs.set('binfmtdir', binfmtdir)
302 # substs.set('modulesloaddir', modulesloaddir)
303 # substs.set('systemgeneratordir', systemgeneratordir)
304 # substs.set('usergeneratordir', usergeneratordir)
305 # substs.set('systemenvgeneratordir', systemenvgeneratordir)
306 # substs.set('userenvgeneratordir', userenvgeneratordir)
308 substs.set('systemshutdowndir', systemshutdowndir)
309 substs.set('systemsleepdir', systemsleepdir)
310 substs.set('VARLOGDIR', varlogdir)
311 #if 0 /// UNNEEDED by elogind
312 # substs.set('CERTIFICATEROOT', get_option('certificate-root'))
313 # substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
314 # substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
315 # substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
316 # substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
317 # substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
318 # substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
321 #####################################################################
323 cc = meson.get_compiler('c')
324 pkgconfig = import('pkgconfig')
325 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
327 cxx = find_program('c++', required : false)
329 # Used only for tests
333 foreach arg : ['-Wextra',
336 '-Wmissing-include-dirs',
337 '-Wold-style-definition',
340 '-Wdeclaration-after-statement',
342 '-Wsuggest-attribute=noreturn',
343 '-Werror=missing-prototypes',
344 '-Werror=implicit-function-declaration',
345 '-Werror=missing-declarations',
346 '-Werror=return-type',
347 '-Werror=incompatible-pointer-types',
349 '-Wstrict-prototypes',
351 '-Wmissing-noreturn',
352 '-Wimplicit-fallthrough=5',
355 '-Wstrict-aliasing=2',
362 '-fdiagnostics-show-option',
363 '-fno-strict-aliasing',
364 '-fvisibility=hidden',
366 '-fstack-protector-strong',
368 '--param=ssp-buffer-size=4',
370 if cc.has_argument(arg)
371 add_project_arguments(arg, language : 'c')
375 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
376 # arguments, just emits a warnings. So test for the "positive" version instead.
377 foreach arg : ['unused-parameter',
378 'missing-field-initializers',
381 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
383 if cc.has_argument('-W' + arg)
384 add_project_arguments('-Wno-' + arg, language : 'c')
390 #include <inttypes.h>
391 typedef uint64_t usec_t;
392 usec_t now(clockid_t clock);
397 ', name : '-Werror=shadow with local shadowing')
398 add_project_arguments('-Werror=shadow', language : 'c')
401 if cc.get_id() == 'clang'
402 foreach arg : ['-Wno-typedef-redefinition',
403 '-Wno-gnu-variable-sized-type-not-at-end',
405 if cc.has_argument(arg,
406 name : '@0@ is supported'.format(arg))
407 add_project_arguments(arg, language : 'c')
412 link_test_c = files('tools/meson-link-test.c')
414 # --as-needed and --no-undefined are provided by meson by default,
415 # run mesonconf to see what is enabled
416 foreach arg : ['-Wl,-z,relro',
421 have = run_command(check_compilation_sh,
422 cc.cmd_array(), '-x', 'c', arg,
423 '-include', link_test_c).returncode() == 0
424 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
426 add_project_link_arguments(arg, language : 'c')
430 if get_option('buildtype') != 'debug'
431 foreach arg : ['-ffunction-sections',
433 if cc.has_argument(arg,
434 name : '@0@ is supported'.format(arg))
435 add_project_arguments(arg, language : 'c')
439 foreach arg : ['-Wl,--gc-sections']
440 have = run_command(check_compilation_sh,
441 cc.cmd_array(), '-x', 'c', arg,
442 '-include', link_test_c).returncode() == 0
443 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
445 add_project_link_arguments(arg, language : 'c')
450 cpp = ' '.join(cc.cmd_array()) + ' -E'
452 #####################################################################
453 # compilation result tests
455 conf.set('_GNU_SOURCE', true)
456 conf.set('__SANE_USERSPACE_TYPES__', true)
458 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
459 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
460 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
461 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
462 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
463 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
464 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
468 #include <linux/ethtool.h>
469 #include <linux/fib_rules.h>
471 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
473 foreach decl : ['char16_t',
476 'struct ethtool_link_settings',
477 'struct fib_rule_uid_range',
480 # We get -1 if the size cannot be determined
481 have = cc.sizeof(decl, prefix : decl_headers) > 0
482 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
485 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
486 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
487 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
488 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
489 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
490 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
491 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
492 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
493 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
494 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
495 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
496 # if_tunnel.h is buggy and cannot be included on its own
497 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
498 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
499 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
500 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
501 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
502 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
503 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
504 ['NDA_IFINDEX', 'linux/neighbour.h'],
505 ['IFA_FLAGS', 'linux/if_addr.h'],
506 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
507 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
508 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
510 prefix = decl.length() > 2 ? decl[2] : ''
511 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
512 conf.set10('HAVE_' + decl[0], have)
515 foreach ident : ['secure_getenv', '__secure_getenv']
516 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
520 ['memfd_create', '''#define _GNU_SOURCE
521 // #include <sys/mman.h>'''],
522 ['gettid', '''#include <sys/types.h>'''],
523 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
524 ['name_to_handle_at', '''#define _GNU_SOURCE
525 // #include <sys/types.h>
526 #include <sys/stat.h>
527 #include <fcntl.h>'''],
528 ['setns', '''#define _GNU_SOURCE
529 // #include <sched.h>'''],
530 ['renameat2', '''#include <stdio.h>'''],
531 ['kcmp', '''#include <linux/kcmp.h>'''],
532 ['keyctl', '''#include <sys/types.h>
533 #include <keyutils.h>'''],
534 ['copy_file_range', '''#include <sys/syscall.h>
535 #include <unistd.h>'''],
536 ['bpf', '''#include <sys/syscall.h>
537 #include <unistd.h>'''],
538 ['explicit_bzero' , '''#include <string.h>'''],
541 have = cc.has_function(ident[0], prefix : ident[1])
542 conf.set10('HAVE_' + ident[0].to_upper(), have)
545 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
546 conf.set10('USE_SYS_RANDOM_H', true)
547 conf.set10('HAVE_GETRANDOM', true)
549 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
550 conf.set10('USE_SYS_RANDOM_H', false)
551 conf.set10('HAVE_GETRANDOM', have)
554 #####################################################################
556 sed = find_program('sed')
557 awk = find_program('awk')
558 m4 = find_program('m4')
559 stat = find_program('stat')
560 git = find_program('git', required : false)
562 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
563 #if 1 /// Needed by elogind
564 meson_symlink_headers = meson.source_root() + '/tools/meson-symlink_headers.sh'
566 mkdir_p = 'mkdir -p $DESTDIR/@0@'
567 #if 0 /// unneeded by elogind
568 # test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
569 # splash_bmp = files('test/splash.bmp')
572 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
573 # /usr/sbin, /sbin, and fall back to the default from middle column.
574 #if 0 /// elogind has a bit different list and some adaptions
575 # progs = [['telinit', '/lib/sysvinit/telinit'],
576 # ['quotaon', '/usr/sbin/quotaon' ],
577 # ['quotacheck', '/usr/sbin/quotacheck' ],
578 # ['kill', '/usr/bin/kill' ],
579 # ['kmod', '/usr/bin/kmod' ],
580 # ['kexec', '/usr/sbin/kexec' ],
581 # ['sulogin', '/usr/sbin/sulogin' ],
582 # ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
583 # ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
584 # ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
585 # ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
588 progs = [['kexec', '/usr/sbin/kexec', 'KEXEC'],
589 ['reboot', '/sbin/reboot', 'REBOOT'],
590 ['halt', '/sbin/halt', 'HALT'],
594 path = get_option(prog[0] + '-path')
596 message('Using @1@ for @0@'.format(prog[0], path))
598 exe = find_program(prog[0],
599 '/usr/sbin/' + prog[0],
602 path = exe.found() ? exe.path() : prog[1]
604 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
605 conf.set_quoted(name, path)
606 substs.set(name, path)
609 if run_command('ln', '--relative', '--help').returncode() != 0
610 error('ln does not support --relative')
613 ############################################################
615 gperf = find_program('gperf')
617 gperf_test_format = '''
619 const char * in_word_set(const char *, @0@);
622 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
623 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
624 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
625 if cc.compiles(gperf_test)
626 gperf_len_type = 'size_t'
628 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
629 if cc.compiles(gperf_test)
630 gperf_len_type = 'unsigned'
632 error('unable to determine gperf len type')
635 message('gperf len type is @0@'.format(gperf_len_type))
636 conf.set('GPERF_LEN_TYPE', gperf_len_type,
637 description : 'The type of gperf "len" parameter')
639 ############################################################
641 if not cc.has_header('sys/capability.h')
642 error('POSIX caps headers not found')
644 foreach header : ['linux/btrfs.h',
646 'linux/vm_sockets.h',
648 'valgrind/memcheck.h',
649 'valgrind/valgrind.h',
652 conf.set10('HAVE_' + header.underscorify().to_upper(),
653 cc.has_header(header))
656 ############################################################
658 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
659 #if 0 /// UNNEEDED by elogind
660 # conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
661 # gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
664 default_hierarchy = get_option('default-hierarchy')
665 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
666 description : 'default cgroup hierarchy as string')
667 if default_hierarchy == 'legacy'
668 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
669 elif default_hierarchy == 'hybrid'
670 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
672 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
675 #if 0 /// UNNEEDED by elogind
676 # time_epoch = get_option('time-epoch')
677 # if time_epoch == ''
678 # NEWS = files('NEWS')
679 # time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
681 # time_epoch = time_epoch.to_int()
682 # conf.set('TIME_EPOCH', time_epoch)
684 ############################################################
685 # elogind needs to know which cgroups controller to follow.
686 get_cg_ctrl_sh = find_program('tools/meson-get-cg-controller.sh')
687 with_cgroupctrl = get_option('cgroup-controller')
688 if with_cgroupctrl == '' or with_cgroupctrl == 'auto'
689 with_cgroupctrl = run_command(get_cg_ctrl_sh, []).stdout().strip()
690 elif with_cgroupctrl == 'none'
691 with_cgroupctrl = 'elogind'
694 # No controller now is a problem:
695 if with_cgroupctrl == ''
696 error('Unable to determine cgroup controller, but cgroups support is mandatory!')
699 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER', '_'.join(['',with_cgroupctrl]),
700 description : 'name of the cgroup controller to use')
701 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_LEGACY',
702 '='.join(['name', with_cgroupctrl]))
703 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_HYBRID',
704 '='.join(['name', with_cgroupctrl]))
705 ############################################################
708 system_uid_max = get_option('system-uid-max')
709 if system_uid_max == ''
710 system_uid_max = run_command(
712 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
713 '/etc/login.defs').stdout()
715 system_uid_max = system_uid_max.to_int()
716 conf.set('SYSTEM_UID_MAX', system_uid_max)
717 substs.set('systemuidmax', system_uid_max)
718 message('maximum system UID is @0@'.format(system_uid_max))
720 system_gid_max = get_option('system-gid-max')
721 if system_gid_max == ''
722 system_gid_max = run_command(
724 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
725 '/etc/login.defs').stdout()
727 system_gid_max = system_gid_max.to_int()
728 conf.set('SYSTEM_GID_MAX', system_gid_max)
729 substs.set('systemgidmax', system_gid_max)
730 message('maximum system GID is @0@'.format(system_gid_max))
732 #if 0 /// UNNEEDED by elogind
733 # dynamic_uid_min = get_option('dynamic-uid-min').to_int()
734 # dynamic_uid_max = get_option('dynamic-uid-max').to_int()
735 # conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
736 # conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
737 # substs.set('dynamicuidmin', dynamic_uid_min)
738 # substs.set('dynamicuidmax', dynamic_uid_max)
740 # container_uid_base_min = get_option('container-uid-base-min').to_int()
741 # container_uid_base_max = get_option('container-uid-base-max').to_int()
742 # conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
743 # conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
744 # substs.set('containeruidbasemin', container_uid_base_min)
745 # substs.set('containeruidbasemax', container_uid_base_max)
748 nobody_user = get_option('nobody-user')
749 nobody_group = get_option('nobody-group')
751 getent_result = run_command('getent', 'passwd', '65534')
752 if getent_result.returncode() == 0
753 name = getent_result.stdout().split(':')[0]
754 if name != nobody_user
755 message('WARNING:\n' +
756 ' The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) +
757 ' Your build will result in an user table setup that is incompatible with the local system.')
760 id_result = run_command('id', '-u', nobody_user)
761 if id_result.returncode() == 0
762 id = id_result.stdout().to_int()
764 message('WARNING:\n' +
765 ' The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) +
766 ' Your build will result in an user table setup that is incompatible with the local system.')
770 getent_result = run_command('getent', 'group', '65534')
771 if getent_result.returncode() == 0
772 name = getent_result.stdout().split(':')[0]
773 if name != nobody_group
774 message('WARNING:\n' +
775 ' The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) +
776 ' Your build will result in an group table setup that is incompatible with the local system.')
779 id_result = run_command('id', '-g', nobody_group)
780 if id_result.returncode() == 0
781 id = id_result.stdout().to_int()
783 message('WARNING:\n' +
784 ' The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
785 ' Your build will result in an group table setup that is incompatible with the local system.')
788 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
789 message('WARNING:\n' +
790 ' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
791 ' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
794 conf.set_quoted('NOBODY_USER_NAME', nobody_user)
795 conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
796 substs.set('NOBODY_USER_NAME', nobody_user)
797 substs.set('NOBODY_GROUP_NAME', nobody_group)
799 tty_gid = get_option('tty-gid')
800 conf.set('TTY_GID', tty_gid)
801 substs.set('TTY_GID', tty_gid)
803 #if 0 /// UNNEEDED by elogind
804 # # Ensure provided GID argument is numeric, otherwise fallback to default assignment
805 # if get_option('users-gid') != ''
806 # users_gid = get_option('users-gid').to_int()
810 # substs.set('USERS_GID', users_gid)
812 # if get_option('adm-group')
813 # m4_defines += ['-DENABLE_ADM_GROUP']
816 # if get_option('wheel-group')
817 # m4_defines += ['-DENABLE_WHEEL_GROUP']
820 # substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
821 # substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
824 kill_user_processes = get_option('default-kill-user-processes')
825 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
826 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
828 #if 0 /// UNNEEDED by elogind
829 # dns_servers = get_option('dns-servers')
830 # conf.set_quoted('DNS_SERVERS', dns_servers)
831 # substs.set('DNS_SERVERS', dns_servers)
833 # ntp_servers = get_option('ntp-servers')
834 # conf.set_quoted('NTP_SERVERS', ntp_servers)
835 # substs.set('NTP_SERVERS', ntp_servers)
838 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
840 #if 0 /// UNNEEDED by elogind
841 # substs.set('SUSHELL', get_option('debug-shell'))
842 # substs.set('DEBUGTTY', get_option('debug-tty'))
845 debug = get_option('debug')
846 enable_debug_hashmap = false
847 enable_debug_mmap_cache = false
848 #if 1 /// additional elogind debug mode
849 enable_debug_elogind = false
852 foreach name : debug.split(',')
854 enable_debug_hashmap = true
855 elif name == 'mmap-cache'
856 enable_debug_mmap_cache = true
857 #if 1 /// additional elogind debug mode
858 elif name == 'elogind'
859 enable_debug_elogind = true
862 message('unknown debug option "@0@", ignoring'.format(name))
866 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
867 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
868 #if 1 /// additional elogind debug mode
869 conf.set10('ENABLE_DEBUG_ELOGIND', enable_debug_elogind)
872 #####################################################################
874 threads = dependency('threads')
875 librt = cc.find_library('rt')
876 libm = cc.find_library('m')
877 libdl = cc.find_library('dl')
878 libcrypt = cc.find_library('crypt')
880 libcap = dependency('libcap', required : false)
881 if not libcap.found()
882 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
883 libcap = cc.find_library('cap')
886 #if 0 /// UNNEEDED by elogind
887 # libmount = dependency('mount',
888 # version : '>= 2.30')
890 # want_seccomp = get_option('seccomp')
891 # if want_seccomp != 'false'
892 # libseccomp = dependency('libseccomp',
893 # version : '>= 2.3.1',
894 # required : want_seccomp == 'true')
895 # have = libseccomp.found()
903 conf.set10('HAVE_SECCOMP', have)
904 m4_defines += have ? ['-DHAVE_SECCOMP'] : []
906 want_selinux = get_option('selinux')
907 if want_selinux != 'false'
908 libselinux = dependency('libselinux',
909 version : '>= 2.1.9',
910 required : want_selinux == 'true')
911 have = libselinux.found()
916 conf.set10('HAVE_SELINUX', have)
917 m4_defines += have ? ['-DHAVE_SELINUX'] : []
919 #if 0 /// UNNEEDED by elogind
920 # want_apparmor = get_option('apparmor')
921 # if want_apparmor != 'false'
922 # libapparmor = dependency('libapparmor',
923 # required : want_apparmor == 'true')
924 # have = libapparmor.found()
932 conf.set10('HAVE_APPARMOR', have)
933 m4_defines += have ? ['-DHAVE_APPARMOR'] : []
935 smack_run_label = get_option('smack-run-label')
936 if smack_run_label != ''
937 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
938 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
941 want_polkit = get_option('polkit')
942 install_polkit = false
943 install_polkit_pkla = false
944 if want_polkit != 'false'
945 install_polkit = true
947 libpolkit = dependency('polkit-gobject-1',
949 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
950 message('Old polkit detected, will install pkla files')
951 install_polkit_pkla = true
954 conf.set10('ENABLE_POLKIT', install_polkit)
956 want_acl = get_option('acl')
957 if want_acl != 'false'
958 libacl = cc.find_library('acl', required : want_acl == 'true')
959 have = libacl.found()
964 conf.set10('HAVE_ACL', have)
965 m4_defines += have ? ['-DHAVE_ACL'] : []
967 want_audit = get_option('audit')
968 if want_audit != 'false'
969 libaudit = dependency('audit', required : want_audit == 'true')
970 have = libaudit.found()
975 conf.set10('HAVE_AUDIT', have)
977 #if 0 /// UNNEEDED by elogind
978 # want_blkid = get_option('blkid')
979 # if want_blkid != 'false'
980 # libblkid = dependency('blkid', required : want_blkid == 'true')
981 # have = libblkid.found()
986 # conf.set10('HAVE_BLKID', have)
988 # want_kmod = get_option('kmod')
989 # if want_kmod != 'false'
990 # libkmod = dependency('libkmod',
992 # required : want_kmod == 'true')
993 # have = libkmod.found()
998 # conf.set10('HAVE_KMOD', have)
1004 want_pam = get_option('pam')
1005 if want_pam != 'false'
1006 libpam = cc.find_library('pam', required : want_pam == 'true')
1007 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
1008 have = libpam.found() and libpam_misc.found()
1014 conf.set10('HAVE_PAM', have)
1015 m4_defines += have ? ['-DHAVE_PAM'] : []
1017 #if 0 /// UNNEEDED by elogind
1018 # want_microhttpd = get_option('microhttpd')
1019 # if want_microhttpd != 'false'
1020 # libmicrohttpd = dependency('libmicrohttpd',
1021 # version : '>= 0.9.33',
1022 # required : want_microhttpd == 'true')
1023 # have = libmicrohttpd.found()
1026 # libmicrohttpd = []
1028 # conf.set10('HAVE_MICROHTTPD', have)
1029 # m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
1031 # want_libcryptsetup = get_option('libcryptsetup')
1032 # if want_libcryptsetup != 'false'
1033 # libcryptsetup = dependency('libcryptsetup',
1034 # version : '>= 1.6.0',
1035 # required : want_libcryptsetup == 'true')
1036 # have = libcryptsetup.found()
1039 # libcryptsetup = []
1041 # conf.set10('HAVE_LIBCRYPTSETUP', have)
1043 # want_libcurl = get_option('libcurl')
1044 # if want_libcurl != 'false'
1045 # libcurl = dependency('libcurl',
1046 # version : '>= 7.32.0',
1047 # required : want_libcurl == 'true')
1048 # have = libcurl.found()
1053 # conf.set10('HAVE_LIBCURL', have)
1054 # m4_defines += have ? ['-DHAVE_LIBCURL'] : []
1056 # want_libidn = get_option('libidn')
1057 # want_libidn2 = get_option('libidn2')
1058 # if want_libidn == 'true' and want_libidn2 == 'true'
1059 # error('libidn and libidn2 cannot be requested simultaneously')
1062 # if want_libidn != 'false' and want_libidn2 != 'true'
1063 # libidn = dependency('libidn',
1064 # required : want_libidn == 'true')
1065 # have = libidn.found()
1070 # conf.set10('HAVE_LIBIDN', have)
1071 # m4_defines += have ? ['-DHAVE_LIBIDN'] : []
1072 # if not have and want_libidn2 != 'false'
1073 # # libidn is used for both libidn and libidn2 objects
1074 # libidn = dependency('libidn2',
1075 # required : want_libidn2 == 'true')
1076 # have = libidn.found()
1080 # conf.set10('HAVE_LIBIDN2', have)
1081 # m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
1083 # want_libiptc = get_option('libiptc')
1084 # if want_libiptc != 'false'
1085 # libiptc = dependency('libiptc',
1086 # required : want_libiptc == 'true')
1087 # have = libiptc.found()
1092 # conf.set10('HAVE_LIBIPTC', have)
1093 # m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
1095 # want_qrencode = get_option('qrencode')
1096 # if want_qrencode != 'false'
1097 # libqrencode = dependency('libqrencode',
1098 # required : want_qrencode == 'true')
1099 # have = libqrencode.found()
1104 # conf.set10('HAVE_QRENCODE', have)
1106 # want_gcrypt = get_option('gcrypt')
1107 # if want_gcrypt != 'false'
1108 # libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
1109 # libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
1110 # have = libgcrypt.found() and libgpg_error.found()
1115 # # link to neither of the libs if one is not found
1119 # conf.set10('HAVE_GCRYPT', have)
1121 # want_gnutls = get_option('gnutls')
1122 # if want_gnutls != 'false'
1123 # libgnutls = dependency('gnutls',
1124 # version : '>= 3.1.4',
1125 # required : want_gnutls == 'true')
1126 # have = libgnutls.found()
1131 # conf.set10('HAVE_GNUTLS', have)
1133 # want_elfutils = get_option('elfutils')
1134 # if want_elfutils != 'false'
1135 # libdw = dependency('libdw',
1136 # required : want_elfutils == 'true')
1137 # have = libdw.found()
1142 # conf.set10('HAVE_ELFUTILS', have)
1144 # want_zlib = get_option('zlib')
1145 # if want_zlib != 'false'
1146 # libz = dependency('zlib',
1147 # required : want_zlib == 'true')
1148 # have = libz.found()
1153 # conf.set10('HAVE_ZLIB', have)
1155 # want_bzip2 = get_option('bzip2')
1156 # if want_bzip2 != 'false'
1157 # libbzip2 = cc.find_library('bz2',
1158 # required : want_bzip2 == 'true')
1159 # have = libbzip2.found()
1164 # conf.set10('HAVE_BZIP2', have)
1166 # want_xz = get_option('xz')
1167 # if want_xz != 'false'
1168 # libxz = dependency('liblzma',
1169 # required : want_xz == 'true')
1170 # have = libxz.found()
1175 # conf.set10('HAVE_XZ', have)
1177 # want_lz4 = get_option('lz4')
1178 # if want_lz4 != 'false'
1179 # liblz4 = dependency('liblz4',
1180 # required : want_lz4 == 'true')
1181 # have = liblz4.found()
1186 # conf.set10('HAVE_LZ4', have)
1188 # want_xkbcommon = get_option('xkbcommon')
1189 # if want_xkbcommon != 'false'
1190 # libxkbcommon = dependency('xkbcommon',
1191 # version : '>= 0.3.0',
1192 # required : want_xkbcommon == 'true')
1193 # have = libxkbcommon.found()
1215 conf.set10('HAVE_XKBCOMMON', have)
1217 want_glib = get_option('glib')
1218 if want_glib != 'false'
1219 libglib = dependency('glib-2.0',
1220 version : '>= 2.22.0',
1221 required : want_glib == 'true')
1222 libgobject = dependency('gobject-2.0',
1223 version : '>= 2.22.0',
1224 required : want_glib == 'true')
1225 libgio = dependency('gio-2.0',
1226 required : want_glib == 'true')
1227 have = libglib.found() and libgobject.found() and libgio.found()
1234 conf.set10('HAVE_GLIB', have)
1236 want_dbus = get_option('dbus')
1237 if want_dbus != 'false'
1238 libdbus = dependency('dbus-1',
1239 version : '>= 1.3.2',
1240 required : want_dbus == 'true')
1241 have = libdbus.found()
1246 conf.set10('HAVE_DBUS', have)
1248 #if 0 /// UNNEEDED by elogind
1249 # default_dnssec = get_option('default-dnssec')
1250 # if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1251 # message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1252 # default_dnssec = 'no'
1254 # conf.set('DEFAULT_DNSSEC_MODE',
1255 # 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1256 # substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1258 # want_importd = get_option('importd')
1259 # if want_importd != 'false'
1260 # have = (conf.get('HAVE_LIBCURL') == 1 and
1261 # conf.get('HAVE_ZLIB') == 1 and
1262 # conf.get('HAVE_BZIP2') == 1 and
1263 # conf.get('HAVE_XZ') == 1 and
1264 # conf.get('HAVE_GCRYPT') == 1)
1265 # if want_importd == 'true' and not have
1266 # error('importd support was requested, but dependencies are not available')
1271 # conf.set10('ENABLE_IMPORTD', have)
1273 # want_remote = get_option('remote')
1274 # if want_remote != 'false'
1275 # have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1276 # conf.get('HAVE_LIBCURL') == 1]
1277 # # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1278 # # it's possible to build one without the other. Complain only if
1279 # # support was explictly requested. The auxiliary files like sysusers
1280 # # config should be installed when any of the programs are built.
1281 # if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1282 # error('remote support was requested, but dependencies are not available')
1284 # have = have_deps[0] or have_deps[1]
1289 conf.set10('ENABLE_REMOTE', have)
1291 foreach term : ['utmp',
1292 #if 0 /// UNNEEDED by elogind
1326 have = get_option(term)
1327 name = 'ENABLE_' + term.underscorify().to_upper()
1328 conf.set10(name, have)
1329 m4_defines += have ? ['-D' + name] : []
1332 want_tests = get_option('tests')
1333 install_tests = get_option('install-tests')
1336 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1338 #####################################################################
1340 #if 0 /// UNNEEDED by elogind
1341 # if get_option('efi')
1342 # efi_arch = host_machine.cpu_family()
1344 # if efi_arch == 'x86'
1345 # EFI_MACHINE_TYPE_NAME = 'ia32'
1346 # gnu_efi_arch = 'ia32'
1347 # elif efi_arch == 'x86_64'
1348 # EFI_MACHINE_TYPE_NAME = 'x64'
1349 # gnu_efi_arch = 'x86_64'
1350 # elif efi_arch == 'arm'
1351 # EFI_MACHINE_TYPE_NAME = 'arm'
1352 # gnu_efi_arch = 'arm'
1353 # elif efi_arch == 'aarch64'
1354 # EFI_MACHINE_TYPE_NAME = 'aa64'
1355 # gnu_efi_arch = 'aarch64'
1357 # EFI_MACHINE_TYPE_NAME = ''
1362 # conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1364 # conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1369 conf.set10('ENABLE_EFI', have)
1371 #####################################################################
1373 config_h = configure_file(
1374 output : 'config.h',
1375 configuration : conf)
1377 includes = include_directories('src/basic',
1380 #if 0 /// UNNEEDED by elogind
1386 #if 0 /// UNNEEDED by elogind
1391 #if 0 /// elogind has a different list
1392 # 'src/libsystemd/sd-bus',
1393 # 'src/libsystemd/sd-device',
1394 # 'src/libsystemd/sd-hwdb',
1395 # 'src/libsystemd/sd-id128',
1396 # 'src/libsystemd/sd-netlink',
1397 # 'src/libsystemd/sd-network',
1398 # 'src/libsystemd-network',
1401 'src/libelogind/sd-bus',
1402 'src/libelogind/sd-id128',
1407 add_project_arguments('-include', 'config.h', language : 'c')
1409 #if 0 /// UNNEEDED by elogind
1412 #if 0 /// UNNEEDED by elogind
1415 subdir('src/systemd')
1417 #if 0 /// UNNEEDED by elogind
1418 # subdir('src/libsystemd')
1419 # subdir('src/libsystemd-network')
1420 # subdir('src/journal')
1423 subdir('src/libelogind')
1425 subdir('src/update-utmp')
1429 #if 0 /// UNNEEDED by elogind
1430 # libjournal_core = static_library(
1432 # libjournal_core_sources,
1434 # include_directories : includes,
1437 # libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1438 # libsystemd = shared_library(
1440 # version : libsystemd_version,
1441 # include_directories : includes,
1442 # link_args : ['-shared',
1443 # '-Wl,--version-script=' + libsystemd_sym_path],
1444 # link_with : [libbasic,
1446 # link_whole : [libsystemd_static,
1447 # libjournal_client],
1448 # dependencies : [threads,
1452 # link_depends : libsystemd_sym,
1454 # install_dir : rootlibdir)
1456 libelogind_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libelogind_sym)
1457 libelogind = shared_library(
1459 libelogind_internal_sources,
1460 version : libelogind_version,
1461 include_directories : includes,
1462 link_args : ['-shared',
1463 '-Wl,--version-script=' + libelogind_sym_path],
1464 link_with : [libbasic],
1465 dependencies : [threads],
1466 link_depends : libelogind_sym,
1468 install_dir : rootlibdir)
1471 ############################################################
1473 # binaries that have --help and are intended for use by humans,
1474 # usually, but not always, installed in /bin.
1475 public_programs = []
1477 #if 0 /// UNNEEDED by elogind
1478 # subdir('src/libudev')
1480 # elogind depends on external libudev:
1481 libudev = dependency('libudev', required : true)
1483 subdir('src/shared')
1484 #if 0 /// UNNEEDED by elogind
1485 # subdir('src/core')
1486 # subdir('src/udev')
1487 # subdir('src/network')
1489 # subdir('src/analyze')
1490 # subdir('src/journal-remote')
1491 # subdir('src/coredump')
1492 # subdir('src/hostname')
1493 # subdir('src/import')
1494 # subdir('src/kernel-install')
1495 # subdir('src/locale')
1496 # subdir('src/machine')
1497 # subdir('src/nspawn')
1498 # subdir('src/resolve')
1499 # subdir('src/timedate')
1500 # subdir('src/timesync')
1501 # subdir('src/vconsole')
1502 # subdir('src/boot/efi')
1506 #if 0 /// UNNEEDED in elogind
1511 ############################################################
1513 # only static linking apart from libdl, to make sure that the
1514 # module is linked to all libraries that it uses.
1515 test_dlopen = executable(
1518 include_directories : includes,
1519 link_with : [libbasic],
1520 dependencies : [libdl])
1522 #if 0 /// UNNEEDED by elogind
1523 # foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
1524 # ['systemd', 'ENABLE_NSS_SYSTEMD'],
1525 # ['mymachines', 'ENABLE_MACHINED'],
1526 # ['resolve', 'ENABLE_RESOLVE']]
1528 # condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1532 # sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1533 # version_script_arg = join_paths(meson.current_source_dir(), sym)
1535 # nss = shared_library(
1537 # 'src/nss-@0@/nss-@0@.c'.format(module),
1539 # include_directories : includes,
1540 # # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1541 # link_args : ['-Wl,-z,nodelete',
1543 # '-Wl,--version-script=' + version_script_arg,
1544 # '-Wl,--undefined'],
1545 # link_with : [libsystemd_static,
1547 # dependencies : [threads,
1549 # link_depends : sym,
1551 # install_dir : rootlibdir)
1553 # # We cannot use shared_module because it does not support version suffix.
1554 # # Unfortunately shared_library insists on creating the symlink…
1555 # meson.add_install_script('sh', '-c',
1556 # 'rm $DESTDIR@0@/libnss_@1@.so'
1557 # .format(rootlibdir, module))
1559 # test('dlopen-nss_' + module,
1561 # args : [nss.full_path()]) # path to dlopen must include a slash
1566 ############################################################
1568 #if 0 /// UNNEEDED by elogind
1569 # executable('systemd',
1571 # include_directories : includes,
1572 # link_with : [libcore,
1574 # dependencies : [threads,
1580 # install_rpath : rootlibexecdir,
1582 # install_dir : rootlibexecdir)
1584 # exe = executable('systemd-analyze',
1585 # systemd_analyze_sources,
1586 # include_directories : includes,
1587 # link_with : [libcore,
1589 # dependencies : [threads,
1595 # install_rpath : rootlibexecdir,
1597 # public_programs += [exe]
1599 # executable('systemd-journald',
1600 # systemd_journald_sources,
1601 # include_directories : includes,
1602 # link_with : [libjournal_core,
1604 # dependencies : [threads,
1608 # install_rpath : rootlibexecdir,
1610 # install_dir : rootlibexecdir)
1612 # exe = executable('systemd-cat',
1613 # systemd_cat_sources,
1614 # include_directories : includes,
1615 # link_with : [libjournal_core,
1617 # dependencies : [threads],
1618 # install_rpath : rootlibexecdir,
1620 # public_programs += [exe]
1622 # exe = executable('journalctl',
1623 # journalctl_sources,
1624 # include_directories : includes,
1625 # link_with : [libshared],
1626 # dependencies : [threads,
1630 # install_rpath : rootlibexecdir,
1632 # install_dir : rootbindir)
1633 # public_programs += [exe]
1635 # executable('systemd-getty-generator',
1636 # 'src/getty-generator/getty-generator.c',
1637 # include_directories : includes,
1638 # link_with : [libshared],
1639 # install_rpath : rootlibexecdir,
1641 # install_dir : systemgeneratordir)
1643 # executable('systemd-debug-generator',
1644 # 'src/debug-generator/debug-generator.c',
1645 # include_directories : includes,
1646 # link_with : [libshared],
1647 # install_rpath : rootlibexecdir,
1649 # install_dir : systemgeneratordir)
1651 # executable('systemd-fstab-generator',
1652 # 'src/fstab-generator/fstab-generator.c',
1653 # 'src/core/mount-setup.c',
1654 # include_directories : includes,
1655 # link_with : [libshared],
1656 # install_rpath : rootlibexecdir,
1658 # install_dir : systemgeneratordir)
1660 # if conf.get('ENABLE_ENVIRONMENT_D') == 1
1661 # executable('30-systemd-environment-d-generator',
1662 # 'src/environment-d-generator/environment-d-generator.c',
1663 # include_directories : includes,
1664 # link_with : [libshared],
1665 # install_rpath : rootlibexecdir,
1667 # install_dir : userenvgeneratordir)
1669 # meson.add_install_script(meson_make_symlink,
1670 # join_paths(sysconfdir, 'environment'),
1671 # join_paths(environmentdir, '99-environment.conf'))
1674 # if conf.get('ENABLE_HIBERNATE') == 1
1675 # executable('systemd-hibernate-resume-generator',
1676 # 'src/hibernate-resume/hibernate-resume-generator.c',
1677 # include_directories : includes,
1678 # link_with : [libshared],
1679 # install_rpath : rootlibexecdir,
1681 # install_dir : systemgeneratordir)
1683 # executable('systemd-hibernate-resume',
1684 # 'src/hibernate-resume/hibernate-resume.c',
1685 # include_directories : includes,
1686 # link_with : [libshared],
1687 # install_rpath : rootlibexecdir,
1689 # install_dir : rootlibexecdir)
1692 # if conf.get('HAVE_BLKID') == 1
1693 # executable('systemd-gpt-auto-generator',
1694 # 'src/gpt-auto-generator/gpt-auto-generator.c',
1695 # 'src/basic/blkid-util.h',
1696 # include_directories : includes,
1697 # link_with : [libshared],
1698 # dependencies : libblkid,
1699 # install_rpath : rootlibexecdir,
1701 # install_dir : systemgeneratordir)
1703 # exe = executable('systemd-dissect',
1704 # 'src/dissect/dissect.c',
1705 # include_directories : includes,
1706 # link_with : [libshared],
1707 # install_rpath : rootlibexecdir,
1709 # install_dir : rootlibexecdir)
1710 # public_programs += [exe]
1713 # if conf.get('ENABLE_RESOLVE') == 1
1714 # executable('systemd-resolved',
1715 # systemd_resolved_sources,
1716 # include_directories : includes,
1717 # link_with : [libshared,
1719 # dependencies : [threads,
1723 # install_rpath : rootlibexecdir,
1725 # install_dir : rootlibexecdir)
1727 # exe = executable('systemd-resolve',
1728 # systemd_resolve_sources,
1729 # include_directories : includes,
1730 # link_with : [libshared,
1732 # dependencies : [threads,
1736 # install_rpath : rootlibexecdir,
1738 # public_programs += [exe]
1741 # if conf.get('ENABLE_LOGIND') == 1
1742 # executable('systemd-logind',
1743 # systemd_logind_sources,
1744 # include_directories : includes,
1745 # link_with : [liblogind_core,
1747 # dependencies : [threads,
1749 # install_rpath : rootlibexecdir,
1751 # install_dir : rootlibexecdir)
1753 # exe = executable('loginctl',
1755 # include_directories : includes,
1756 # link_with : [libshared],
1757 # dependencies : [threads,
1760 # install_rpath : rootlibexecdir,
1762 # install_dir : rootbindir)
1763 # public_programs += [exe]
1765 # exe = executable('systemd-inhibit',
1766 # 'src/login/inhibit.c',
1767 # include_directories : includes,
1768 # link_with : [libshared],
1769 # install_rpath : rootlibexecdir,
1771 # install_dir : rootbindir)
1772 # public_programs += [exe]
1774 # if conf.get('HAVE_PAM') == 1
1775 # version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1776 # pam_systemd = shared_library(
1780 # include_directories : includes,
1781 # link_args : ['-shared',
1782 # '-Wl,--version-script=' + version_script_arg],
1783 # link_with : [libsystemd_static,
1784 # libshared_static],
1785 # dependencies : [threads,
1788 # link_depends : pam_systemd_sym,
1790 # install_dir : pamlibdir)
1792 # test('dlopen-pam_systemd',
1794 # args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1799 executable('elogind',
1801 include_directories : includes,
1802 link_with : [liblogind_core,
1804 dependencies : [threads,
1807 install_rpath : rootlibexecdir,
1809 install_dir : rootlibexecdir)
1811 exe = executable('loginctl',
1813 include_directories : includes,
1814 link_with : [libshared],
1815 dependencies : [threads,
1817 install_rpath : rootlibexecdir,
1819 install_dir : rootbindir)
1820 public_programs += [exe]
1822 exe = executable('elogind-inhibit',
1823 'src/login/inhibit.c',
1824 include_directories : includes,
1825 link_with : [libshared],
1826 dependencies : [threads],
1827 install_rpath : rootlibexecdir,
1829 install_dir : rootbindir)
1830 public_programs += [exe]
1832 if conf.get('HAVE_PAM') == 1
1833 version_script_arg = join_paths(meson.current_source_dir(), pam_elogind_sym)
1834 pam_elogind = shared_library(
1838 include_directories : includes,
1839 link_args : ['-shared',
1840 '-Wl,--version-script=' + version_script_arg],
1841 link_with : [libelogind,
1843 dependencies : [threads,
1846 link_depends : pam_elogind_sym,
1848 install_dir : pamlibdir)
1850 test('dlopen-pam_elogind',
1852 args : [pam_elogind.full_path()]) # path to dlopen must include a slash
1855 #if 0 /// UNNEEDED by elogind
1856 # executable('systemd-user-sessions',
1857 # 'src/user-sessions/user-sessions.c',
1858 # include_directories : includes,
1859 # link_with : [libshared],
1860 # install_rpath : rootlibexecdir,
1862 # install_dir : rootlibexecdir)
1865 # if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1866 # exe = executable('bootctl',
1867 # 'src/boot/bootctl.c',
1868 # include_directories : includes,
1869 # link_with : [libshared],
1870 # dependencies : [libblkid],
1871 # install_rpath : rootlibexecdir,
1873 # public_programs += [exe]
1876 # exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1877 # include_directories : includes,
1878 # link_with : [libshared],
1879 # dependencies : [threads],
1880 # install_rpath : rootlibexecdir,
1882 # public_programs += [exe]
1884 # exe = executable('systemctl', 'src/systemctl/systemctl.c',
1885 # include_directories : includes,
1886 # link_with : [libshared],
1887 # dependencies : [threads,
1892 # install_rpath : rootlibexecdir,
1894 # install_dir : rootbindir)
1895 # public_programs += [exe]
1897 # if conf.get('ENABLE_BACKLIGHT') == 1
1898 # executable('systemd-backlight',
1899 # 'src/backlight/backlight.c',
1900 # include_directories : includes,
1901 # link_with : [libshared],
1902 # install_rpath : rootlibexecdir,
1904 # install_dir : rootlibexecdir)
1907 # if conf.get('ENABLE_RFKILL') == 1
1908 # executable('systemd-rfkill',
1909 # 'src/rfkill/rfkill.c',
1910 # include_directories : includes,
1911 # link_with : [libshared],
1912 # install_rpath : rootlibexecdir,
1914 # install_dir : rootlibexecdir)
1917 # executable('systemd-system-update-generator',
1918 # 'src/system-update-generator/system-update-generator.c',
1919 # include_directories : includes,
1920 # link_with : [libshared],
1921 # install_rpath : rootlibexecdir,
1923 # install_dir : systemgeneratordir)
1925 # if conf.get('HAVE_LIBCRYPTSETUP') == 1
1926 # executable('systemd-cryptsetup',
1927 # 'src/cryptsetup/cryptsetup.c',
1928 # include_directories : includes,
1929 # link_with : [libshared],
1930 # dependencies : [libcryptsetup],
1931 # install_rpath : rootlibexecdir,
1933 # install_dir : rootlibexecdir)
1935 # executable('systemd-cryptsetup-generator',
1936 # 'src/cryptsetup/cryptsetup-generator.c',
1937 # include_directories : includes,
1938 # link_with : [libshared],
1939 # dependencies : [libcryptsetup],
1940 # install_rpath : rootlibexecdir,
1942 # install_dir : systemgeneratordir)
1944 # executable('systemd-veritysetup',
1945 # 'src/veritysetup/veritysetup.c',
1946 # include_directories : includes,
1947 # link_with : [libshared],
1948 # dependencies : [libcryptsetup],
1949 # install_rpath : rootlibexecdir,
1951 # install_dir : rootlibexecdir)
1953 # executable('systemd-veritysetup-generator',
1954 # 'src/veritysetup/veritysetup-generator.c',
1955 # include_directories : includes,
1956 # link_with : [libshared],
1957 # dependencies : [libcryptsetup],
1958 # install_rpath : rootlibexecdir,
1960 # install_dir : systemgeneratordir)
1963 # if conf.get('HAVE_SYSV_COMPAT') == 1
1964 # executable('systemd-sysv-generator',
1965 # 'src/sysv-generator/sysv-generator.c',
1966 # include_directories : includes,
1967 # link_with : [libshared],
1968 # install_rpath : rootlibexecdir,
1970 # install_dir : systemgeneratordir)
1972 # executable('systemd-rc-local-generator',
1973 # 'src/rc-local-generator/rc-local-generator.c',
1974 # include_directories : includes,
1975 # link_with : [libshared],
1976 # install_rpath : rootlibexecdir,
1978 # install_dir : systemgeneratordir)
1981 # if conf.get('ENABLE_HOSTNAMED') == 1
1982 # executable('systemd-hostnamed',
1983 # 'src/hostname/hostnamed.c',
1984 # include_directories : includes,
1985 # link_with : [libshared],
1986 # install_rpath : rootlibexecdir,
1988 # install_dir : rootlibexecdir)
1990 # exe = executable('hostnamectl',
1991 # 'src/hostname/hostnamectl.c',
1992 # include_directories : includes,
1993 # link_with : [libshared],
1994 # install_rpath : rootlibexecdir,
1996 # public_programs += [exe]
1999 # if conf.get('ENABLE_LOCALED') == 1
2000 # if conf.get('HAVE_XKBCOMMON') == 1
2001 # # logind will load libxkbcommon.so dynamically on its own
2007 # executable('systemd-localed',
2008 # systemd_localed_sources,
2009 # include_directories : includes,
2010 # link_with : [libshared],
2011 # dependencies : deps,
2012 # install_rpath : rootlibexecdir,
2014 # install_dir : rootlibexecdir)
2016 # exe = executable('localectl',
2017 # localectl_sources,
2018 # include_directories : includes,
2019 # link_with : [libshared],
2020 # install_rpath : rootlibexecdir,
2022 # public_programs += [exe]
2025 # if conf.get('ENABLE_TIMEDATED') == 1
2026 # executable('systemd-timedated',
2027 # 'src/timedate/timedated.c',
2028 # include_directories : includes,
2029 # link_with : [libshared],
2030 # install_rpath : rootlibexecdir,
2032 # install_dir : rootlibexecdir)
2034 # exe = executable('timedatectl',
2035 # 'src/timedate/timedatectl.c',
2036 # include_directories : includes,
2037 # install_rpath : rootlibexecdir,
2038 # link_with : [libshared],
2040 # public_programs += [exe]
2043 # if conf.get('ENABLE_TIMESYNCD') == 1
2044 # executable('systemd-timesyncd',
2045 # systemd_timesyncd_sources,
2046 # include_directories : includes,
2047 # link_with : [libshared],
2048 # dependencies : [threads,
2050 # install_rpath : rootlibexecdir,
2052 # install_dir : rootlibexecdir)
2055 # if conf.get('ENABLE_MACHINED') == 1
2056 # executable('systemd-machined',
2057 # systemd_machined_sources,
2058 # include_directories : includes,
2059 # link_with : [libmachine_core,
2061 # install_rpath : rootlibexecdir,
2063 # install_dir : rootlibexecdir)
2065 # exe = executable('machinectl',
2066 # 'src/machine/machinectl.c',
2067 # include_directories : includes,
2068 # link_with : [libshared],
2069 # dependencies : [threads,
2072 # install_rpath : rootlibexecdir,
2074 # install_dir : rootbindir)
2075 # public_programs += [exe]
2078 # if conf.get('ENABLE_IMPORTD') == 1
2079 # executable('systemd-importd',
2080 # systemd_importd_sources,
2081 # include_directories : includes,
2082 # link_with : [libshared],
2083 # dependencies : [threads],
2084 # install_rpath : rootlibexecdir,
2086 # install_dir : rootlibexecdir)
2088 # systemd_pull = executable('systemd-pull',
2089 # systemd_pull_sources,
2090 # include_directories : includes,
2091 # link_with : [libshared],
2092 # dependencies : [libcurl,
2097 # install_rpath : rootlibexecdir,
2099 # install_dir : rootlibexecdir)
2101 # systemd_import = executable('systemd-import',
2102 # systemd_import_sources,
2103 # include_directories : includes,
2104 # link_with : [libshared],
2105 # dependencies : [libcurl,
2109 # install_rpath : rootlibexecdir,
2111 # install_dir : rootlibexecdir)
2113 # systemd_export = executable('systemd-export',
2114 # systemd_export_sources,
2115 # include_directories : includes,
2116 # link_with : [libshared],
2117 # dependencies : [libcurl,
2121 # install_rpath : rootlibexecdir,
2123 # install_dir : rootlibexecdir)
2124 # public_programs += [systemd_pull, systemd_import, systemd_export]
2127 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
2128 # exe = executable('systemd-journal-upload',
2129 # systemd_journal_upload_sources,
2130 # include_directories : includes,
2131 # link_with : [libshared],
2132 # dependencies : [threads,
2137 # install_rpath : rootlibexecdir,
2139 # install_dir : rootlibexecdir)
2140 # public_programs += [exe]
2143 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
2144 # s_j_remote = executable('systemd-journal-remote',
2145 # systemd_journal_remote_sources,
2146 # include_directories : includes,
2147 # link_with : [libshared],
2148 # dependencies : [threads,
2153 # install_rpath : rootlibexecdir,
2155 # install_dir : rootlibexecdir)
2157 # s_j_gatewayd = executable('systemd-journal-gatewayd',
2158 # systemd_journal_gatewayd_sources,
2159 # include_directories : includes,
2160 # link_with : [libshared],
2161 # dependencies : [threads,
2166 # install_rpath : rootlibexecdir,
2168 # install_dir : rootlibexecdir)
2169 # public_programs += [s_j_remote, s_j_gatewayd]
2172 # if conf.get('ENABLE_COREDUMP') == 1
2173 # executable('systemd-coredump',
2174 # systemd_coredump_sources,
2175 # include_directories : includes,
2176 # link_with : [libshared],
2177 # dependencies : [threads,
2182 # install_rpath : rootlibexecdir,
2184 # install_dir : rootlibexecdir)
2186 # exe = executable('coredumpctl',
2187 # coredumpctl_sources,
2188 # include_directories : includes,
2189 # link_with : [libshared],
2190 # dependencies : [threads,
2193 # install_rpath : rootlibexecdir,
2195 # public_programs += [exe]
2198 # if conf.get('ENABLE_BINFMT') == 1
2199 # exe = executable('systemd-binfmt',
2200 # 'src/binfmt/binfmt.c',
2201 # include_directories : includes,
2202 # link_with : [libshared],
2203 # install_rpath : rootlibexecdir,
2205 # install_dir : rootlibexecdir)
2206 # public_programs += [exe]
2208 # meson.add_install_script('sh', '-c',
2209 # mkdir_p.format(binfmtdir))
2210 # meson.add_install_script('sh', '-c',
2211 # mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2214 # if conf.get('ENABLE_VCONSOLE') == 1
2215 # executable('systemd-vconsole-setup',
2216 # 'src/vconsole/vconsole-setup.c',
2217 # include_directories : includes,
2218 # link_with : [libshared],
2219 # install_rpath : rootlibexecdir,
2221 # install_dir : rootlibexecdir)
2224 # if conf.get('ENABLE_RANDOMSEED') == 1
2225 # executable('systemd-random-seed',
2226 # 'src/random-seed/random-seed.c',
2227 # include_directories : includes,
2228 # link_with : [libshared],
2229 # install_rpath : rootlibexecdir,
2231 # install_dir : rootlibexecdir)
2234 # if conf.get('ENABLE_FIRSTBOOT') == 1
2235 # executable('systemd-firstboot',
2236 # 'src/firstboot/firstboot.c',
2237 # include_directories : includes,
2238 # link_with : [libshared],
2239 # dependencies : [libcrypt],
2240 # install_rpath : rootlibexecdir,
2242 # install_dir : rootbindir)
2245 # executable('systemd-remount-fs',
2246 # 'src/remount-fs/remount-fs.c',
2247 # 'src/core/mount-setup.c',
2248 # 'src/core/mount-setup.h',
2249 # include_directories : includes,
2250 # link_with : [libshared],
2251 # install_rpath : rootlibexecdir,
2253 # install_dir : rootlibexecdir)
2255 # executable('systemd-machine-id-setup',
2256 # 'src/machine-id-setup/machine-id-setup-main.c',
2257 # 'src/core/machine-id-setup.c',
2258 # 'src/core/machine-id-setup.h',
2259 # include_directories : includes,
2260 # link_with : [libshared],
2261 # install_rpath : rootlibexecdir,
2263 # install_dir : rootbindir)
2265 # executable('systemd-fsck',
2266 # 'src/fsck/fsck.c',
2267 # include_directories : includes,
2268 # link_with : [libshared],
2269 # install_rpath : rootlibexecdir,
2271 # install_dir : rootlibexecdir)
2273 # executable('elogind-growfs',
2274 # 'src/partition/growfs.c',
2275 # include_directories : includes,
2276 # link_with : [libshared],
2277 # dependencies : [libcryptsetup],
2278 # install_rpath : rootlibexecdir,
2280 # install_dir : rootlibexecdir)
2282 # executable('elogind-makefs',
2283 # 'src/partition/makefs.c',
2284 # include_directories : includes,
2285 # link_with : [libshared],
2286 # install_rpath : rootlibexecdir,
2288 # install_dir : rootlibexecdir)
2290 # executable('systemd-sleep',
2291 # 'src/sleep/sleep.c',
2292 # include_directories : includes,
2293 # link_with : [libshared],
2294 # install_rpath : rootlibexecdir,
2296 # install_dir : rootlibexecdir)
2298 # exe = executable('systemd-sysctl',
2299 # 'src/sysctl/sysctl.c',
2300 # include_directories : includes,
2301 # link_with : [libshared],
2302 # install_rpath : rootlibexecdir,
2304 # install_dir : rootlibexecdir)
2305 # public_programs += [exe]
2307 # executable('systemd-ac-power',
2308 # 'src/ac-power/ac-power.c',
2309 # include_directories : includes,
2310 # link_with : [libshared],
2311 # install_rpath : rootlibexecdir,
2313 # install_dir : rootlibexecdir)
2315 # exe = executable('systemd-detect-virt',
2316 # 'src/detect-virt/detect-virt.c',
2317 # include_directories : includes,
2318 # link_with : [libshared],
2319 # install_rpath : rootlibexecdir,
2321 # public_programs += [exe]
2323 # exe = executable('systemd-delta',
2324 # 'src/delta/delta.c',
2325 # include_directories : includes,
2326 # link_with : [libshared],
2327 # install_rpath : rootlibexecdir,
2329 # public_programs += [exe]
2331 # exe = executable('systemd-escape',
2332 # 'src/escape/escape.c',
2333 # include_directories : includes,
2334 # link_with : [libshared],
2335 # install_rpath : rootlibexecdir,
2337 # install_dir : rootbindir)
2338 # public_programs += [exe]
2340 # exe = executable('systemd-notify',
2341 # 'src/notify/notify.c',
2342 # include_directories : includes,
2343 # link_with : [libshared],
2344 # install_rpath : rootlibexecdir,
2346 # install_dir : rootbindir)
2347 # public_programs += [exe]
2349 # executable('systemd-volatile-root',
2350 # 'src/volatile-root/volatile-root.c',
2351 # include_directories : includes,
2352 # link_with : [libshared],
2353 # install_rpath : rootlibexecdir,
2355 # install_dir : rootlibexecdir)
2357 # executable('systemd-cgroups-agent',
2358 # 'src/cgroups-agent/cgroups-agent.c',
2359 # include_directories : includes,
2360 # link_with : [libshared],
2361 # install_rpath : rootlibexecdir,
2363 # install_dir : rootlibexecdir)
2365 executable('elogind-cgroups-agent',
2366 'src/cgroups-agent/cgroups-agent.c',
2367 include_directories : includes,
2368 link_with : [libshared_static],
2369 install_rpath : rootlibexecdir,
2371 install_dir : rootlibexecdir)
2374 #if 0 /// UNNEEDED by elogind
2375 # exe = executable('systemd-path',
2376 # 'src/path/path.c',
2377 # include_directories : includes,
2378 # link_with : [libshared],
2379 # install_rpath : rootlibexecdir,
2381 # public_programs += [exe]
2383 # exe = executable('systemd-ask-password',
2384 # 'src/ask-password/ask-password.c',
2385 # include_directories : includes,
2386 # link_with : [libshared],
2387 # install_rpath : rootlibexecdir,
2389 # install_dir : rootbindir)
2390 # public_programs += [exe]
2392 # executable('systemd-reply-password',
2393 # 'src/reply-password/reply-password.c',
2394 # include_directories : includes,
2395 # link_with : [libshared],
2396 # install_rpath : rootlibexecdir,
2398 # install_dir : rootlibexecdir)
2400 # exe = executable('systemd-tty-ask-password-agent',
2401 # 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2402 # include_directories : includes,
2403 # link_with : [libshared],
2404 # install_rpath : rootlibexecdir,
2406 # install_dir : rootbindir)
2407 # public_programs += [exe]
2409 # exe = executable('systemd-cgls',
2410 # 'src/cgls/cgls.c',
2411 # include_directories : includes,
2412 # link_with : [libshared],
2413 # install_rpath : rootlibexecdir,
2415 # public_programs += [exe]
2417 # exe = executable('systemd-cgtop',
2418 # 'src/cgtop/cgtop.c',
2419 # include_directories : includes,
2420 # link_with : [libshared],
2421 # install_rpath : rootlibexecdir,
2423 # public_programs += [exe]
2425 # executable('systemd-initctl',
2426 # 'src/initctl/initctl.c',
2427 # include_directories : includes,
2428 # link_with : [libshared],
2429 # install_rpath : rootlibexecdir,
2431 # install_dir : rootlibexecdir)
2433 # exe = executable('systemd-mount',
2434 # 'src/mount/mount-tool.c',
2435 # include_directories : includes,
2436 # link_with : [libshared],
2437 # install_rpath : rootlibexecdir,
2439 # public_programs += [exe]
2441 # meson.add_install_script(meson_make_symlink,
2442 # 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2444 # exe = executable('systemd-run',
2446 # include_directories : includes,
2447 # link_with : [libshared],
2448 # install_rpath : rootlibexecdir,
2450 # public_programs += [exe]
2452 # exe = executable('systemd-stdio-bridge',
2453 # 'src/stdio-bridge/stdio-bridge.c',
2454 # include_directories : includes,
2455 # link_with : [libshared],
2456 # install_rpath : rootlibexecdir,
2458 # public_programs += [exe]
2460 # exe = executable('busctl',
2461 # 'src/busctl/busctl.c',
2462 # 'src/busctl/busctl-introspect.c',
2463 # 'src/busctl/busctl-introspect.h',
2464 # include_directories : includes,
2465 # link_with : [libshared],
2466 # install_rpath : rootlibexecdir,
2468 # public_programs += [exe]
2470 # if conf.get('ENABLE_SYSUSERS') == 1
2471 # exe = executable('systemd-sysusers',
2472 # 'src/sysusers/sysusers.c',
2473 # include_directories : includes,
2474 # link_with : [libshared],
2475 # install_rpath : rootlibexecdir,
2477 # install_dir : rootbindir)
2478 # public_programs += [exe]
2481 # if conf.get('ENABLE_TMPFILES') == 1
2482 # exe = executable('systemd-tmpfiles',
2483 # 'src/tmpfiles/tmpfiles.c',
2484 # include_directories : includes,
2485 # link_with : [libshared],
2486 # dependencies : [libacl],
2487 # install_rpath : rootlibexecdir,
2489 # install_dir : rootbindir)
2490 # public_programs += [exe]
2492 # test('test-systemd-tmpfiles',
2493 # test_systemd_tmpfiles_py,
2494 # args : exe.full_path())
2495 # # https://github.com/mesonbuild/meson/issues/2681
2498 # if conf.get('ENABLE_HWDB') == 1
2499 # exe = executable('systemd-hwdb',
2500 # 'src/hwdb/hwdb.c',
2501 # 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2502 # include_directories : includes,
2503 # link_with : [libudev_static],
2504 # install_rpath : udev_rpath,
2506 # install_dir : rootbindir)
2507 # public_programs += [exe]
2510 # if conf.get('ENABLE_QUOTACHECK') == 1
2511 # executable('systemd-quotacheck',
2512 # 'src/quotacheck/quotacheck.c',
2513 # include_directories : includes,
2514 # link_with : [libshared],
2515 # install_rpath : rootlibexecdir,
2517 # install_dir : rootlibexecdir)
2520 # exe = executable('systemd-socket-proxyd',
2521 # 'src/socket-proxy/socket-proxyd.c',
2522 # include_directories : includes,
2523 # link_with : [libshared],
2524 # dependencies : [threads],
2525 # install_rpath : rootlibexecdir,
2527 # install_dir : rootlibexecdir)
2528 # public_programs += [exe]
2530 # exe = executable('systemd-udevd',
2531 # systemd_udevd_sources,
2532 # include_directories : includes,
2533 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2534 # link_with : [libudev_core,
2535 # libsystemd_network,
2537 # dependencies : [threads,
2542 # install_rpath : udev_rpath,
2544 # install_dir : rootlibexecdir)
2545 # public_programs += [exe]
2547 # exe = executable('udevadm',
2549 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2550 # include_directories : includes,
2551 # link_with : [libudev_core,
2552 # libsystemd_network,
2554 # dependencies : [threads,
2559 # install_rpath : udev_rpath,
2561 # install_dir : rootbindir)
2562 # public_programs += [exe]
2564 # executable('systemd-shutdown',
2565 # systemd_shutdown_sources,
2566 # include_directories : includes,
2567 # link_with : [libshared],
2568 # install_rpath : rootlibexecdir,
2570 # install_dir : rootlibexecdir)
2572 # executable('systemd-update-done',
2573 # 'src/update-done/update-done.c',
2574 # include_directories : includes,
2575 # link_with : [libshared],
2576 # install_rpath : rootlibexecdir,
2578 # install_dir : rootlibexecdir)
2580 # executable('systemd-update-utmp',
2581 # 'src/update-utmp/update-utmp.c',
2582 # include_directories : includes,
2583 # link_with : [libshared],
2584 # dependencies : [libaudit],
2585 # install_rpath : rootlibexecdir,
2587 # install_dir : rootlibexecdir)
2589 # if conf.get('HAVE_KMOD') == 1
2590 # executable('systemd-modules-load',
2591 # 'src/modules-load/modules-load.c',
2592 # include_directories : includes,
2593 # link_with : [libshared],
2594 # dependencies : [libkmod],
2595 # install_rpath : rootlibexecdir,
2597 # install_dir : rootlibexecdir)
2599 # meson.add_install_script('sh', '-c',
2600 # mkdir_p.format(modulesloaddir))
2601 # meson.add_install_script('sh', '-c',
2602 # mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2605 # exe = executable('systemd-nspawn',
2606 # systemd_nspawn_sources,
2607 # 'src/core/mount-setup.c', # FIXME: use a variable?
2608 # 'src/core/mount-setup.h',
2609 # 'src/core/loopback-setup.c',
2610 # 'src/core/loopback-setup.h',
2611 # include_directories : [includes, include_directories('src/nspawn')],
2612 # link_with : [libshared],
2613 # dependencies : [libacl,
2617 # install_rpath : rootlibexecdir,
2619 # public_programs += [exe]
2621 # if conf.get('ENABLE_NETWORKD') == 1
2622 # executable('systemd-networkd',
2623 # systemd_networkd_sources,
2624 # include_directories : includes,
2625 # link_with : [libnetworkd_core,
2626 # libsystemd_network,
2629 # dependencies : [threads],
2630 # install_rpath : rootlibexecdir,
2632 # install_dir : rootlibexecdir)
2634 # executable('systemd-networkd-wait-online',
2635 # systemd_networkd_wait_online_sources,
2636 # include_directories : includes,
2637 # link_with : [libnetworkd_core,
2639 # install_rpath : rootlibexecdir,
2641 # install_dir : rootlibexecdir)
2643 # exe = executable('networkctl',
2644 # networkctl_sources,
2645 # include_directories : includes,
2646 # link_with : [libsystemd_network,
2648 # install_rpath : rootlibexecdir,
2650 # install_dir : rootbindir)
2651 # public_programs += [exe]
2654 # executable('systemd-sulogin-shell',
2655 # ['src/sulogin-shell/sulogin-shell.c'],
2656 # include_directories : includes,
2657 # link_with : [libshared],
2658 # install_rpath : rootlibexecdir,
2660 # install_dir : rootlibexecdir)
2662 executable('elogind-uaccess-command',
2663 'src/uaccess-command/uaccess-command.c',
2664 include_directories : includes,
2665 link_with : [liblogind_core,
2667 dependencies: [libacl,
2669 install_rpath : rootlibexecdir,
2671 install_dir : rootlibexecdir)
2674 ############################################################
2676 foreach tuple : tests
2678 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2679 dependencies = tuple[2]
2680 condition = tuple.length() >= 4 ? tuple[3] : ''
2681 type = tuple.length() >= 5 ? tuple[4] : ''
2682 defs = tuple.length() >= 6 ? tuple[5] : []
2683 incs = tuple.length() >= 7 ? tuple[6] : includes
2686 name = sources[0].split('/')[-1].split('.')[0]
2687 if type.startswith('timeout=')
2688 timeout = type.split('=')[1].to_int()
2692 if condition == '' or conf.get(condition) == 1
2696 include_directories : incs,
2697 link_with : link_with,
2698 dependencies : dependencies,
2700 install_rpath : rootlibexecdir,
2701 install : install_tests,
2702 install_dir : join_paths(testsdir, type))
2705 message('@0@ is a manual test'.format(name))
2706 elif type == 'unsafe' and want_tests != 'unsafe'
2707 message('@0@ is an unsafe test'.format(name))
2714 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2718 #if 0 /// UNNEEDED by elogind
2719 # test_libsystemd_sym = executable(
2720 # 'test-libsystemd-sym',
2721 # test_libsystemd_sym_c,
2722 # include_directories : includes,
2723 # link_with : [libsystemd],
2724 # install : install_tests,
2725 # install_dir : testsdir)
2726 # test('test-libsystemd-sym',
2727 # test_libsystemd_sym)
2729 # test_libudev_sym = executable(
2730 # 'test-libudev-sym',
2731 # test_libudev_sym_c,
2732 # include_directories : includes,
2733 # c_args : ['-Wno-deprecated-declarations'],
2734 # link_with : [libudev],
2735 # install : install_tests,
2736 # install_dir : testsdir)
2737 # test('test-libudev-sym',
2740 test_libelogind_sym = executable(
2741 'test-libelogind-sym',
2742 test_libelogind_sym_c,
2743 include_directories : includes,
2744 link_with : [libelogind],
2745 install : install_tests,
2746 install_dir : testsdir)
2747 test('test-libelogind-sym',
2748 test_libelogind_sym)
2751 ############################################################
2753 make_directive_index_py = find_program('tools/make-directive-index.py')
2754 make_man_index_py = find_program('tools/make-man-index.py')
2755 xml_helper_py = find_program('tools/xml_helper.py')
2756 #if 0 /// UNNEEDED by elogind
2757 # hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2760 # subdir('sysctl.d')
2761 # subdir('sysusers.d')
2762 # subdir('tmpfiles.d')
2768 subdir('shell-completion/bash')
2769 subdir('shell-completion/zsh')
2770 #if 0 /// UNNEEDED by elogind
2771 # subdir('docs/sysvinit')
2772 # subdir('docs/var-log')
2775 # FIXME: figure out if the warning is true:
2776 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2777 install_subdir('factory/etc',
2778 install_dir : factorydir)
2781 #if 0 /// UNNEEDED by elogind
2782 # install_data('xorg/50-systemd-user.sh',
2783 # install_dir : xinitrcdir)
2784 # install_data('modprobe.d/systemd.conf',
2785 # install_dir : modprobedir)
2787 install_data('README',
2790 #if 0 /// UNNEEDED by elogind
2796 'src/libelogind/sd-bus/GVARIANT-SERIALIZATION',
2797 install_dir : docdir)
2799 #if 0 /// UNNEEDED by elogind
2800 # meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2802 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2804 ############################################################
2806 meson_check_help = find_program('tools/meson-check-help.sh')
2808 foreach exec : public_programs
2809 name = exec.full_path().split('/')[-1]
2810 test('check-help-' + name,
2812 args : [exec.full_path()])
2815 ############################################################
2818 all_files = run_command(
2820 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2823 all_files = files(all_files.stdout().split())
2828 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2832 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2835 #if 0 /// UNNEEDED by elogind
2837 # meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2840 # command : [meson_git_contrib_sh])
2845 git_head = run_command(
2847 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2848 'rev-parse', 'HEAD']).stdout().strip()
2849 git_head_short = run_command(
2851 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2852 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2856 command : ['git', 'archive',
2857 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2859 '--prefix', 'systemd-@0@/'.format(git_head),
2863 ############################################################
2866 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2868 #if 0 /// UNSUPPORTED by elogind
2869 # 'prefix directory: @0@'.format(prefixdir),
2870 # 'rootprefix directory: @0@'.format(rootprefixdir),
2871 # 'sysconf directory: @0@'.format(sysconfdir),
2872 # 'include directory: @0@'.format(includedir),
2873 # 'lib directory: @0@'.format(libdir),
2874 # 'rootlib directory: @0@'.format(rootlibdir),
2875 # 'SysV init scripts: @0@'.format(sysvinit_path),
2876 # 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2878 'rootexeclib dir: @0@'.format(rootlibexecdir),
2880 #if 0 /// UNSUPPORTED by elogind
2881 # 'PAM modules directory: @0@'.format(pamlibdir),
2882 # 'PAM configuration directory: @0@'.format(pamconfdir),
2883 # 'RPM macros directory: @0@'.format(rpmmacrosdir),
2884 # 'modprobe.d directory: @0@'.format(modprobedir),
2885 # 'D-Bus policy directory: @0@'.format(dbuspolicydir),
2886 # 'D-Bus session directory: @0@'.format(dbussessionservicedir),
2887 # 'D-Bus system directory: @0@'.format(dbussystemservicedir),
2888 # 'bash completions directory: @0@'.format(bashcompletiondir),
2889 # 'zsh completions directory: @0@'.format(zshcompletiondir),
2890 # 'extra start script: @0@'.format(get_option('rc-local')),
2891 # 'extra stop script: @0@'.format(get_option('halt-local')),
2892 # 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2893 # get_option('debug-tty')),
2895 'TTY GID: @0@'.format(tty_gid),
2896 #if 0 /// UNSUPPORTED by elogind
2897 # 'users GID: @0@'.format(users_gid),
2899 'maximum system UID: @0@'.format(system_uid_max),
2900 'maximum system GID: @0@'.format(system_gid_max),
2901 #if 0 /// UNSUPPORTED by elogind
2902 # 'minimum dynamic UID: @0@'.format(dynamic_uid_min),
2903 # 'maximum dynamic UID: @0@'.format(dynamic_uid_max),
2904 # 'minimum container UID base: @0@'.format(container_uid_base_min),
2905 # 'maximum container UID base: @0@'.format(container_uid_base_max),
2906 # '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2907 # 'render group access mode: @0@'.format(get_option('group-render-mode')),
2908 # 'certificate root directory: @0@'.format(get_option('certificate-root')),
2909 # 'support URL: @0@'.format(support_url),
2910 # 'nobody user name: @0@'.format(nobody_user),
2911 # 'nobody group name: @0@'.format(nobody_group),
2912 # 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2913 # 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2915 # 'default DNSSEC mode: @0@'.format(default_dnssec),
2916 # 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2918 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2920 #if 0 /// UNSUPPORTED by elogind
2921 # alt_dns_servers = '\n '.join(dns_servers.split(' '))
2922 # alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2924 # 'default DNS servers: @0@'.format(alt_dns_servers),
2925 # 'default NTP servers: @0@'.format(alt_ntp_servers)]
2927 # alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2928 # '@@0@'.format(time_epoch)).stdout().strip()
2930 # 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2934 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2935 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2936 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2938 #if 0 /// UNNEEDED by elogind
2939 # if conf.get('ENABLE_EFI') == 1
2941 # 'efi arch: @0@'.format(efi_arch)]
2945 # 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2946 # 'EFI CC @0@'.format(efi_cc),
2947 # 'EFI lib directory: @0@'.format(efi_libdir),
2948 # 'EFI lds directory: @0@'.format(efi_ldsdir),
2949 # 'EFI include directory: @0@'.format(efi_incdir)]
2958 #if 0 /// UNNEEDED by elogind
2959 # ['libcryptsetup'],
2963 #if 0 /// UNNEEDED by elogind
2968 #if 0 /// UNNEEDED by elogind
2972 #if 0 /// UNNEEDED by elogind
2979 #if 0 /// UNNEEDED by elogind
2995 # ['environment.d'],
3013 ['legacy pkla', install_polkit_pkla],
3014 #if 0 /// UNNEEDED by elogind
3016 # ['gnu-efi', have_gnu_efi],
3023 #if 0 /// UNNEEDED by elogind
3024 # ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
3028 ['man pages', want_man],
3029 ['html pages', want_html],
3030 ['man page indices', want_man and have_lxml],
3031 #if 0 /// UNNEEDED by elogind
3032 # ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
3036 #if 0 /// UNNEEDED by elogind
3039 # ['adm group', get_option('adm-group')],
3040 # ['wheel group', get_option('wheel-group')],
3046 ['debug mmap cache'],
3049 cond = tuple.get(1, '')
3051 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
3052 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
3053 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
3058 missing += [tuple[0]]
3064 'enabled features: @0@'.format(', '.join(found)),
3066 'disabled features: @0@'.format(', '.join(missing)),
3068 message('\n '.join(status))
3070 if rootprefixdir != rootprefix_default
3071 message('WARNING:\n' +
3072 ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
3073 ' elogind used fixed names for unit file directories and other paths, so anything\n' +
3074 ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))