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 if get_option('tests') != 'false'
328 cxx = find_program('c++', required : false)
330 # Used only for tests
335 want_ossfuzz = get_option('oss-fuzz')
336 want_libfuzzer = get_option('llvm-fuzz')
337 fuzzer_build = want_ossfuzz or want_libfuzzer
338 if want_ossfuzz and want_libfuzzer
339 error('only one of oss-fuzz and llvm-fuzz can be specified')
342 fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer')
345 fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
348 foreach arg : ['-Wextra',
351 '-Wmissing-include-dirs',
352 '-Wold-style-definition',
355 '-Wdeclaration-after-statement',
357 '-Wsuggest-attribute=noreturn',
358 '-Werror=missing-prototypes',
359 '-Werror=implicit-function-declaration',
360 '-Werror=missing-declarations',
361 '-Werror=return-type',
362 '-Werror=incompatible-pointer-types',
364 '-Wstrict-prototypes',
366 '-Wmissing-noreturn',
367 '-Wimplicit-fallthrough=5',
370 '-Wstrict-aliasing=2',
377 '-fdiagnostics-show-option',
378 '-fno-strict-aliasing',
379 '-fvisibility=hidden',
381 '-fstack-protector-strong',
382 '--param=ssp-buffer-size=4',
384 if cc.has_argument(arg)
385 add_project_arguments(arg, language : 'c')
389 # the oss-fuzz fuzzers are not built with -fPIE, so don't
390 # enable it when we are linking against them
392 if cc.has_argument('-fPIE')
393 add_project_arguments('-fPIE', language : 'c')
397 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
398 # arguments, just emits a warnings. So test for the "positive" version instead.
399 foreach arg : ['unused-parameter',
400 'missing-field-initializers',
403 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
405 if cc.has_argument('-W' + arg)
406 add_project_arguments('-Wno-' + arg, language : 'c')
412 #include <inttypes.h>
413 typedef uint64_t usec_t;
414 usec_t now(clockid_t clock);
419 ', name : '-Werror=shadow with local shadowing')
420 add_project_arguments('-Werror=shadow', language : 'c')
423 if cc.get_id() == 'clang'
424 foreach arg : ['-Wno-typedef-redefinition',
425 '-Wno-gnu-variable-sized-type-not-at-end',
427 if cc.has_argument(arg,
428 name : '@0@ is supported'.format(arg))
429 add_project_arguments(arg, language : 'c')
434 link_test_c = files('tools/meson-link-test.c')
436 # --as-needed and --no-undefined are provided by meson by default,
437 # run mesonconf to see what is enabled
438 foreach arg : ['-Wl,-z,relro',
443 have = run_command(check_compilation_sh,
444 cc.cmd_array(), '-x', 'c', arg,
445 '-include', link_test_c).returncode() == 0
446 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
447 if have and (arg != '-pie' or not fuzzer_build)
448 add_project_link_arguments(arg, language : 'c')
452 if get_option('buildtype') != 'debug'
453 foreach arg : ['-ffunction-sections',
455 if cc.has_argument(arg,
456 name : '@0@ is supported'.format(arg))
457 add_project_arguments(arg, language : 'c')
461 foreach arg : ['-Wl,--gc-sections']
462 have = run_command(check_compilation_sh,
463 cc.cmd_array(), '-x', 'c', arg,
464 '-include', link_test_c).returncode() == 0
465 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
467 add_project_link_arguments(arg, language : 'c')
472 cpp = ' '.join(cc.cmd_array()) + ' -E'
474 #####################################################################
475 # compilation result tests
477 conf.set('_GNU_SOURCE', true)
478 conf.set('__SANE_USERSPACE_TYPES__', true)
480 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
481 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
482 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
483 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
484 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
485 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
486 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
490 #include <linux/ethtool.h>
491 #include <linux/fib_rules.h>
493 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
495 foreach decl : ['char16_t',
498 'struct ethtool_link_settings',
499 'struct fib_rule_uid_range',
502 # We get -1 if the size cannot be determined
503 have = cc.sizeof(decl, prefix : decl_headers) > 0
504 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
507 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
508 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
509 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
510 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
511 ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'],
512 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
513 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
514 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
515 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
516 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
517 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
518 # if_tunnel.h is buggy and cannot be included on its own
519 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
520 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
521 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
522 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
523 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
524 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
525 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
526 ['IPVLAN_F_PRIVATE', 'linux/if_link.h'],
527 ['NDA_IFINDEX', 'linux/neighbour.h'],
528 ['IFA_FLAGS', 'linux/if_addr.h'],
529 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
530 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
531 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
533 prefix = decl.length() > 2 ? decl[2] : ''
534 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
535 conf.set10('HAVE_' + decl[0], have)
538 foreach ident : ['secure_getenv', '__secure_getenv']
539 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
543 ['memfd_create', '''#include <sys/mman.h>'''],
544 ['gettid', '''#include <sys/types.h>
545 // #include <unistd.h>'''],
546 ['pivot_root', '''#include <stdlib.h>
547 #include <unistd.h>'''], # no known header declares pivot_root
548 ['name_to_handle_at', '''#include <sys/types.h>
549 #include <sys/stat.h>
550 #include <fcntl.h>'''],
551 ['setns', '''#include <sched.h>'''],
552 ['renameat2', '''#include <stdio.h>
553 // #include <fcntl.h>'''],
554 ['kcmp', '''#include <linux/kcmp.h>'''],
555 ['keyctl', '''#include <sys/types.h>
556 #include <keyutils.h>'''],
557 ['copy_file_range', '''#include <sys/syscall.h>
558 #include <unistd.h>'''],
559 ['bpf', '''#include <sys/syscall.h>
560 #include <unistd.h>'''],
561 ['explicit_bzero' , '''#include <string.h>'''],
564 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
565 conf.set10('HAVE_' + ident[0].to_upper(), have)
568 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
569 conf.set10('USE_SYS_RANDOM_H', true)
570 conf.set10('HAVE_GETRANDOM', true)
572 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
573 conf.set10('USE_SYS_RANDOM_H', false)
574 conf.set10('HAVE_GETRANDOM', have)
577 #####################################################################
579 sed = find_program('sed')
580 awk = find_program('awk')
581 m4 = find_program('m4')
582 stat = find_program('stat')
583 git = find_program('git', required : false)
585 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
586 #if 1 /// Needed by elogind
587 meson_symlink_headers = meson.source_root() + '/tools/meson-symlink_headers.sh'
589 mkdir_p = 'mkdir -p $DESTDIR/@0@'
590 #if 0 /// unneeded by elogind
591 # test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
592 # splash_bmp = files('test/splash.bmp')
595 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
596 # /usr/sbin, /sbin, and fall back to the default from middle column.
597 #if 0 /// elogind has a bit different list and some adaptions
598 # progs = [['quotaon', '/usr/sbin/quotaon' ],
599 # ['quotacheck', '/usr/sbin/quotacheck' ],
600 # ['kill', '/usr/bin/kill' ],
601 # ['kmod', '/usr/bin/kmod' ],
602 # ['kexec', '/usr/sbin/kexec' ],
603 # ['sulogin', '/usr/sbin/sulogin' ],
604 # ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
605 # ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
606 # ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
607 # ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
610 progs = [['kexec', '/usr/sbin/kexec', 'KEXEC'],
611 ['reboot', '/sbin/reboot', 'REBOOT'],
612 ['halt', '/sbin/halt', 'HALT'],
616 path = get_option(prog[0] + '-path')
618 message('Using @1@ for @0@'.format(prog[0], path))
620 exe = find_program(prog[0],
621 '/usr/sbin/' + prog[0],
624 path = exe.found() ? exe.path() : prog[1]
626 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
627 conf.set_quoted(name, path)
628 substs.set(name, path)
631 conf.set_quoted('TELINIT', get_option('telinit-path'))
633 if run_command('ln', '--relative', '--help').returncode() != 0
634 error('ln does not support --relative')
637 ############################################################
639 gperf = find_program('gperf')
641 gperf_test_format = '''
643 const char * in_word_set(const char *, @0@);
646 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
647 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
648 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
649 if cc.compiles(gperf_test)
650 gperf_len_type = 'size_t'
652 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
653 if cc.compiles(gperf_test)
654 gperf_len_type = 'unsigned'
656 error('unable to determine gperf len type')
659 message('gperf len type is @0@'.format(gperf_len_type))
660 conf.set('GPERF_LEN_TYPE', gperf_len_type,
661 description : 'The type of gperf "len" parameter')
663 ############################################################
665 if not cc.has_header('sys/capability.h')
666 error('POSIX caps headers not found')
668 foreach header : ['crypt.h',
671 'linux/vm_sockets.h',
673 'valgrind/memcheck.h',
674 'valgrind/valgrind.h',
677 conf.set10('HAVE_' + header.underscorify().to_upper(),
678 cc.has_header(header))
681 ############################################################
683 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
684 #if 0 /// UNNEEDED by elogind
685 # conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
686 # gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
689 default_hierarchy = get_option('default-hierarchy')
690 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
691 description : 'default cgroup hierarchy as string')
692 if default_hierarchy == 'legacy'
693 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
694 elif default_hierarchy == 'hybrid'
695 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
697 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
700 #if 0 /// UNNEEDED by elogind
701 # time_epoch = get_option('time-epoch')
702 # if time_epoch == ''
703 # NEWS = files('NEWS')
704 # time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
706 # time_epoch = time_epoch.to_int()
707 # conf.set('TIME_EPOCH', time_epoch)
709 ############################################################
710 # elogind needs to know which cgroups controller to follow.
711 get_cg_ctrl_sh = find_program('tools/meson-get-cg-controller.sh')
712 with_cgroupctrl = get_option('cgroup-controller')
713 if with_cgroupctrl == '' or with_cgroupctrl == 'auto'
714 with_cgroupctrl = run_command(get_cg_ctrl_sh, []).stdout().strip()
715 elif with_cgroupctrl == 'none'
716 with_cgroupctrl = 'elogind'
719 # No controller now is a problem:
720 if with_cgroupctrl == ''
721 error('Unable to determine cgroup controller, but cgroups support is mandatory!')
724 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER', '_'.join(['',with_cgroupctrl]),
725 description : 'name of the cgroup controller to use')
726 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_LEGACY',
727 '='.join(['name', with_cgroupctrl]))
728 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_HYBRID',
729 '='.join(['name', with_cgroupctrl]))
730 ############################################################
733 system_uid_max = get_option('system-uid-max')
734 if system_uid_max == ''
735 system_uid_max = run_command(
737 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
738 '/etc/login.defs').stdout()
740 system_uid_max = system_uid_max.to_int()
741 conf.set('SYSTEM_UID_MAX', system_uid_max)
742 substs.set('systemuidmax', system_uid_max)
743 message('maximum system UID is @0@'.format(system_uid_max))
745 system_gid_max = get_option('system-gid-max')
746 if system_gid_max == ''
747 system_gid_max = run_command(
749 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
750 '/etc/login.defs').stdout()
752 system_gid_max = system_gid_max.to_int()
753 conf.set('SYSTEM_GID_MAX', system_gid_max)
754 substs.set('systemgidmax', system_gid_max)
755 message('maximum system GID is @0@'.format(system_gid_max))
757 #if 0 /// UNNEEDED by elogind
758 # dynamic_uid_min = get_option('dynamic-uid-min').to_int()
759 # dynamic_uid_max = get_option('dynamic-uid-max').to_int()
760 # conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
761 # conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
762 # substs.set('dynamicuidmin', dynamic_uid_min)
763 # substs.set('dynamicuidmax', dynamic_uid_max)
765 # container_uid_base_min = get_option('container-uid-base-min').to_int()
766 # container_uid_base_max = get_option('container-uid-base-max').to_int()
767 # conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
768 # conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
769 # substs.set('containeruidbasemin', container_uid_base_min)
770 # substs.set('containeruidbasemax', container_uid_base_max)
773 nobody_user = get_option('nobody-user')
774 nobody_group = get_option('nobody-group')
776 getent_result = run_command('getent', 'passwd', '65534')
777 if getent_result.returncode() == 0
778 name = getent_result.stdout().split(':')[0]
779 if name != nobody_user
780 message('WARNING:\n' +
781 ' 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) +
782 ' Your build will result in an user table setup that is incompatible with the local system.')
785 id_result = run_command('id', '-u', nobody_user)
786 if id_result.returncode() == 0
787 id = id_result.stdout().to_int()
789 message('WARNING:\n' +
790 ' 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) +
791 ' Your build will result in an user table setup that is incompatible with the local system.')
795 getent_result = run_command('getent', 'group', '65534')
796 if getent_result.returncode() == 0
797 name = getent_result.stdout().split(':')[0]
798 if name != nobody_group
799 message('WARNING:\n' +
800 ' 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) +
801 ' Your build will result in an group table setup that is incompatible with the local system.')
804 id_result = run_command('id', '-g', nobody_group)
805 if id_result.returncode() == 0
806 id = id_result.stdout().to_int()
808 message('WARNING:\n' +
809 ' 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) +
810 ' Your build will result in an group table setup that is incompatible with the local system.')
813 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
814 message('WARNING:\n' +
815 ' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
816 ' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
819 conf.set_quoted('NOBODY_USER_NAME', nobody_user)
820 conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
821 substs.set('NOBODY_USER_NAME', nobody_user)
822 substs.set('NOBODY_GROUP_NAME', nobody_group)
824 tty_gid = get_option('tty-gid')
825 conf.set('TTY_GID', tty_gid)
826 substs.set('TTY_GID', tty_gid)
828 #if 0 /// UNNEEDED by elogind
829 # # Ensure provided GID argument is numeric, otherwise fallback to default assignment
830 # if get_option('users-gid') != ''
831 # users_gid = get_option('users-gid').to_int()
835 # substs.set('USERS_GID', users_gid)
837 # if get_option('adm-group')
838 # m4_defines += ['-DENABLE_ADM_GROUP']
841 # if get_option('wheel-group')
842 # m4_defines += ['-DENABLE_WHEEL_GROUP']
845 # substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
846 # substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
849 kill_user_processes = get_option('default-kill-user-processes')
850 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
851 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
853 #if 0 /// UNNEEDED by elogind
854 # dns_servers = get_option('dns-servers')
855 # conf.set_quoted('DNS_SERVERS', dns_servers)
856 # substs.set('DNS_SERVERS', dns_servers)
858 # ntp_servers = get_option('ntp-servers')
859 # conf.set_quoted('NTP_SERVERS', ntp_servers)
860 # substs.set('NTP_SERVERS', ntp_servers)
863 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
865 #if 0 /// UNNEEDED by elogind
866 # substs.set('SUSHELL', get_option('debug-shell'))
867 # substs.set('DEBUGTTY', get_option('debug-tty'))
870 debug = get_option('debug')
871 enable_debug_hashmap = false
872 enable_debug_mmap_cache = false
873 #if 1 /// additional elogind debug mode
874 enable_debug_elogind = false
877 foreach name : debug.split(',')
879 enable_debug_hashmap = true
880 elif name == 'mmap-cache'
881 enable_debug_mmap_cache = true
882 #if 1 /// additional elogind debug mode
883 elif name == 'elogind'
884 enable_debug_elogind = true
887 message('unknown debug option "@0@", ignoring'.format(name))
891 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
892 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
893 #if 1 /// additional elogind debug mode
894 conf.set10('ENABLE_DEBUG_ELOGIND', enable_debug_elogind)
897 #####################################################################
899 threads = dependency('threads')
900 librt = cc.find_library('rt')
901 libm = cc.find_library('m')
902 libdl = cc.find_library('dl')
903 libcrypt = cc.find_library('crypt')
905 libcap = dependency('libcap', required : false)
906 if not libcap.found()
907 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
908 libcap = cc.find_library('cap')
911 #if 0 /// UNNEEDED by elogind
912 # libmount = dependency('mount',
913 # version : '>= 2.30',
914 # required : not fuzzer_build)
916 # want_seccomp = get_option('seccomp')
917 # if want_seccomp != 'false' and not fuzzer_build
918 # libseccomp = dependency('libseccomp',
919 # version : '>= 2.3.1',
920 # required : want_seccomp == 'true')
921 # have = libseccomp.found()
929 conf.set10('HAVE_SECCOMP', have)
930 m4_defines += have ? ['-DHAVE_SECCOMP'] : []
932 want_selinux = get_option('selinux')
933 if want_selinux != 'false' and not fuzzer_build
934 libselinux = dependency('libselinux',
935 version : '>= 2.1.9',
936 required : want_selinux == 'true')
937 have = libselinux.found()
942 conf.set10('HAVE_SELINUX', have)
943 m4_defines += have ? ['-DHAVE_SELINUX'] : []
945 #if 0 /// UNNEEDED by elogind
946 # want_apparmor = get_option('apparmor')
947 # if want_apparmor != 'false' and not fuzzer_build
948 # libapparmor = dependency('libapparmor',
949 # required : want_apparmor == 'true')
950 # have = libapparmor.found()
958 conf.set10('HAVE_APPARMOR', have)
959 m4_defines += have ? ['-DHAVE_APPARMOR'] : []
961 smack_run_label = get_option('smack-run-label')
962 if smack_run_label != ''
963 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
964 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
967 want_polkit = get_option('polkit')
968 install_polkit = false
969 install_polkit_pkla = false
970 if want_polkit != 'false' and not fuzzer_build
971 install_polkit = true
973 libpolkit = dependency('polkit-gobject-1',
975 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
976 message('Old polkit detected, will install pkla files')
977 install_polkit_pkla = true
980 conf.set10('ENABLE_POLKIT', install_polkit)
982 want_acl = get_option('acl')
983 if want_acl != 'false' and not fuzzer_build
984 libacl = cc.find_library('acl', required : want_acl == 'true')
985 have = libacl.found()
990 conf.set10('HAVE_ACL', have)
991 m4_defines += have ? ['-DHAVE_ACL'] : []
993 want_audit = get_option('audit')
994 if want_audit != 'false' and not fuzzer_build
995 libaudit = dependency('audit', required : want_audit == 'true')
996 have = libaudit.found()
1001 conf.set10('HAVE_AUDIT', have)
1003 #if 0 /// UNNEEDED by elogind
1004 # want_blkid = get_option('blkid')
1005 # if want_blkid != 'false' and not fuzzer_build
1006 # libblkid = dependency('blkid', required : want_blkid == 'true')
1007 # have = libblkid.found()
1012 # conf.set10('HAVE_BLKID', have)
1014 # want_kmod = get_option('kmod')
1015 # if want_kmod != 'false' and not fuzzer_build
1016 # libkmod = dependency('libkmod',
1017 # version : '>= 15',
1018 # required : want_kmod == 'true')
1019 # have = libkmod.found()
1024 # conf.set10('HAVE_KMOD', have)
1030 want_pam = get_option('pam')
1031 if want_pam != 'false' and not fuzzer_build
1032 libpam = cc.find_library('pam', required : want_pam == 'true')
1033 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
1034 have = libpam.found() and libpam_misc.found()
1040 conf.set10('HAVE_PAM', have)
1041 m4_defines += have ? ['-DHAVE_PAM'] : []
1043 #if 0 /// UNNEEDED by elogind
1044 # want_microhttpd = get_option('microhttpd')
1045 # if want_microhttpd != 'false' and not fuzzer_build
1046 # libmicrohttpd = dependency('libmicrohttpd',
1047 # version : '>= 0.9.33',
1048 # required : want_microhttpd == 'true')
1049 # have = libmicrohttpd.found()
1052 # libmicrohttpd = []
1054 # conf.set10('HAVE_MICROHTTPD', have)
1055 # m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
1057 # want_libcryptsetup = get_option('libcryptsetup')
1058 # if want_libcryptsetup != 'false' and not fuzzer_build
1059 # libcryptsetup = dependency('libcryptsetup',
1060 # version : '>= 1.6.0',
1061 # required : want_libcryptsetup == 'true')
1062 # have = libcryptsetup.found()
1065 # libcryptsetup = []
1067 # conf.set10('HAVE_LIBCRYPTSETUP', have)
1069 # want_libcurl = get_option('libcurl')
1070 # if want_libcurl != 'false' and not fuzzer_build
1071 # libcurl = dependency('libcurl',
1072 # version : '>= 7.32.0',
1073 # required : want_libcurl == 'true')
1074 # have = libcurl.found()
1079 # conf.set10('HAVE_LIBCURL', have)
1080 # m4_defines += have ? ['-DHAVE_LIBCURL'] : []
1082 # want_libidn = get_option('libidn')
1083 # want_libidn2 = get_option('libidn2')
1084 # if want_libidn == 'true' and want_libidn2 == 'true'
1085 # error('libidn and libidn2 cannot be requested simultaneously')
1088 # if want_libidn != 'false' and want_libidn2 != 'true' and not fuzzer_build
1089 # libidn = dependency('libidn',
1090 # required : want_libidn == 'true')
1091 # have = libidn.found()
1096 # conf.set10('HAVE_LIBIDN', have)
1097 # m4_defines += have ? ['-DHAVE_LIBIDN'] : []
1098 # if not have and want_libidn2 != 'false' and not fuzzer_build
1099 # # libidn is used for both libidn and libidn2 objects
1100 # libidn = dependency('libidn2',
1101 # required : want_libidn2 == 'true')
1102 # have = libidn.found()
1106 # conf.set10('HAVE_LIBIDN2', have)
1107 # m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
1109 # want_libiptc = get_option('libiptc')
1110 # if want_libiptc != 'false' and not fuzzer_build
1111 # libiptc = dependency('libiptc',
1112 # required : want_libiptc == 'true')
1113 # have = libiptc.found()
1118 # conf.set10('HAVE_LIBIPTC', have)
1119 # m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
1121 # want_qrencode = get_option('qrencode')
1122 # if want_qrencode != 'false' and not fuzzer_build
1123 # libqrencode = dependency('libqrencode',
1124 # required : want_qrencode == 'true')
1125 # have = libqrencode.found()
1130 # conf.set10('HAVE_QRENCODE', have)
1132 # want_gcrypt = get_option('gcrypt')
1133 # if want_gcrypt != 'false' and not fuzzer_build
1134 # libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
1135 # libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
1136 # have = libgcrypt.found() and libgpg_error.found()
1141 # # link to neither of the libs if one is not found
1145 # conf.set10('HAVE_GCRYPT', have)
1147 # want_gnutls = get_option('gnutls')
1148 # if want_gnutls != 'false' and not fuzzer_build
1149 # libgnutls = dependency('gnutls',
1150 # version : '>= 3.1.4',
1151 # required : want_gnutls == 'true')
1152 # have = libgnutls.found()
1157 # conf.set10('HAVE_GNUTLS', have)
1159 # want_elfutils = get_option('elfutils')
1160 # if want_elfutils != 'false' and not fuzzer_build
1161 # libdw = dependency('libdw',
1162 # required : want_elfutils == 'true')
1163 # have = libdw.found()
1168 # conf.set10('HAVE_ELFUTILS', have)
1170 # want_zlib = get_option('zlib')
1171 # if want_zlib != 'false' and not fuzzer_build
1172 # libz = dependency('zlib',
1173 # required : want_zlib == 'true')
1174 # have = libz.found()
1179 # conf.set10('HAVE_ZLIB', have)
1181 # want_bzip2 = get_option('bzip2')
1182 # if want_bzip2 != 'false' and not fuzzer_build
1183 # libbzip2 = cc.find_library('bz2',
1184 # required : want_bzip2 == 'true')
1185 # have = libbzip2.found()
1190 # conf.set10('HAVE_BZIP2', have)
1192 # want_xz = get_option('xz')
1193 # if want_xz != 'false' and not fuzzer_build
1194 # libxz = dependency('liblzma',
1195 # required : want_xz == 'true')
1196 # have = libxz.found()
1201 # conf.set10('HAVE_XZ', have)
1203 # want_lz4 = get_option('lz4')
1204 # if want_lz4 != 'false' and not fuzzer_build
1205 # liblz4 = dependency('liblz4',
1206 # required : want_lz4 == 'true')
1207 # have = liblz4.found()
1212 # conf.set10('HAVE_LZ4', have)
1214 # want_xkbcommon = get_option('xkbcommon')
1215 # if want_xkbcommon != 'false' and not fuzzer_build
1216 # libxkbcommon = dependency('xkbcommon',
1217 # version : '>= 0.3.0',
1218 # required : want_xkbcommon == 'true')
1219 # have = libxkbcommon.found()
1241 conf.set10('HAVE_XKBCOMMON', have)
1243 want_glib = get_option('glib')
1244 if want_glib != 'false' and not fuzzer_build
1245 libglib = dependency('glib-2.0',
1246 version : '>= 2.22.0',
1247 required : want_glib == 'true')
1248 libgobject = dependency('gobject-2.0',
1249 version : '>= 2.22.0',
1250 required : want_glib == 'true')
1251 libgio = dependency('gio-2.0',
1252 required : want_glib == 'true')
1253 have = libglib.found() and libgobject.found() and libgio.found()
1260 conf.set10('HAVE_GLIB', have)
1262 want_dbus = get_option('dbus')
1263 if want_dbus != 'false' and not fuzzer_build
1264 libdbus = dependency('dbus-1',
1265 version : '>= 1.3.2',
1266 required : want_dbus == 'true')
1267 have = libdbus.found()
1272 conf.set10('HAVE_DBUS', have)
1274 #if 0 /// UNNEEDED by elogind
1275 # default_dnssec = get_option('default-dnssec')
1277 # default_dnssec = 'no'
1279 # if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1280 # message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1281 # default_dnssec = 'no'
1283 # conf.set('DEFAULT_DNSSEC_MODE',
1284 # 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1285 # substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1287 # want_importd = get_option('importd')
1288 # if want_importd != 'false'
1289 # have = (conf.get('HAVE_LIBCURL') == 1 and
1290 # conf.get('HAVE_ZLIB') == 1 and
1291 # conf.get('HAVE_BZIP2') == 1 and
1292 # conf.get('HAVE_XZ') == 1 and
1293 # conf.get('HAVE_GCRYPT') == 1)
1294 # if want_importd == 'true' and not have
1295 # error('importd support was requested, but dependencies are not available')
1300 # conf.set10('ENABLE_IMPORTD', have)
1302 # want_remote = get_option('remote')
1303 # if want_remote != 'false'
1304 # have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1305 # conf.get('HAVE_LIBCURL') == 1]
1306 # # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1307 # # it's possible to build one without the other. Complain only if
1308 # # support was explictly requested. The auxiliary files like sysusers
1309 # # config should be installed when any of the programs are built.
1310 # if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1311 # error('remote support was requested, but dependencies are not available')
1313 # have = have_deps[0] or have_deps[1]
1318 conf.set10('ENABLE_REMOTE', have)
1320 foreach term : ['utmp',
1321 #if 0 /// UNNEEDED by elogind
1355 have = get_option(term)
1356 name = 'ENABLE_' + term.underscorify().to_upper()
1357 conf.set10(name, have)
1358 m4_defines += have ? ['-D' + name] : []
1361 want_tests = get_option('tests')
1362 install_tests = get_option('install-tests')
1366 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1368 #####################################################################
1370 #if 0 /// UNNEEDED by elogind
1371 # if get_option('efi')
1372 # efi_arch = host_machine.cpu_family()
1374 # if efi_arch == 'x86'
1375 # EFI_MACHINE_TYPE_NAME = 'ia32'
1376 # gnu_efi_arch = 'ia32'
1377 # elif efi_arch == 'x86_64'
1378 # EFI_MACHINE_TYPE_NAME = 'x64'
1379 # gnu_efi_arch = 'x86_64'
1380 # elif efi_arch == 'arm'
1381 # EFI_MACHINE_TYPE_NAME = 'arm'
1382 # gnu_efi_arch = 'arm'
1383 # elif efi_arch == 'aarch64'
1384 # EFI_MACHINE_TYPE_NAME = 'aa64'
1385 # gnu_efi_arch = 'aarch64'
1387 # EFI_MACHINE_TYPE_NAME = ''
1392 # conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1394 # conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1399 conf.set10('ENABLE_EFI', have)
1401 #####################################################################
1403 config_h = configure_file(
1404 output : 'config.h',
1405 configuration : conf)
1407 includes = include_directories('src/basic',
1410 #if 0 /// UNNEEDED by elogind
1416 #if 0 /// UNNEEDED by elogind
1421 #if 0 /// elogind has a different list
1422 # 'src/libsystemd/sd-bus',
1423 # 'src/libsystemd/sd-device',
1424 # 'src/libsystemd/sd-hwdb',
1425 # 'src/libsystemd/sd-id128',
1426 # 'src/libsystemd/sd-netlink',
1427 # 'src/libsystemd/sd-network',
1428 # 'src/libsystemd-network',
1431 'src/libelogind/sd-bus',
1432 'src/libelogind/sd-id128',
1437 add_project_arguments('-include', 'config.h', language : 'c')
1439 #if 0 /// UNNEEDED by elogind
1442 #if 0 /// UNNEEDED by elogind
1445 subdir('src/systemd')
1447 #if 0 /// UNNEEDED by elogind
1448 # subdir('src/libsystemd')
1449 # subdir('src/libsystemd-network')
1450 # subdir('src/journal')
1453 subdir('src/libelogind')
1455 subdir('src/update-utmp')
1459 #if 0 /// UNNEEDED by elogind
1460 # libjournal_core = static_library(
1462 # libjournal_core_sources,
1464 # include_directories : includes,
1467 # libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1468 # libsystemd = shared_library(
1470 # 'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug
1471 # version : libsystemd_version,
1472 # include_directories : includes,
1473 # link_args : ['-shared',
1474 # '-Wl,--version-script=' + libsystemd_sym_path],
1475 # link_with : [libbasic,
1477 # link_whole : [libsystemd_static,
1478 # libjournal_client],
1479 # dependencies : [threads,
1483 # link_depends : libsystemd_sym,
1485 # install_dir : rootlibdir)
1487 libelogind_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libelogind_sym)
1488 libelogind = shared_library(
1490 libelogind_internal_sources,
1491 version : libelogind_version,
1492 include_directories : includes,
1493 link_args : ['-shared',
1494 '-Wl,--version-script=' + libelogind_sym_path],
1495 link_with : [libbasic],
1496 dependencies : [threads],
1497 link_depends : libelogind_sym,
1499 install_dir : rootlibdir)
1502 ############################################################
1504 # binaries that have --help and are intended for use by humans,
1505 # usually, but not always, installed in /bin.
1506 public_programs = []
1508 #if 0 /// UNNEEDED by elogind
1509 # subdir('src/libudev')
1511 # elogind depends on external libudev:
1512 libudev = dependency('libudev', required : true)
1514 subdir('src/shared')
1515 #if 0 /// UNNEEDED by elogind
1516 # subdir('src/core')
1517 # subdir('src/udev')
1518 # subdir('src/network')
1520 # subdir('src/analyze')
1521 # subdir('src/journal-remote')
1522 # subdir('src/coredump')
1523 # subdir('src/hostname')
1524 # subdir('src/import')
1525 # subdir('src/kernel-install')
1526 # subdir('src/locale')
1527 # subdir('src/machine')
1528 # subdir('src/nspawn')
1529 # subdir('src/resolve')
1530 # subdir('src/timedate')
1531 # subdir('src/timesync')
1532 # subdir('src/vconsole')
1533 # subdir('src/boot/efi')
1538 #if 0 /// UNNEEDED in elogind
1543 ############################################################
1545 # only static linking apart from libdl, to make sure that the
1546 # module is linked to all libraries that it uses.
1547 test_dlopen = executable(
1550 include_directories : includes,
1551 link_with : [libbasic],
1552 dependencies : [libdl])
1554 #if 0 /// UNNEEDED by elogind
1555 # foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
1556 # ['systemd', 'ENABLE_NSS_SYSTEMD'],
1557 # ['mymachines', 'ENABLE_MACHINED'],
1558 # ['resolve', 'ENABLE_RESOLVE']]
1560 # condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1564 # sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1565 # version_script_arg = join_paths(meson.current_source_dir(), sym)
1567 # nss = shared_library(
1569 # 'src/nss-@0@/nss-@0@.c'.format(module),
1571 # include_directories : includes,
1572 # # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1573 # link_args : ['-Wl,-z,nodelete',
1575 # '-Wl,--version-script=' + version_script_arg,
1576 # '-Wl,--undefined'],
1577 # link_with : [libsystemd_static,
1579 # dependencies : [threads,
1581 # link_depends : sym,
1583 # install_dir : rootlibdir)
1585 # # We cannot use shared_module because it does not support version suffix.
1586 # # Unfortunately shared_library insists on creating the symlink…
1587 # meson.add_install_script('sh', '-c',
1588 # 'rm $DESTDIR@0@/libnss_@1@.so'
1589 # .format(rootlibdir, module))
1591 # test('dlopen-nss_' + module,
1593 # args : [nss.full_path()]) # path to dlopen must include a slash
1598 ############################################################
1600 #if 0 /// UNNEEDED by elogind
1601 # executable('systemd',
1603 # include_directories : includes,
1604 # link_with : [libcore,
1606 # dependencies : [threads,
1612 # install_rpath : rootlibexecdir,
1614 # install_dir : rootlibexecdir)
1616 # exe = executable('systemd-analyze',
1617 # systemd_analyze_sources,
1618 # include_directories : includes,
1619 # link_with : [libcore,
1621 # dependencies : [threads,
1627 # install_rpath : rootlibexecdir,
1629 # public_programs += [exe]
1631 # executable('systemd-journald',
1632 # systemd_journald_sources,
1633 # include_directories : includes,
1634 # link_with : [libjournal_core,
1636 # dependencies : [threads,
1640 # install_rpath : rootlibexecdir,
1642 # install_dir : rootlibexecdir)
1644 # exe = executable('systemd-cat',
1645 # systemd_cat_sources,
1646 # include_directories : includes,
1647 # link_with : [libjournal_core,
1649 # dependencies : [threads],
1650 # install_rpath : rootlibexecdir,
1652 # public_programs += [exe]
1654 # exe = executable('journalctl',
1655 # journalctl_sources,
1656 # include_directories : includes,
1657 # link_with : [libshared],
1658 # dependencies : [threads,
1662 # install_rpath : rootlibexecdir,
1664 # install_dir : rootbindir)
1665 # public_programs += [exe]
1667 # executable('systemd-getty-generator',
1668 # 'src/getty-generator/getty-generator.c',
1669 # include_directories : includes,
1670 # link_with : [libshared],
1671 # install_rpath : rootlibexecdir,
1673 # install_dir : systemgeneratordir)
1675 # executable('systemd-debug-generator',
1676 # 'src/debug-generator/debug-generator.c',
1677 # include_directories : includes,
1678 # link_with : [libshared],
1679 # install_rpath : rootlibexecdir,
1681 # install_dir : systemgeneratordir)
1683 # executable('systemd-fstab-generator',
1684 # 'src/fstab-generator/fstab-generator.c',
1685 # 'src/core/mount-setup.c',
1686 # include_directories : includes,
1687 # link_with : [libshared],
1688 # install_rpath : rootlibexecdir,
1690 # install_dir : systemgeneratordir)
1692 # if conf.get('ENABLE_ENVIRONMENT_D') == 1
1693 # executable('30-systemd-environment-d-generator',
1694 # 'src/environment-d-generator/environment-d-generator.c',
1695 # include_directories : includes,
1696 # link_with : [libshared],
1697 # install_rpath : rootlibexecdir,
1699 # install_dir : userenvgeneratordir)
1701 # meson.add_install_script(meson_make_symlink,
1702 # join_paths(sysconfdir, 'environment'),
1703 # join_paths(environmentdir, '99-environment.conf'))
1706 # if conf.get('ENABLE_HIBERNATE') == 1
1707 # executable('systemd-hibernate-resume-generator',
1708 # 'src/hibernate-resume/hibernate-resume-generator.c',
1709 # include_directories : includes,
1710 # link_with : [libshared],
1711 # install_rpath : rootlibexecdir,
1713 # install_dir : systemgeneratordir)
1715 # executable('systemd-hibernate-resume',
1716 # 'src/hibernate-resume/hibernate-resume.c',
1717 # include_directories : includes,
1718 # link_with : [libshared],
1719 # install_rpath : rootlibexecdir,
1721 # install_dir : rootlibexecdir)
1724 # if conf.get('HAVE_BLKID') == 1
1725 # executable('systemd-gpt-auto-generator',
1726 # 'src/gpt-auto-generator/gpt-auto-generator.c',
1727 # 'src/basic/blkid-util.h',
1728 # include_directories : includes,
1729 # link_with : [libshared],
1730 # dependencies : libblkid,
1731 # install_rpath : rootlibexecdir,
1733 # install_dir : systemgeneratordir)
1735 # exe = executable('systemd-dissect',
1736 # 'src/dissect/dissect.c',
1737 # include_directories : includes,
1738 # link_with : [libshared],
1739 # install_rpath : rootlibexecdir,
1741 # install_dir : rootlibexecdir)
1742 # public_programs += [exe]
1745 # if conf.get('ENABLE_RESOLVE') == 1
1746 # executable('systemd-resolved',
1747 # systemd_resolved_sources,
1748 # include_directories : includes,
1749 # link_with : [libshared,
1751 # libsystemd_resolve_core],
1752 # dependencies : [threads,
1756 # install_rpath : rootlibexecdir,
1758 # install_dir : rootlibexecdir)
1760 # exe = executable('systemd-resolve',
1761 # systemd_resolve_sources,
1762 # include_directories : includes,
1763 # link_with : [libshared,
1765 # libsystemd_resolve_core],
1766 # dependencies : [threads,
1770 # install_rpath : rootlibexecdir,
1772 # public_programs += [exe]
1775 # if conf.get('ENABLE_LOGIND') == 1
1776 # executable('systemd-logind',
1777 # systemd_logind_sources,
1778 # include_directories : includes,
1779 # link_with : [liblogind_core,
1781 # dependencies : [threads,
1783 # install_rpath : rootlibexecdir,
1785 # install_dir : rootlibexecdir)
1787 # exe = executable('loginctl',
1789 # include_directories : includes,
1790 # link_with : [libshared],
1791 # dependencies : [threads,
1794 # install_rpath : rootlibexecdir,
1796 # install_dir : rootbindir)
1797 # public_programs += [exe]
1799 # exe = executable('systemd-inhibit',
1800 # 'src/login/inhibit.c',
1801 # include_directories : includes,
1802 # link_with : [libshared],
1803 # install_rpath : rootlibexecdir,
1805 # install_dir : rootbindir)
1806 # public_programs += [exe]
1808 # if conf.get('HAVE_PAM') == 1
1809 # version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1810 # pam_systemd = shared_library(
1814 # include_directories : includes,
1815 # link_args : ['-shared',
1816 # '-Wl,--version-script=' + version_script_arg],
1817 # link_with : [libsystemd_static,
1818 # libshared_static],
1819 # dependencies : [threads,
1822 # link_depends : pam_systemd_sym,
1824 # install_dir : pamlibdir)
1826 # test('dlopen-pam_systemd',
1828 # args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1833 executable('elogind',
1835 include_directories : includes,
1836 link_with : [liblogind_core,
1838 dependencies : [threads,
1841 install_rpath : rootlibexecdir,
1843 install_dir : rootlibexecdir)
1845 exe = executable('loginctl',
1847 include_directories : includes,
1848 link_with : [libshared],
1849 dependencies : [threads,
1851 install_rpath : rootlibexecdir,
1853 install_dir : rootbindir)
1854 public_programs += [exe]
1856 exe = executable('elogind-inhibit',
1857 'src/login/inhibit.c',
1858 include_directories : includes,
1859 link_with : [libshared],
1860 dependencies : [threads],
1861 install_rpath : rootlibexecdir,
1863 install_dir : rootbindir)
1864 public_programs += [exe]
1866 if conf.get('HAVE_PAM') == 1
1867 version_script_arg = join_paths(meson.current_source_dir(), pam_elogind_sym)
1868 pam_elogind = shared_library(
1872 include_directories : includes,
1873 link_args : ['-shared',
1874 '-Wl,--version-script=' + version_script_arg],
1875 link_with : [libelogind,
1877 dependencies : [threads,
1880 link_depends : pam_elogind_sym,
1882 install_dir : pamlibdir)
1884 test('dlopen-pam_elogind',
1886 args : [pam_elogind.full_path()]) # path to dlopen must include a slash
1889 #if 0 /// UNNEEDED by elogind
1890 # executable('systemd-user-sessions',
1891 # 'src/user-sessions/user-sessions.c',
1892 # include_directories : includes,
1893 # link_with : [libshared],
1894 # install_rpath : rootlibexecdir,
1896 # install_dir : rootlibexecdir)
1899 # if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1900 # exe = executable('bootctl',
1901 # 'src/boot/bootctl.c',
1902 # include_directories : includes,
1903 # link_with : [libshared],
1904 # dependencies : [libblkid],
1905 # install_rpath : rootlibexecdir,
1907 # public_programs += [exe]
1910 # exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1911 # include_directories : includes,
1912 # link_with : [libshared],
1913 # dependencies : [threads],
1914 # install_rpath : rootlibexecdir,
1916 # public_programs += [exe]
1918 # exe = executable('systemctl', 'src/systemctl/systemctl.c',
1919 # include_directories : includes,
1920 # link_with : [libshared],
1921 # dependencies : [threads,
1926 # install_rpath : rootlibexecdir,
1928 # install_dir : rootbindir)
1929 # public_programs += [exe]
1931 # if conf.get('ENABLE_BACKLIGHT') == 1
1932 # executable('systemd-backlight',
1933 # 'src/backlight/backlight.c',
1934 # include_directories : includes,
1935 # link_with : [libshared],
1936 # install_rpath : rootlibexecdir,
1938 # install_dir : rootlibexecdir)
1941 # if conf.get('ENABLE_RFKILL') == 1
1942 # executable('systemd-rfkill',
1943 # 'src/rfkill/rfkill.c',
1944 # include_directories : includes,
1945 # link_with : [libshared],
1946 # install_rpath : rootlibexecdir,
1948 # install_dir : rootlibexecdir)
1951 # executable('systemd-system-update-generator',
1952 # 'src/system-update-generator/system-update-generator.c',
1953 # include_directories : includes,
1954 # link_with : [libshared],
1955 # install_rpath : rootlibexecdir,
1957 # install_dir : systemgeneratordir)
1959 # if conf.get('HAVE_LIBCRYPTSETUP') == 1
1960 # executable('systemd-cryptsetup',
1961 # 'src/cryptsetup/cryptsetup.c',
1962 # include_directories : includes,
1963 # link_with : [libshared],
1964 # dependencies : [libcryptsetup],
1965 # install_rpath : rootlibexecdir,
1967 # install_dir : rootlibexecdir)
1969 # executable('systemd-cryptsetup-generator',
1970 # 'src/cryptsetup/cryptsetup-generator.c',
1971 # include_directories : includes,
1972 # link_with : [libshared],
1973 # dependencies : [libcryptsetup],
1974 # install_rpath : rootlibexecdir,
1976 # install_dir : systemgeneratordir)
1978 # executable('systemd-veritysetup',
1979 # 'src/veritysetup/veritysetup.c',
1980 # include_directories : includes,
1981 # link_with : [libshared],
1982 # dependencies : [libcryptsetup],
1983 # install_rpath : rootlibexecdir,
1985 # install_dir : rootlibexecdir)
1987 # executable('systemd-veritysetup-generator',
1988 # 'src/veritysetup/veritysetup-generator.c',
1989 # include_directories : includes,
1990 # link_with : [libshared],
1991 # dependencies : [libcryptsetup],
1992 # install_rpath : rootlibexecdir,
1994 # install_dir : systemgeneratordir)
1997 # if conf.get('HAVE_SYSV_COMPAT') == 1
1998 # executable('systemd-sysv-generator',
1999 # 'src/sysv-generator/sysv-generator.c',
2000 # include_directories : includes,
2001 # link_with : [libshared],
2002 # install_rpath : rootlibexecdir,
2004 # install_dir : systemgeneratordir)
2006 # executable('systemd-rc-local-generator',
2007 # 'src/rc-local-generator/rc-local-generator.c',
2008 # include_directories : includes,
2009 # link_with : [libshared],
2010 # install_rpath : rootlibexecdir,
2012 # install_dir : systemgeneratordir)
2015 # if conf.get('ENABLE_HOSTNAMED') == 1
2016 # executable('systemd-hostnamed',
2017 # 'src/hostname/hostnamed.c',
2018 # include_directories : includes,
2019 # link_with : [libshared],
2020 # install_rpath : rootlibexecdir,
2022 # install_dir : rootlibexecdir)
2024 # exe = executable('hostnamectl',
2025 # 'src/hostname/hostnamectl.c',
2026 # include_directories : includes,
2027 # link_with : [libshared],
2028 # install_rpath : rootlibexecdir,
2030 # public_programs += [exe]
2033 # if conf.get('ENABLE_LOCALED') == 1
2034 # if conf.get('HAVE_XKBCOMMON') == 1
2035 # # logind will load libxkbcommon.so dynamically on its own
2041 # executable('systemd-localed',
2042 # systemd_localed_sources,
2043 # include_directories : includes,
2044 # link_with : [libshared],
2045 # dependencies : deps,
2046 # install_rpath : rootlibexecdir,
2048 # install_dir : rootlibexecdir)
2050 # exe = executable('localectl',
2051 # localectl_sources,
2052 # include_directories : includes,
2053 # link_with : [libshared],
2054 # install_rpath : rootlibexecdir,
2056 # public_programs += [exe]
2059 # if conf.get('ENABLE_TIMEDATED') == 1
2060 # executable('systemd-timedated',
2061 # 'src/timedate/timedated.c',
2062 # include_directories : includes,
2063 # link_with : [libshared],
2064 # install_rpath : rootlibexecdir,
2066 # install_dir : rootlibexecdir)
2068 # exe = executable('timedatectl',
2069 # 'src/timedate/timedatectl.c',
2070 # include_directories : includes,
2071 # install_rpath : rootlibexecdir,
2072 # link_with : [libshared],
2074 # public_programs += [exe]
2077 # if conf.get('ENABLE_TIMESYNCD') == 1
2078 # executable('systemd-timesyncd',
2079 # systemd_timesyncd_sources,
2080 # include_directories : includes,
2081 # link_with : [libshared],
2082 # dependencies : [threads,
2084 # install_rpath : rootlibexecdir,
2086 # install_dir : rootlibexecdir)
2089 # if conf.get('ENABLE_MACHINED') == 1
2090 # executable('systemd-machined',
2091 # systemd_machined_sources,
2092 # include_directories : includes,
2093 # link_with : [libmachine_core,
2095 # install_rpath : rootlibexecdir,
2097 # install_dir : rootlibexecdir)
2099 # exe = executable('machinectl',
2100 # 'src/machine/machinectl.c',
2101 # include_directories : includes,
2102 # link_with : [libshared],
2103 # dependencies : [threads,
2106 # install_rpath : rootlibexecdir,
2108 # install_dir : rootbindir)
2109 # public_programs += [exe]
2112 # if conf.get('ENABLE_IMPORTD') == 1
2113 # executable('systemd-importd',
2114 # systemd_importd_sources,
2115 # include_directories : includes,
2116 # link_with : [libshared],
2117 # dependencies : [threads],
2118 # install_rpath : rootlibexecdir,
2120 # install_dir : rootlibexecdir)
2122 # systemd_pull = executable('systemd-pull',
2123 # systemd_pull_sources,
2124 # include_directories : includes,
2125 # link_with : [libshared],
2126 # dependencies : [libcurl,
2131 # install_rpath : rootlibexecdir,
2133 # install_dir : rootlibexecdir)
2135 # systemd_import = executable('systemd-import',
2136 # systemd_import_sources,
2137 # include_directories : includes,
2138 # link_with : [libshared],
2139 # dependencies : [libcurl,
2143 # install_rpath : rootlibexecdir,
2145 # install_dir : rootlibexecdir)
2147 # systemd_export = executable('systemd-export',
2148 # systemd_export_sources,
2149 # include_directories : includes,
2150 # link_with : [libshared],
2151 # dependencies : [libcurl,
2155 # install_rpath : rootlibexecdir,
2157 # install_dir : rootlibexecdir)
2158 # public_programs += [systemd_pull, systemd_import, systemd_export]
2161 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
2162 # exe = executable('systemd-journal-upload',
2163 # systemd_journal_upload_sources,
2164 # include_directories : includes,
2165 # link_with : [libshared],
2166 # dependencies : [threads,
2171 # install_rpath : rootlibexecdir,
2173 # install_dir : rootlibexecdir)
2174 # public_programs += [exe]
2177 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
2178 # s_j_remote = executable('systemd-journal-remote',
2179 # systemd_journal_remote_sources,
2180 # include_directories : includes,
2181 # link_with : [libshared],
2182 # dependencies : [threads,
2187 # install_rpath : rootlibexecdir,
2189 # install_dir : rootlibexecdir)
2191 # s_j_gatewayd = executable('systemd-journal-gatewayd',
2192 # systemd_journal_gatewayd_sources,
2193 # include_directories : includes,
2194 # link_with : [libshared],
2195 # dependencies : [threads,
2200 # install_rpath : rootlibexecdir,
2202 # install_dir : rootlibexecdir)
2203 # public_programs += [s_j_remote, s_j_gatewayd]
2206 # if conf.get('ENABLE_COREDUMP') == 1
2207 # executable('systemd-coredump',
2208 # systemd_coredump_sources,
2209 # include_directories : includes,
2210 # link_with : [libshared],
2211 # dependencies : [threads,
2216 # install_rpath : rootlibexecdir,
2218 # install_dir : rootlibexecdir)
2220 # exe = executable('coredumpctl',
2221 # coredumpctl_sources,
2222 # include_directories : includes,
2223 # link_with : [libshared],
2224 # dependencies : [threads,
2227 # install_rpath : rootlibexecdir,
2229 # public_programs += [exe]
2232 # if conf.get('ENABLE_BINFMT') == 1
2233 # exe = executable('systemd-binfmt',
2234 # 'src/binfmt/binfmt.c',
2235 # include_directories : includes,
2236 # link_with : [libshared],
2237 # install_rpath : rootlibexecdir,
2239 # install_dir : rootlibexecdir)
2240 # public_programs += [exe]
2242 # meson.add_install_script('sh', '-c',
2243 # mkdir_p.format(binfmtdir))
2244 # meson.add_install_script('sh', '-c',
2245 # mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2248 # if conf.get('ENABLE_VCONSOLE') == 1
2249 # executable('systemd-vconsole-setup',
2250 # 'src/vconsole/vconsole-setup.c',
2251 # include_directories : includes,
2252 # link_with : [libshared],
2253 # install_rpath : rootlibexecdir,
2255 # install_dir : rootlibexecdir)
2258 # if conf.get('ENABLE_RANDOMSEED') == 1
2259 # executable('systemd-random-seed',
2260 # 'src/random-seed/random-seed.c',
2261 # include_directories : includes,
2262 # link_with : [libshared],
2263 # install_rpath : rootlibexecdir,
2265 # install_dir : rootlibexecdir)
2268 # if conf.get('ENABLE_FIRSTBOOT') == 1
2269 # executable('systemd-firstboot',
2270 # 'src/firstboot/firstboot.c',
2271 # include_directories : includes,
2272 # link_with : [libshared],
2273 # dependencies : [libcrypt],
2274 # install_rpath : rootlibexecdir,
2276 # install_dir : rootbindir)
2279 # executable('systemd-remount-fs',
2280 # 'src/remount-fs/remount-fs.c',
2281 # 'src/core/mount-setup.c',
2282 # 'src/core/mount-setup.h',
2283 # include_directories : includes,
2284 # link_with : [libshared],
2285 # install_rpath : rootlibexecdir,
2287 # install_dir : rootlibexecdir)
2289 # executable('systemd-machine-id-setup',
2290 # 'src/machine-id-setup/machine-id-setup-main.c',
2291 # 'src/core/machine-id-setup.c',
2292 # 'src/core/machine-id-setup.h',
2293 # include_directories : includes,
2294 # link_with : [libshared],
2295 # install_rpath : rootlibexecdir,
2297 # install_dir : rootbindir)
2299 # executable('systemd-fsck',
2300 # 'src/fsck/fsck.c',
2301 # include_directories : includes,
2302 # link_with : [libshared],
2303 # install_rpath : rootlibexecdir,
2305 # install_dir : rootlibexecdir)
2307 # executable('elogind-growfs',
2308 # 'src/partition/growfs.c',
2309 # include_directories : includes,
2310 # link_with : [libshared],
2311 # dependencies : [libcryptsetup],
2312 # install_rpath : rootlibexecdir,
2314 # install_dir : rootlibexecdir)
2316 # executable('elogind-makefs',
2317 # 'src/partition/makefs.c',
2318 # include_directories : includes,
2319 # link_with : [libshared],
2320 # install_rpath : rootlibexecdir,
2322 # install_dir : rootlibexecdir)
2324 # executable('systemd-sleep',
2325 # 'src/sleep/sleep.c',
2326 # include_directories : includes,
2327 # link_with : [libshared],
2328 # install_rpath : rootlibexecdir,
2330 # install_dir : rootlibexecdir)
2332 # exe = executable('systemd-sysctl',
2333 # 'src/sysctl/sysctl.c',
2334 # include_directories : includes,
2335 # link_with : [libshared],
2336 # install_rpath : rootlibexecdir,
2338 # install_dir : rootlibexecdir)
2339 # public_programs += [exe]
2341 # executable('systemd-ac-power',
2342 # 'src/ac-power/ac-power.c',
2343 # include_directories : includes,
2344 # link_with : [libshared],
2345 # install_rpath : rootlibexecdir,
2347 # install_dir : rootlibexecdir)
2349 # exe = executable('systemd-detect-virt',
2350 # 'src/detect-virt/detect-virt.c',
2351 # include_directories : includes,
2352 # link_with : [libshared],
2353 # install_rpath : rootlibexecdir,
2355 # public_programs += [exe]
2357 # exe = executable('systemd-delta',
2358 # 'src/delta/delta.c',
2359 # include_directories : includes,
2360 # link_with : [libshared],
2361 # install_rpath : rootlibexecdir,
2363 # public_programs += [exe]
2365 # exe = executable('systemd-escape',
2366 # 'src/escape/escape.c',
2367 # include_directories : includes,
2368 # link_with : [libshared],
2369 # install_rpath : rootlibexecdir,
2371 # install_dir : rootbindir)
2372 # public_programs += [exe]
2374 # exe = executable('systemd-notify',
2375 # 'src/notify/notify.c',
2376 # include_directories : includes,
2377 # link_with : [libshared],
2378 # install_rpath : rootlibexecdir,
2380 # install_dir : rootbindir)
2381 # public_programs += [exe]
2383 # executable('systemd-volatile-root',
2384 # 'src/volatile-root/volatile-root.c',
2385 # include_directories : includes,
2386 # link_with : [libshared],
2387 # install_rpath : rootlibexecdir,
2389 # install_dir : rootlibexecdir)
2391 # executable('systemd-cgroups-agent',
2392 # 'src/cgroups-agent/cgroups-agent.c',
2393 # include_directories : includes,
2394 # link_with : [libshared],
2395 # install_rpath : rootlibexecdir,
2397 # install_dir : rootlibexecdir)
2399 executable('elogind-cgroups-agent',
2400 'src/cgroups-agent/cgroups-agent.c',
2401 include_directories : includes,
2402 link_with : [libshared_static],
2403 install_rpath : rootlibexecdir,
2405 install_dir : rootlibexecdir)
2408 #if 0 /// UNNEEDED by elogind
2409 # exe = executable('systemd-path',
2410 # 'src/path/path.c',
2411 # include_directories : includes,
2412 # link_with : [libshared],
2413 # install_rpath : rootlibexecdir,
2415 # public_programs += [exe]
2417 # exe = executable('systemd-ask-password',
2418 # 'src/ask-password/ask-password.c',
2419 # include_directories : includes,
2420 # link_with : [libshared],
2421 # install_rpath : rootlibexecdir,
2423 # install_dir : rootbindir)
2424 # public_programs += [exe]
2426 # executable('systemd-reply-password',
2427 # 'src/reply-password/reply-password.c',
2428 # include_directories : includes,
2429 # link_with : [libshared],
2430 # install_rpath : rootlibexecdir,
2432 # install_dir : rootlibexecdir)
2434 # exe = executable('systemd-tty-ask-password-agent',
2435 # 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2436 # include_directories : includes,
2437 # link_with : [libshared],
2438 # install_rpath : rootlibexecdir,
2440 # install_dir : rootbindir)
2441 # public_programs += [exe]
2443 # exe = executable('systemd-cgls',
2444 # 'src/cgls/cgls.c',
2445 # include_directories : includes,
2446 # link_with : [libshared],
2447 # install_rpath : rootlibexecdir,
2449 # public_programs += [exe]
2451 # exe = executable('systemd-cgtop',
2452 # 'src/cgtop/cgtop.c',
2453 # include_directories : includes,
2454 # link_with : [libshared],
2455 # install_rpath : rootlibexecdir,
2457 # public_programs += [exe]
2459 # executable('systemd-initctl',
2460 # 'src/initctl/initctl.c',
2461 # include_directories : includes,
2462 # link_with : [libshared],
2463 # install_rpath : rootlibexecdir,
2465 # install_dir : rootlibexecdir)
2467 # exe = executable('systemd-mount',
2468 # 'src/mount/mount-tool.c',
2469 # include_directories : includes,
2470 # link_with : [libshared],
2471 # install_rpath : rootlibexecdir,
2473 # public_programs += [exe]
2475 # meson.add_install_script(meson_make_symlink,
2476 # 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2478 # exe = executable('systemd-run',
2480 # include_directories : includes,
2481 # link_with : [libshared],
2482 # install_rpath : rootlibexecdir,
2484 # public_programs += [exe]
2486 # exe = executable('systemd-stdio-bridge',
2487 # 'src/stdio-bridge/stdio-bridge.c',
2488 # include_directories : includes,
2489 # link_with : [libshared],
2490 # install_rpath : rootlibexecdir,
2492 # public_programs += [exe]
2494 # exe = executable('busctl',
2495 # 'src/busctl/busctl.c',
2496 # 'src/busctl/busctl-introspect.c',
2497 # 'src/busctl/busctl-introspect.h',
2498 # include_directories : includes,
2499 # link_with : [libshared],
2500 # install_rpath : rootlibexecdir,
2502 # public_programs += [exe]
2504 # if conf.get('ENABLE_SYSUSERS') == 1
2505 # exe = executable('systemd-sysusers',
2506 # 'src/sysusers/sysusers.c',
2507 # include_directories : includes,
2508 # link_with : [libshared],
2509 # install_rpath : rootlibexecdir,
2511 # install_dir : rootbindir)
2512 # public_programs += [exe]
2515 # if conf.get('ENABLE_TMPFILES') == 1
2516 # exe = executable('systemd-tmpfiles',
2517 # 'src/tmpfiles/tmpfiles.c',
2518 # include_directories : includes,
2519 # link_with : [libshared],
2520 # dependencies : [libacl],
2521 # install_rpath : rootlibexecdir,
2523 # install_dir : rootbindir)
2524 # public_programs += [exe]
2526 # test('test-systemd-tmpfiles',
2527 # test_systemd_tmpfiles_py,
2528 # args : exe.full_path())
2529 # # https://github.com/mesonbuild/meson/issues/2681
2532 # if conf.get('ENABLE_HWDB') == 1
2533 # exe = executable('systemd-hwdb',
2534 # 'src/hwdb/hwdb.c',
2535 # 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2536 # include_directories : includes,
2537 # link_with : [libudev_static],
2538 # install_rpath : udev_rpath,
2540 # install_dir : rootbindir)
2541 # public_programs += [exe]
2544 # if conf.get('ENABLE_QUOTACHECK') == 1
2545 # executable('systemd-quotacheck',
2546 # 'src/quotacheck/quotacheck.c',
2547 # include_directories : includes,
2548 # link_with : [libshared],
2549 # install_rpath : rootlibexecdir,
2551 # install_dir : rootlibexecdir)
2554 # exe = executable('systemd-socket-proxyd',
2555 # 'src/socket-proxy/socket-proxyd.c',
2556 # include_directories : includes,
2557 # link_with : [libshared],
2558 # dependencies : [threads],
2559 # install_rpath : rootlibexecdir,
2561 # install_dir : rootlibexecdir)
2562 # public_programs += [exe]
2564 # exe = executable('systemd-udevd',
2565 # systemd_udevd_sources,
2566 # include_directories : includes,
2567 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2568 # link_with : [libudev_core,
2569 # libsystemd_network,
2571 # dependencies : [threads,
2576 # install_rpath : udev_rpath,
2578 # install_dir : rootlibexecdir)
2579 # public_programs += [exe]
2581 # exe = executable('udevadm',
2583 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2584 # include_directories : includes,
2585 # link_with : [libudev_core,
2586 # libsystemd_network,
2588 # dependencies : [threads,
2593 # install_rpath : udev_rpath,
2595 # install_dir : rootbindir)
2596 # public_programs += [exe]
2598 # executable('systemd-shutdown',
2599 # systemd_shutdown_sources,
2600 # include_directories : includes,
2601 # link_with : [libshared],
2602 # install_rpath : rootlibexecdir,
2604 # install_dir : rootlibexecdir)
2606 # executable('systemd-update-done',
2607 # 'src/update-done/update-done.c',
2608 # include_directories : includes,
2609 # link_with : [libshared],
2610 # install_rpath : rootlibexecdir,
2612 # install_dir : rootlibexecdir)
2614 # executable('systemd-update-utmp',
2615 # 'src/update-utmp/update-utmp.c',
2616 # include_directories : includes,
2617 # link_with : [libshared],
2618 # dependencies : [libaudit],
2619 # install_rpath : rootlibexecdir,
2621 # install_dir : rootlibexecdir)
2623 # if conf.get('HAVE_KMOD') == 1
2624 # executable('systemd-modules-load',
2625 # 'src/modules-load/modules-load.c',
2626 # include_directories : includes,
2627 # link_with : [libshared],
2628 # dependencies : [libkmod],
2629 # install_rpath : rootlibexecdir,
2631 # install_dir : rootlibexecdir)
2633 # meson.add_install_script('sh', '-c',
2634 # mkdir_p.format(modulesloaddir))
2635 # meson.add_install_script('sh', '-c',
2636 # mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2639 # exe = executable('systemd-nspawn',
2640 # systemd_nspawn_sources,
2641 # 'src/core/mount-setup.c', # FIXME: use a variable?
2642 # 'src/core/mount-setup.h',
2643 # 'src/core/loopback-setup.c',
2644 # 'src/core/loopback-setup.h',
2645 # include_directories : [includes, include_directories('src/nspawn')],
2646 # link_with : [libshared],
2647 # dependencies : [libacl,
2651 # install_rpath : rootlibexecdir,
2653 # public_programs += [exe]
2655 # if conf.get('ENABLE_NETWORKD') == 1
2656 # executable('systemd-networkd',
2657 # systemd_networkd_sources,
2658 # include_directories : includes,
2659 # link_with : [libnetworkd_core,
2660 # libsystemd_network,
2663 # dependencies : [threads],
2664 # install_rpath : rootlibexecdir,
2666 # install_dir : rootlibexecdir)
2668 # executable('systemd-networkd-wait-online',
2669 # systemd_networkd_wait_online_sources,
2670 # include_directories : includes,
2671 # link_with : [libnetworkd_core,
2673 # install_rpath : rootlibexecdir,
2675 # install_dir : rootlibexecdir)
2677 # exe = executable('networkctl',
2678 # networkctl_sources,
2679 # include_directories : includes,
2680 # link_with : [libsystemd_network,
2682 # install_rpath : rootlibexecdir,
2684 # install_dir : rootbindir)
2685 # public_programs += [exe]
2688 # executable('systemd-sulogin-shell',
2689 # ['src/sulogin-shell/sulogin-shell.c'],
2690 # include_directories : includes,
2691 # link_with : [libshared],
2692 # install_rpath : rootlibexecdir,
2694 # install_dir : rootlibexecdir)
2696 executable('elogind-uaccess-command',
2697 'src/uaccess-command/uaccess-command.c',
2698 include_directories : includes,
2699 link_with : [liblogind_core,
2701 dependencies: [libacl,
2703 install_rpath : rootlibexecdir,
2705 install_dir : rootlibexecdir)
2708 ############################################################
2710 foreach tuple : tests
2712 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2713 dependencies = tuple[2]
2714 condition = tuple.length() >= 4 ? tuple[3] : ''
2715 type = tuple.length() >= 5 ? tuple[4] : ''
2716 defs = tuple.length() >= 6 ? tuple[5] : []
2717 incs = tuple.length() >= 7 ? tuple[6] : includes
2720 name = sources[0].split('/')[-1].split('.')[0]
2721 if type.startswith('timeout=')
2722 timeout = type.split('=')[1].to_int()
2725 if want_tests == 'false'
2726 message('Not compiling @0@ because tests is set to false'.format(name))
2727 elif condition == '' or conf.get(condition) == 1
2731 include_directories : incs,
2732 link_with : link_with,
2733 dependencies : dependencies,
2735 install_rpath : rootlibexecdir,
2736 install : install_tests,
2737 install_dir : join_paths(testsdir, type))
2740 message('@0@ is a manual test'.format(name))
2741 elif type == 'unsafe' and want_tests != 'unsafe'
2742 message('@0@ is an unsafe test'.format(name))
2749 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2753 #if 0 /// UNNEEDED by elogind
2754 # test_libsystemd_sym = executable(
2755 # 'test-libsystemd-sym',
2756 # test_libsystemd_sym_c,
2757 # include_directories : includes,
2758 # link_with : [libsystemd],
2759 # install : install_tests,
2760 # install_dir : testsdir)
2761 # test('test-libsystemd-sym',
2762 # test_libsystemd_sym)
2764 # test_libudev_sym = executable(
2765 # 'test-libudev-sym',
2766 # test_libudev_sym_c,
2767 # include_directories : includes,
2768 # c_args : ['-Wno-deprecated-declarations'],
2769 # link_with : [libudev],
2770 # install : install_tests,
2771 # install_dir : testsdir)
2772 # test('test-libudev-sym',
2775 # ############################################################
2779 # foreach tuple : fuzzers
2780 # sources = tuple[0]
2781 # link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2782 # dependencies = tuple[2]
2783 # defs = tuple.length() >= 4 ? tuple[3] : []
2784 # incs = tuple.length() >= 5 ? tuple[4] : includes
2787 # dependencies += fuzzing_engine
2789 # sources += 'src/fuzz/fuzz-main.c'
2792 # name = sources[0].split('/')[-1].split('.')[0]
2794 # fuzzer_exes += executable(
2797 # include_directories : [incs, include_directories('src/fuzz')],
2798 # link_with : link_with,
2799 # dependencies : dependencies,
2804 # run_target('fuzzers',
2805 # depends : fuzzer_exes,
2806 # command : ['true'])
2808 test_libelogind_sym = executable(
2809 'test-libelogind-sym',
2810 test_libelogind_sym_c,
2811 include_directories : includes,
2812 link_with : [libelogind],
2813 install : install_tests,
2814 install_dir : testsdir)
2815 test('test-libelogind-sym',
2816 test_libelogind_sym)
2819 ############################################################
2821 make_directive_index_py = find_program('tools/make-directive-index.py')
2822 make_man_index_py = find_program('tools/make-man-index.py')
2823 xml_helper_py = find_program('tools/xml_helper.py')
2824 #if 0 /// UNNEEDED by elogind
2825 # hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2828 # subdir('sysctl.d')
2829 # subdir('sysusers.d')
2830 # subdir('tmpfiles.d')
2836 subdir('shell-completion/bash')
2837 subdir('shell-completion/zsh')
2838 #if 0 /// UNNEEDED by elogind
2839 # subdir('docs/sysvinit')
2840 # subdir('docs/var-log')
2843 # FIXME: figure out if the warning is true:
2844 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2845 install_subdir('factory/etc',
2846 install_dir : factorydir)
2849 #if 0 /// UNNEEDED by elogind
2850 # install_data('xorg/50-systemd-user.sh',
2851 # install_dir : xinitrcdir)
2852 # install_data('modprobe.d/systemd.conf',
2853 # install_dir : modprobedir)
2855 install_data('README',
2858 #if 0 /// UNNEEDED by elogind
2864 'TRANSIENT-SETTINGS.md',
2866 'src/libelogind/sd-bus/GVARIANT-SERIALIZATION',
2867 install_dir : docdir)
2869 #if 0 /// UNNEEDED by elogind
2870 # meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2872 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2874 ############################################################
2876 meson_check_help = find_program('tools/meson-check-help.sh')
2878 foreach exec : public_programs
2879 name = exec.full_path().split('/')[-1]
2880 test('check-help-' + name,
2882 args : [exec.full_path()])
2885 ############################################################
2888 all_files = run_command(
2890 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2893 all_files = files(all_files.stdout().split())
2898 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2902 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2905 #if 0 /// UNNEEDED by elogind
2907 # meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2910 # command : [meson_git_contrib_sh])
2915 git_head = run_command(
2917 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2918 'rev-parse', 'HEAD']).stdout().strip()
2919 git_head_short = run_command(
2921 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2922 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2926 command : ['git', 'archive',
2927 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2929 '--prefix', 'systemd-@0@/'.format(git_head),
2933 ############################################################
2935 meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh')
2938 depends : [man, libelogind, libudev],
2939 command : [meson_check_api_docs_sh, libelogind.full_path(), libudev.full_path()])
2941 ############################################################
2944 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2946 #if 0 /// UNSUPPORTED by elogind
2947 # 'prefix directory: @0@'.format(prefixdir),
2948 # 'rootprefix directory: @0@'.format(rootprefixdir),
2949 # 'sysconf directory: @0@'.format(sysconfdir),
2950 # 'include directory: @0@'.format(includedir),
2951 # 'lib directory: @0@'.format(libdir),
2952 # 'rootlib directory: @0@'.format(rootlibdir),
2953 # 'SysV init scripts: @0@'.format(sysvinit_path),
2954 # 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2956 'rootexeclib dir: @0@'.format(rootlibexecdir),
2958 #if 0 /// UNSUPPORTED by elogind
2959 # 'PAM modules directory: @0@'.format(pamlibdir),
2960 # 'PAM configuration directory: @0@'.format(pamconfdir),
2961 # 'RPM macros directory: @0@'.format(rpmmacrosdir),
2962 # 'modprobe.d directory: @0@'.format(modprobedir),
2963 # 'D-Bus policy directory: @0@'.format(dbuspolicydir),
2964 # 'D-Bus session directory: @0@'.format(dbussessionservicedir),
2965 # 'D-Bus system directory: @0@'.format(dbussystemservicedir),
2966 # 'bash completions directory: @0@'.format(bashcompletiondir),
2967 # 'zsh completions directory: @0@'.format(zshcompletiondir),
2968 # 'extra start script: @0@'.format(get_option('rc-local')),
2969 # 'extra stop script: @0@'.format(get_option('halt-local')),
2970 # 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2971 # get_option('debug-tty')),
2973 'TTY GID: @0@'.format(tty_gid),
2974 #if 0 /// UNSUPPORTED by elogind
2975 # 'users GID: @0@'.format(users_gid),
2977 'maximum system UID: @0@'.format(system_uid_max),
2978 'maximum system GID: @0@'.format(system_gid_max),
2979 #if 0 /// UNSUPPORTED by elogind
2980 # 'minimum dynamic UID: @0@'.format(dynamic_uid_min),
2981 # 'maximum dynamic UID: @0@'.format(dynamic_uid_max),
2982 # 'minimum container UID base: @0@'.format(container_uid_base_min),
2983 # 'maximum container UID base: @0@'.format(container_uid_base_max),
2984 # '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2985 # 'render group access mode: @0@'.format(get_option('group-render-mode')),
2986 # 'certificate root directory: @0@'.format(get_option('certificate-root')),
2987 # 'support URL: @0@'.format(support_url),
2988 # 'nobody user name: @0@'.format(nobody_user),
2989 # 'nobody group name: @0@'.format(nobody_group),
2990 # 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2991 # 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2993 # 'default DNSSEC mode: @0@'.format(default_dnssec),
2994 # 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2996 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2998 #if 0 /// UNSUPPORTED by elogind
2999 # alt_dns_servers = '\n '.join(dns_servers.split(' '))
3000 # alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
3002 # 'default DNS servers: @0@'.format(alt_dns_servers),
3003 # 'default NTP servers: @0@'.format(alt_ntp_servers)]
3005 # alt_time_epoch = run_command('date', '-Is', '-u', '-d',
3006 # '@@0@'.format(time_epoch)).stdout().strip()
3008 # 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
3012 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
3013 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
3014 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
3016 #if 0 /// UNNEEDED by elogind
3017 # if conf.get('ENABLE_EFI') == 1
3019 # 'efi arch: @0@'.format(efi_arch)]
3023 # 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
3024 # 'EFI CC @0@'.format(efi_cc),
3025 # 'EFI lib directory: @0@'.format(efi_libdir),
3026 # 'EFI lds directory: @0@'.format(efi_ldsdir),
3027 # 'EFI include directory: @0@'.format(efi_incdir)]
3036 #if 0 /// UNNEEDED by elogind
3037 # ['libcryptsetup'],
3041 #if 0 /// UNNEEDED by elogind
3046 #if 0 /// UNNEEDED by elogind
3050 #if 0 /// UNNEEDED by elogind
3057 #if 0 /// UNNEEDED by elogind
3073 # ['environment.d'],
3091 ['legacy pkla', install_polkit_pkla],
3092 #if 0 /// UNNEEDED by elogind
3094 # ['gnu-efi', have_gnu_efi],
3101 #if 0 /// UNNEEDED by elogind
3102 # ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
3106 ['man pages', want_man],
3107 ['html pages', want_html],
3108 ['man page indices', want_man and have_lxml],
3109 #if 0 /// UNNEEDED by elogind
3110 # ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
3114 #if 0 /// UNNEEDED by elogind
3117 # ['adm group', get_option('adm-group')],
3118 # ['wheel group', get_option('wheel-group')],
3124 ['debug mmap cache'],
3127 cond = tuple.get(1, '')
3129 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
3130 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
3131 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
3136 missing += [tuple[0]]
3142 'enabled features: @0@'.format(', '.join(found)),
3144 'disabled features: @0@'.format(', '.join(missing)),
3146 message('\n '.join(status))
3148 if rootprefixdir != rootprefix_default
3149 message('WARNING:\n' +
3150 ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
3151 ' elogind used fixed names for unit file directories and other paths, so anything\n' +
3152 ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))