blob: 87a2859034b18c8cfec97f3e2b84a98672321091 [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001project('systemd', 'c',
Lennart Poettering63950422017-09-28 11:29:52 +02002 version : '235',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04003 license : 'LGPLv2+',
4 default_options: [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04005 'c_std=gnu99',
6 'prefix=/usr',
7 'sysconfdir=/etc',
8 'localstatedir=/var',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04009 ],
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -040010 meson_version : '>= 0.40',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040011 )
12
Zbigniew Jędrzejewski-Szmek56d50ab2017-09-28 19:24:16 +020013libsystemd_version = '0.19.0'
14libudev_version = '1.6.6'
15
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040016# We need the same data in three different formats, ugh!
17# Also, for hysterical reasons, we use different variable
18# names, sometimes. Not all variables are included in every
19# set. Ugh, ugh, ugh!
20conf = configuration_data()
21conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
22conf.set_quoted('PACKAGE_VERSION', meson.project_version())
23
24substs = configuration_data()
25substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
26substs.set('PACKAGE_VERSION', meson.project_version())
27
28m4_defines = []
29
30#####################################################################
31
Zbigniew Jędrzejewski-Szmek003c8872017-07-24 04:41:45 -040032# Try to install the git pre-commit hook
33git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
34if git_hook.returncode() == 0
35 message(git_hook.stdout().strip())
36endif
37
38#####################################################################
39
Zbigniew Jędrzejewski-Szmekab916f22017-04-13 22:15:01 -040040rootprefixdir = get_option('rootprefix')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +020041conf.set10('HAVE_SPLIT_USR', get_option('split-usr'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040042if get_option('split-usr')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040043 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040044else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040045 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040046endif
47
48sysvinit_path = get_option('sysvinit-path')
49sysvrcnd_path = get_option('sysvrcnd-path')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +020050have = sysvinit_path != '' or sysvrcnd_path != ''
51conf.set10('HAVE_SYSV_COMPAT', have,
52 description : 'SysV init scripts and rcN.d links are supported')
53m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040054
55# join_paths ignore the preceding arguments if an absolute component is
56# encountered, so this should canonicalize various paths when they are
57# absolute or relative.
58prefixdir = get_option('prefix')
59if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040060 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040061endif
62bindir = join_paths(prefixdir, get_option('bindir'))
63libdir = join_paths(prefixdir, get_option('libdir'))
64sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
65includedir = join_paths(prefixdir, get_option('includedir'))
66datadir = join_paths(prefixdir, get_option('datadir'))
67localstatedir = join_paths('/', get_option('localstatedir'))
68
69rootbindir = join_paths(rootprefixdir, 'bin')
70rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
71
72rootlibdir = get_option('rootlibdir')
73if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040074 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040075endif
76
77# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040078pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
79pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
80polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
81polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
82polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
83varlogdir = join_paths(localstatedir, 'log')
84xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040085rpmmacrosdir = get_option('rpmmacrosdir')
Yu Watanabead6fc5b2017-08-03 21:01:38 +090086modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040087
88# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -040089pkgdatadir = join_paths(datadir, 'systemd')
90environmentdir = join_paths(prefixdir, 'lib/environment.d')
91pkgsysconfdir = join_paths(sysconfdir, 'systemd')
92userunitdir = join_paths(prefixdir, 'lib/systemd/user')
93userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
94tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
95sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
96sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
97binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
98modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
99networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
100pkgincludedir = join_paths(includedir, 'systemd')
101systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
102usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
103systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
104userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
105systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
106systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
107systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
108systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
109udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
110udevhomedir = udevlibexecdir
111udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
112udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
113catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
114kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
115factorydir = join_paths(datadir, 'factory')
116docdir = join_paths(datadir, 'doc/systemd')
117bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
118testsdir = join_paths(prefixdir, 'lib/systemd/tests')
119systemdstatedir = join_paths(localstatedir, 'lib/systemd')
120catalogstatedir = join_paths(systemdstatedir, 'catalog')
121randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400122
123dbuspolicydir = get_option('dbuspolicydir')
124if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400125 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400126endif
127
128dbussessionservicedir = get_option('dbussessionservicedir')
129if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400130 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400131endif
132
133dbussystemservicedir = get_option('dbussystemservicedir')
134if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400135 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400136endif
137
138pamlibdir = get_option('pamlibdir')
139if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400140 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400141endif
142
143pamconfdir = get_option('pamconfdir')
144if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400145 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400146endif
147
148conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400149conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400150conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
151conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
152conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400153conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
154conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400155conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400156conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
157conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400158conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
159conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
160conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
161conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
162conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
163conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
164conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
165conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
166conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400167conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400168conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400169conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
170conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400171conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
172conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
173conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
174conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
175conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
176conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400177conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
178conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400179conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400180conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400181conf.set_quoted('LIBDIR', libdir)
182conf.set_quoted('ROOTLIBDIR', rootlibdir)
183conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
184conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400185conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
186conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
187conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
188conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
189conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
190conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400191
192conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
193conf.set_quoted('ABS_SRC_DIR', meson.source_root())
194
195substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400196substs.set('exec_prefix', prefixdir)
197substs.set('libdir', libdir)
198substs.set('rootlibdir', rootlibdir)
199substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400200substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400201substs.set('bindir', bindir)
202substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400203substs.set('rootlibexecdir', rootlibexecdir)
204substs.set('systemunitdir', systemunitdir)
205substs.set('userunitdir', userunitdir)
206substs.set('systempresetdir', systempresetdir)
207substs.set('userpresetdir', userpresetdir)
208substs.set('udevhwdbdir', udevhwdbdir)
209substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400210substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400211substs.set('catalogdir', catalogdir)
212substs.set('tmpfilesdir', tmpfilesdir)
213substs.set('sysusersdir', sysusersdir)
214substs.set('sysctldir', sysctldir)
215substs.set('binfmtdir', binfmtdir)
216substs.set('modulesloaddir', modulesloaddir)
217substs.set('systemgeneratordir', systemgeneratordir)
218substs.set('usergeneratordir', usergeneratordir)
219substs.set('systemenvgeneratordir', systemenvgeneratordir)
220substs.set('userenvgeneratordir', userenvgeneratordir)
221substs.set('systemshutdowndir', systemshutdowndir)
222substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400223substs.set('VARLOGDIR', varlogdir)
224substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400225substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
226substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400227substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
228substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
229substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
230substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400231
232#####################################################################
233
234cc = meson.get_compiler('c')
235pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400236check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400237
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400238cxx = find_program('c++', required : false)
239if cxx.found()
240 # Used only for tests
241 add_languages('cpp')
242endif
243
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400244foreach arg : ['-Wextra',
Zbigniew Jędrzejewski-Szmek70160ce2017-10-03 12:11:49 +0200245 '-Werror=undef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400246 '-Wlogical-op',
247 '-Wmissing-include-dirs',
248 '-Wold-style-definition',
249 '-Wpointer-arith',
250 '-Winit-self',
251 '-Wdeclaration-after-statement',
252 '-Wfloat-equal',
253 '-Wsuggest-attribute=noreturn',
254 '-Werror=missing-prototypes',
255 '-Werror=implicit-function-declaration',
256 '-Werror=missing-declarations',
257 '-Werror=return-type',
258 '-Werror=incompatible-pointer-types',
259 '-Werror=format=2',
260 '-Wstrict-prototypes',
261 '-Wredundant-decls',
262 '-Wmissing-noreturn',
263 '-Wshadow',
264 '-Wendif-labels',
265 '-Wstrict-aliasing=2',
266 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400267 '-Werror=overflow',
268 '-Wdate-time',
269 '-Wnested-externs',
270 '-ffast-math',
271 '-fno-common',
272 '-fdiagnostics-show-option',
273 '-fno-strict-aliasing',
274 '-fvisibility=hidden',
275 '-fstack-protector',
276 '-fstack-protector-strong',
277 '-fPIE',
278 '--param=ssp-buffer-size=4',
279 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400280 if cc.has_argument(arg)
281 add_project_arguments(arg, language : 'c')
282 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400283endforeach
284
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400285# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
286# arguments, just emits a warnings. So test for the "positive" version instead.
287foreach arg : ['unused-parameter',
288 'missing-field-initializers',
289 'unused-result',
Zbigniew Jędrzejewski-Szmekfb1b5882017-09-04 19:49:12 +0300290 'format-signedness',
291 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
292 ]
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400293 if cc.has_argument('-W' + arg)
294 add_project_arguments('-Wno-' + arg, language : 'c')
295 endif
296endforeach
297
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400298if cc.compiles('
299 #include <time.h>
300 #include <inttypes.h>
301 typedef uint64_t usec_t;
302 usec_t now(clockid_t clock);
303 int main(void) {
304 struct timespec now;
305 return 0;
306 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400307', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400308 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400309endif
310
311if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400312 foreach arg : ['-Wno-typedef-redefinition',
313 '-Wno-gnu-variable-sized-type-not-at-end',
314 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400315 if cc.has_argument(arg,
316 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400317 add_project_arguments(arg, language : 'c')
318 endif
319 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400320endif
321
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400322link_test_c = files('tools/meson-link-test.c')
323
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400324# --as-needed and --no-undefined are provided by meson by default,
325# run mesonconf to see what is enabled
326foreach arg : ['-Wl,-z,relro',
327 '-Wl,-z,now',
328 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400329 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400330
331 have = run_command(check_compilation_sh,
332 cc.cmd_array(), '-x', 'c', arg,
333 '-include', link_test_c).returncode() == 0
334 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
335 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400336 add_project_link_arguments(arg, language : 'c')
337 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400338endforeach
339
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400340if get_option('buildtype') != 'debug'
341 foreach arg : ['-ffunction-sections',
342 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400343 if cc.has_argument(arg,
344 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400345 add_project_arguments(arg, language : 'c')
346 endif
347 endforeach
348
349 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400350 have = run_command(check_compilation_sh,
351 cc.cmd_array(), '-x', 'c', arg,
352 '-include', link_test_c).returncode() == 0
353 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
354 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400355 add_project_link_arguments(arg, language : 'c')
356 endif
357 endforeach
358endif
359
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400360cpp = ' '.join(cc.cmd_array()) + ' -E'
361
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400362#####################################################################
363# compilation result tests
364
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400365conf.set('_GNU_SOURCE', true)
366conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400367
368conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
369conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
370conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
371conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
372conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
373conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
374conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
375
376decl_headers = '''
377#include <uchar.h>
378#include <linux/ethtool.h>
Susant Sahanibce67bb2017-09-14 19:51:39 +0000379#include <linux/fib_rules.h>
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400380'''
381# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
382
383foreach decl : ['char16_t',
384 'char32_t',
385 'key_serial_t',
386 'struct ethtool_link_settings',
Susant Sahanibce67bb2017-09-14 19:51:39 +0000387 'struct fib_rule_uid_range',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400388 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400389
390 # We get -1 if the size cannot be determined
391 have = cc.sizeof(decl, prefix : decl_headers) > 0
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200392 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400393endforeach
394
395foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
396 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
397 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
398 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
399 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
400 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
401 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
402 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
403 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
404 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530405 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400406 # if_tunnel.h is buggy and cannot be included on its own
407 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
408 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
409 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
410 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
411 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
412 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
413 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
414 ['NDA_IFINDEX', 'linux/neighbour.h'],
415 ['IFA_FLAGS', 'linux/if_addr.h'],
Susant Sahanibce67bb2017-09-14 19:51:39 +0000416 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400417 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
418 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400419 prefix = decl.length() > 2 ? decl[2] : ''
420 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200421 conf.set10('HAVE_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400422endforeach
423
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400424foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200425 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400426endforeach
427
428foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400429 ['memfd_create', '''#include <sys/memfd.h>'''],
430 ['gettid', '''#include <sys/types.h>'''],
431 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
432 ['name_to_handle_at', '''#define _GNU_SOURCE
433 #include <sys/types.h>
434 #include <sys/stat.h>
435 #include <fcntl.h>'''],
436 ['setns', '''#define _GNU_SOURCE
437 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400438 ['renameat2', '''#include <stdio.h>'''],
439 ['kcmp', '''#include <linux/kcmp.h>'''],
440 ['keyctl', '''#include <sys/types.h>
441 #include <keyutils.h>'''],
442 ['copy_file_range', '''#include <sys/syscall.h>
443 #include <unistd.h>'''],
Daniel Mack71e52002016-10-18 17:57:10 +0200444 ['bpf', '''#include <sys/syscall.h>
445 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400446 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400447]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400448
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400449 have = cc.has_function(ident[0], prefix : ident[1])
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200450 conf.set10('HAVE_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400451endforeach
452
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400453if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200454 conf.set10('USE_SYS_RANDOM_H', true)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200455 conf.set10('HAVE_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400456else
457 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200458 conf.set10('USE_SYS_RANDOM_H', false)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200459 conf.set10('HAVE_GETRANDOM', have)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400460endif
461
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400462#####################################################################
463
464sed = find_program('sed')
465grep = find_program('grep')
466awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400467m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400468stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400469git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400470
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400471meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400472mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400473test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
474splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400475
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400476# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
477# /usr/sbin, /sbin, and fall back to the default from middle column.
478progs = [['telinit', '/lib/sysvinit/telinit'],
479 ['quotaon', '/usr/sbin/quotaon' ],
480 ['quotacheck', '/usr/sbin/quotacheck' ],
481 ['kill', '/usr/bin/kill' ],
482 ['kmod', '/usr/bin/kmod' ],
483 ['kexec', '/usr/sbin/kexec' ],
484 ['sulogin', '/usr/sbin/sulogin' ],
485 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
486 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
487 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
488 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
489 ]
490foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400491 path = get_option(prog[0] + '-path')
492 if path != ''
493 message('Using @1@ for @0@'.format(prog[0], path))
494 else
495 exe = find_program(prog[0],
496 '/usr/sbin/' + prog[0],
497 '/sbin/' + prog[0],
498 required: false)
499 path = exe.found() ? exe.path() : prog[1]
500 endif
501 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
502 conf.set_quoted(name, path)
503 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400504endforeach
505
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400506if run_command('ln', '--relative', '--help').returncode() != 0
507 error('ln does not support --relative')
508endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400509
510############################################################
511
512gperf = find_program('gperf')
513
514gperf_test_format = '''
515#include <string.h>
516const char * in_word_set(const char *, @0@);
517@1@
518'''
519gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
520gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
521gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
522if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400523 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400524else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400525 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
526 if cc.compiles(gperf_test)
527 gperf_len_type = 'unsigned'
528 else
529 error('unable to determine gperf len type')
530 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400531endif
532message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400533conf.set('GPERF_LEN_TYPE', gperf_len_type,
534 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400535
536############################################################
537
538if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400539 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400540endif
541foreach header : ['linux/btrfs.h',
542 'linux/memfd.h',
543 'linux/vm_sockets.h',
Zbigniew Jędrzejewski-Szmekaf8786b2017-10-03 12:09:40 +0200544 'sys/auxv.h',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400545 'valgrind/memcheck.h',
546 'valgrind/valgrind.h',
547 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400548
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200549 conf.set10('HAVE_' + header.underscorify().to_upper(),
550 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400551endforeach
552
553############################################################
554
555conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400556conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
557gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400558
559default_hierarchy = get_option('default-hierarchy')
560conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
561 description : 'default cgroup hierarchy as string')
562if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400563 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400564elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400565 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400566else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400567 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400568endif
569
570time_epoch = get_option('time-epoch')
571if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400572 NEWS = files('NEWS')
573 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400574endif
575time_epoch = time_epoch.to_int()
576conf.set('TIME_EPOCH', time_epoch)
577
578system_uid_max = get_option('system-uid-max')
579if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400580 system_uid_max = run_command(
581 awk,
582 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
583 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400584endif
585system_uid_max = system_uid_max.to_int()
586conf.set('SYSTEM_UID_MAX', system_uid_max)
587substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400588message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400589
590conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
591conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
592
593system_gid_max = get_option('system-gid-max')
594if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400595 system_gid_max = run_command(
596 awk,
597 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
598 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400599endif
600system_gid_max = system_gid_max.to_int()
601conf.set('SYSTEM_GID_MAX', system_gid_max)
602substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400603message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400604
605tty_gid = get_option('tty-gid')
606conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400607substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400608
609if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400610 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400611endif
612
613if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400614 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400615endif
616
617substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
618
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400619kill_user_processes = get_option('default-kill-user-processes')
620conf.set10('KILL_USER_PROCESSES', kill_user_processes)
621substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400622
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400623dns_servers = get_option('dns-servers')
624conf.set_quoted('DNS_SERVERS', dns_servers)
625substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400626
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400627ntp_servers = get_option('ntp-servers')
628conf.set_quoted('NTP_SERVERS', ntp_servers)
629substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400630
631conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
632
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400633substs.set('SUSHELL', get_option('debug-shell'))
634substs.set('DEBUGTTY', get_option('debug-tty'))
635
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400636debug = get_option('debug')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200637enable_debug_hashmap = false
638enable_debug_mmap_cache = false
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400639if debug != ''
640 foreach name : debug.split(',')
641 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200642 enable_debug_hashmap = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400643 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200644 enable_debug_mmap_cache = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400645 else
646 message('unknown debug option "@0@", ignoring'.format(name))
647 endif
648 endforeach
649endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200650conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
651conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400652
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400653#####################################################################
654
655threads = dependency('threads')
656librt = cc.find_library('rt')
657libm = cc.find_library('m')
658libdl = cc.find_library('dl')
659libcrypt = cc.find_library('crypt')
660
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400661libcap = dependency('libcap', required : false)
662if not libcap.found()
663 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
664 libcap = cc.find_library('cap')
665endif
666
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400667libmount = dependency('mount',
Zbigniew Jędrzejewski-Szmekd6e80962017-09-15 14:47:57 +0200668 version : '>= 2.30')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400669
670want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400671if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400672 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400673 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400674 required : want_seccomp == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200675 have = libseccomp.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400676else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200677 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400678 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400679endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200680conf.set10('HAVE_SECCOMP', have)
681m4_defines += have ? ['-DHAVE_SECCOMP'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400682
683want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400684if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400685 libselinux = dependency('libselinux',
686 version : '>= 2.1.9',
687 required : want_selinux == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200688 have = libselinux.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400689else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200690 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400691 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400692endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200693conf.set10('HAVE_SELINUX', have)
694m4_defines += have ? ['-DHAVE_SELINUX'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400695
696want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400697if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400698 libapparmor = dependency('libapparmor',
699 required : want_apparmor == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200700 have = libapparmor.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400701else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200702 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400703 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400704endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200705conf.set10('HAVE_APPARMOR', have)
706m4_defines += have ? ['-DHAVE_APPARMOR'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400707
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400708smack_run_label = get_option('smack-run-label')
709if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400710 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
711 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400712endif
713
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400714want_polkit = get_option('polkit')
715install_polkit = false
716install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400717if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400718 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400719
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400720 libpolkit = dependency('polkit-gobject-1',
721 required : false)
722 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
723 message('Old polkit detected, will install pkla files')
724 install_polkit_pkla = true
725 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400726endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200727conf.set10('ENABLE_POLKIT', install_polkit)
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400728
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400729want_acl = get_option('acl')
730if want_acl != 'false'
731 libacl = cc.find_library('acl', required : want_acl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200732 have = libacl.found()
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400733else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200734 have = false
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400735 libacl = []
736endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200737conf.set10('HAVE_ACL', have)
738m4_defines += have ? ['-DHAVE_ACL'] : []
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400739
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400740want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400741if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400742 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200743 have = libaudit.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400744else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200745 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400746 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400747endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200748conf.set10('HAVE_AUDIT', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400749
750want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400751if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400752 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200753 have = libblkid.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400754else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200755 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400756 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400757endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200758conf.set10('HAVE_BLKID', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400759
760want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400761if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400762 libkmod = dependency('libkmod',
763 version : '>= 15',
764 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200765 have = libkmod.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400766else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200767 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400768 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400769endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200770conf.set10('HAVE_KMOD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400771
772want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400773if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400774 libpam = cc.find_library('pam', required : want_pam == 'true')
775 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200776 have = libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400777else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200778 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400779 libpam = []
780 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400781endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200782conf.set10('HAVE_PAM', have)
783m4_defines += have ? ['-DHAVE_PAM'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400784
785want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400786if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400787 libmicrohttpd = dependency('libmicrohttpd',
788 version : '>= 0.9.33',
789 required : want_microhttpd == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200790 have = libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400791else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200792 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400793 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400794endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200795conf.set10('HAVE_MICROHTTPD', have)
796m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400797
798want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400799if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400800 libcryptsetup = dependency('libcryptsetup',
801 version : '>= 1.6.0',
802 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200803 have = libcryptsetup.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400804else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200805 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400806 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400807endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200808conf.set10('HAVE_LIBCRYPTSETUP', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400809
810want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400811if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400812 libcurl = dependency('libcurl',
813 version : '>= 7.32.0',
814 required : want_libcurl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200815 have = libcurl.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400816else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200817 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400818 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400819endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200820conf.set10('HAVE_LIBCURL', have)
821m4_defines += have ? ['-DHAVE_LIBCURL'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400822
823want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400824want_libidn2 = get_option('libidn2')
825if want_libidn == 'true' and want_libidn2 == 'true'
826 error('libidn and libidn2 cannot be requested simultaneously')
827endif
828
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400829if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400830 libidn = dependency('libidn',
831 required : want_libidn == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200832 have = libidn.found()
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400833else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200834 have = false
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400835 libidn = []
836endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200837conf.set10('HAVE_LIBIDN', have)
838m4_defines += have ? ['-DHAVE_LIBIDN'] : []
839if not have and want_libidn2 != 'false'
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400840 # libidn is used for both libidn and libidn2 objects
841 libidn = dependency('libidn2',
842 required : want_libidn2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200843 have = libidn.found()
844else
845 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400846endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200847conf.set10('HAVE_LIBIDN2', have)
848m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400849
850want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400851if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400852 libiptc = dependency('libiptc',
853 required : want_libiptc == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200854 have = libiptc.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400855else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200856 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400857 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400858endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200859conf.set10('HAVE_LIBIPTC', have)
860m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400861
862want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400863if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400864 libqrencode = dependency('libqrencode',
865 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200866 have = libqrencode.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400867else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200868 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400869 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400870endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200871conf.set10('HAVE_QRENCODE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400872
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400873want_gcrypt = get_option('gcrypt')
874if want_gcrypt != 'false'
875 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
876 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200877 have = libgcrypt.found() and libgpg_error.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400878else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200879 have = false
880endif
881if not have
882 # link to neither of the libs if one is not found
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400883 libgcrypt = []
884 libgpg_error = []
885endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200886conf.set10('HAVE_GCRYPT', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400887
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400888want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400889if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400890 libgnutls = dependency('gnutls',
891 version : '>= 3.1.4',
892 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200893 have = libgnutls.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400894else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200895 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400896 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400897endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200898conf.set10('HAVE_GNUTLS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400899
900want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400901if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400902 libdw = dependency('libdw',
903 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200904 have = libdw.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400905else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200906 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400907 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400908endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200909conf.set10('HAVE_ELFUTILS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400910
911want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400912if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400913 libz = dependency('zlib',
914 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200915 have = libz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400916else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200917 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400918 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400919endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200920conf.set10('HAVE_ZLIB', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400921
922want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400923if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400924 libbzip2 = cc.find_library('bz2',
925 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200926 have = libbzip2.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400927else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200928 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400929 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400930endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200931conf.set10('HAVE_BZIP2', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400932
933want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400934if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400935 libxz = dependency('liblzma',
936 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200937 have = libxz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400938else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200939 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400940 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400941endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200942conf.set10('HAVE_XZ', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400943
944want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400945if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400946 liblz4 = dependency('liblz4',
947 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200948 have = liblz4.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400949else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200950 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400951 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400952endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200953conf.set10('HAVE_LZ4', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400954
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400955want_xkbcommon = get_option('xkbcommon')
956if want_xkbcommon != 'false'
957 libxkbcommon = dependency('xkbcommon',
958 version : '>= 0.3.0',
959 required : want_xkbcommon == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200960 have = libxkbcommon.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400961else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200962 have = false
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400963 libxkbcommon = []
964endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200965conf.set10('HAVE_XKBCOMMON', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400966
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400967want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400968if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400969 libglib = dependency('glib-2.0',
970 version : '>= 2.22.0',
971 required : want_glib == 'true')
972 libgobject = dependency('gobject-2.0',
973 version : '>= 2.22.0',
974 required : want_glib == 'true')
975 libgio = dependency('gio-2.0',
976 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400977 have = libglib.found() and libgobject.found() and libgio.found()
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400978else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200979 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400980 libglib = []
981 libgobject = []
982 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400983endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200984conf.set10('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400985
986want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400987if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400988 libdbus = dependency('dbus-1',
989 version : '>= 1.3.2',
990 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200991 have = libdbus.found()
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400992else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200993 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400994 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400995endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200996conf.set10('HAVE_DBUS', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400997
Yu Watanabe42303dc2017-06-18 05:22:32 +0900998default_dnssec = get_option('default-dnssec')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200999if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
Yu Watanabe42303dc2017-06-18 05:22:32 +09001000 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1001 default_dnssec = 'no'
1002endif
1003conf.set('DEFAULT_DNSSEC_MODE',
1004 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1005substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1006
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001007want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001008if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001009 have = (conf.get('HAVE_LIBCURL') == 1 and
1010 conf.get('HAVE_ZLIB') == 1 and
1011 conf.get('HAVE_BZIP2') == 1 and
1012 conf.get('HAVE_XZ') == 1 and
1013 conf.get('HAVE_GCRYPT') == 1)
1014 if want_importd == 'true' and not have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001015 error('importd support was requested, but dependencies are not available')
1016 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001017else
1018 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001019endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001020conf.set10('ENABLE_IMPORTD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001021
1022want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001023if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001024 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1025 conf.get('HAVE_LIBCURL') == 1]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001026 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1027 # it's possible to build one without the other. Complain only if
1028 # support was explictly requested. The auxiliary files like sysusers
1029 # config should be installed when any of the programs are built.
1030 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1031 error('remote support was requested, but dependencies are not available')
1032 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001033 have = have_deps[0] or have_deps[1]
1034else
1035 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001036endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001037conf.set10('ENABLE_REMOTE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001038
Zbigniew Jędrzejewski-Szmeka9149d82017-10-03 13:15:27 +02001039foreach term : ['utmp',
1040 'hibernate',
1041 'environment-d',
1042 'binfmt',
1043 'coredump',
1044 'resolve',
1045 'logind',
1046 'hostnamed',
1047 'localed',
1048 'machined',
1049 'networkd',
1050 'timedated',
1051 'timesyncd',
1052 'myhostname',
1053 'firstboot',
1054 'randomseed',
1055 'backlight',
1056 'vconsole',
1057 'quotacheck',
1058 'sysusers',
1059 'tmpfiles',
1060 'hwdb',
1061 'rfkill',
1062 'ldconfig',
1063 'efi',
1064 'tpm',
1065 'ima',
1066 'smack',
1067 'gshadow',
1068 'idn',
1069 'nss-systemd']
1070 have = get_option(term)
1071 name = 'ENABLE_' + term.underscorify().to_upper()
1072 conf.set10(name, have)
1073 m4_defines += have ? ['-D' + name] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001074endforeach
1075
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001076want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001077install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001078tests = []
1079
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001080conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1081
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001082#####################################################################
1083
1084if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001085 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001086
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001087 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001088 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001089 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001090 elif efi_arch == 'x86_64'
1091 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001092 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001093 elif efi_arch == 'arm'
1094 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001095 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001096 elif efi_arch == 'aarch64'
1097 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001098 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001099 else
1100 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001101 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001102 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001103
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001104 have = true
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001105 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001106
1107 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001108else
1109 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001110endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001111conf.set10('ENABLE_EFI', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001112
1113#####################################################################
1114
1115config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001116 output : 'config.h',
1117 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001118
1119includes = include_directories('src/basic',
1120 'src/shared',
1121 'src/systemd',
1122 'src/journal',
1123 'src/resolve',
1124 'src/timesync',
1125 'src/login',
1126 'src/udev',
1127 'src/libudev',
1128 'src/core',
1129 'src/libsystemd/sd-bus',
1130 'src/libsystemd/sd-device',
1131 'src/libsystemd/sd-hwdb',
1132 'src/libsystemd/sd-id128',
1133 'src/libsystemd/sd-netlink',
1134 'src/libsystemd/sd-network',
1135 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001136 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001137 )
1138
1139add_project_arguments('-include', 'config.h', language : 'c')
1140
1141gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1142 'src/shared/gcrypt-util.c')
1143
1144subdir('po')
1145subdir('catalog')
1146subdir('src/systemd')
1147subdir('src/basic')
1148subdir('src/libsystemd')
1149subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001150subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001151subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001152
1153libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001154 'journal-core',
1155 libjournal_core_sources,
1156 journald_gperf_c,
1157 include_directories : includes,
1158 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001159
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001160libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001161libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001162 'systemd',
1163 libsystemd_internal_sources,
1164 journal_internal_sources,
Zbigniew Jędrzejewski-Szmek56d50ab2017-09-28 19:24:16 +02001165 version : libsystemd_version,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001166 include_directories : includes,
1167 link_args : ['-shared',
1168 '-Wl,--version-script=' + libsystemd_sym_path],
1169 link_with : [libbasic],
1170 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001171 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001172 librt,
1173 libxz,
1174 liblz4],
1175 link_depends : libsystemd_sym,
1176 install : true,
1177 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001178
1179############################################################
1180
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001181# binaries that have --help and are intended for use by humans,
1182# usually, but not always, installed in /bin.
1183public_programs = []
1184
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001185subdir('src/libudev')
1186subdir('src/shared')
1187subdir('src/core')
1188subdir('src/udev')
1189subdir('src/network')
1190
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001191subdir('src/analyze')
1192subdir('src/journal-remote')
1193subdir('src/coredump')
1194subdir('src/hostname')
1195subdir('src/import')
1196subdir('src/kernel-install')
1197subdir('src/locale')
1198subdir('src/machine')
1199subdir('src/nspawn')
1200subdir('src/resolve')
1201subdir('src/timedate')
1202subdir('src/timesync')
1203subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001204subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001205subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001206
1207subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001208subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001209
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001210############################################################
1211
1212# only static linking apart from libdl, to make sure that the
1213# module is linked to all libraries that it uses.
1214test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001215 'test-dlopen',
1216 test_dlopen_c,
1217 include_directories : includes,
1218 link_with : [libbasic],
1219 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001220
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02001221foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001222 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001223 ['mymachines', 'ENABLE_MACHINED'],
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001224 ['resolve', 'ENABLE_RESOLVE']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001225
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001226 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001227 if condition
1228 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001229
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001230 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1231 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001232
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001233 nss = shared_library(
1234 'nss_' + module,
1235 'src/nss-@0@/nss-@0@.c'.format(module),
1236 version : '2',
1237 include_directories : includes,
1238 link_args : ['-shared',
1239 '-Wl,--version-script=' + version_script_arg,
1240 '-Wl,--undefined'],
1241 link_with : [libsystemd_internal,
1242 libbasic],
1243 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001244 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001245 link_depends : sym,
1246 install : true,
1247 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001248
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001249 # We cannot use shared_module because it does not support version suffix.
1250 # Unfortunately shared_library insists on creating the symlink…
1251 meson.add_install_script('sh', '-c',
1252 'rm $DESTDIR@0@/libnss_@1@.so'
1253 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001254
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001255 test('dlopen-nss_' + module,
1256 test_dlopen,
1257 args : [nss.full_path()]) # path to dlopen must include a slash
1258 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001259endforeach
1260
1261############################################################
1262
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001263executable('systemd',
1264 systemd_sources,
1265 include_directories : includes,
1266 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001267 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001268 dependencies : [threads,
1269 librt,
1270 libseccomp,
1271 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001272 libmount,
1273 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001274 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001275 install : true,
1276 install_dir : rootlibexecdir)
1277
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001278exe = executable('systemd-analyze',
1279 systemd_analyze_sources,
1280 include_directories : includes,
1281 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001282 libshared],
1283 dependencies : [threads,
1284 librt,
1285 libseccomp,
1286 libselinux,
1287 libmount,
1288 libblkid],
1289 install_rpath : rootlibexecdir,
1290 install : true)
1291public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001292
1293executable('systemd-journald',
1294 systemd_journald_sources,
1295 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001296 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001297 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001298 dependencies : [threads,
1299 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001300 liblz4,
1301 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001302 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001303 install : true,
1304 install_dir : rootlibexecdir)
1305
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001306exe = executable('systemd-cat',
1307 systemd_cat_sources,
1308 include_directories : includes,
1309 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001310 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001311 dependencies : [threads],
1312 install_rpath : rootlibexecdir,
1313 install : true)
1314public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001315
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001316exe = executable('journalctl',
1317 journalctl_sources,
1318 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001319 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001320 dependencies : [threads,
1321 libqrencode,
1322 libxz,
1323 liblz4],
1324 install_rpath : rootlibexecdir,
1325 install : true,
1326 install_dir : rootbindir)
1327public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001328
1329executable('systemd-getty-generator',
1330 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001331 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001332 link_with : [libshared],
1333 install_rpath : rootlibexecdir,
1334 install : true,
1335 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001336
1337executable('systemd-debug-generator',
1338 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001339 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001340 link_with : [libshared],
1341 install_rpath : rootlibexecdir,
1342 install : true,
1343 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001344
1345executable('systemd-fstab-generator',
1346 'src/fstab-generator/fstab-generator.c',
1347 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001348 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001349 link_with : [libshared],
1350 install_rpath : rootlibexecdir,
1351 install : true,
1352 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001353
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001354if conf.get('ENABLE_ENVIRONMENT_D') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001355 executable('30-systemd-environment-d-generator',
1356 'src/environment-d-generator/environment-d-generator.c',
1357 include_directories : includes,
1358 link_with : [libshared],
1359 install_rpath : rootlibexecdir,
1360 install : true,
1361 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001362
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001363 meson.add_install_script(meson_make_symlink,
1364 join_paths(sysconfdir, 'environment'),
1365 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001366endif
1367
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001368if conf.get('ENABLE_HIBERNATE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001369 executable('systemd-hibernate-resume-generator',
1370 'src/hibernate-resume/hibernate-resume-generator.c',
1371 include_directories : includes,
1372 link_with : [libshared],
1373 install_rpath : rootlibexecdir,
1374 install : true,
1375 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001376
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001377 executable('systemd-hibernate-resume',
1378 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001379 include_directories : includes,
1380 link_with : [libshared],
1381 install_rpath : rootlibexecdir,
1382 install : true,
1383 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001384endif
1385
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001386if conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001387 executable('systemd-gpt-auto-generator',
1388 'src/gpt-auto-generator/gpt-auto-generator.c',
1389 'src/basic/blkid-util.h',
1390 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001391 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001392 dependencies : libblkid,
1393 install_rpath : rootlibexecdir,
1394 install : true,
1395 install_dir : systemgeneratordir)
1396
1397 exe = executable('systemd-dissect',
1398 'src/dissect/dissect.c',
1399 include_directories : includes,
1400 link_with : [libshared],
1401 install_rpath : rootlibexecdir,
1402 install : true,
1403 install_dir : rootlibexecdir)
1404 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001405endif
1406
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001407if conf.get('ENABLE_RESOLVE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001408 executable('systemd-resolved',
1409 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001410 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001411 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001412 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001413 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001414 libgcrypt,
1415 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001416 libm,
1417 libidn],
1418 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001419 install : true,
1420 install_dir : rootlibexecdir)
1421
1422 exe = executable('systemd-resolve',
1423 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001424 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001425 include_directories : includes,
1426 link_with : [libshared],
1427 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001428 libgcrypt,
1429 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001430 libm,
1431 libidn],
1432 install_rpath : rootlibexecdir,
1433 install : true)
1434 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001435endif
1436
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001437if conf.get('ENABLE_LOGIND') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001438 executable('systemd-logind',
1439 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001440 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001441 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001442 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001443 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001444 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001445 install_rpath : rootlibexecdir,
1446 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001447 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001448
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001449 exe = executable('loginctl',
1450 loginctl_sources,
1451 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001452 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001453 dependencies : [threads,
1454 liblz4,
1455 libxz],
1456 install_rpath : rootlibexecdir,
1457 install : true,
1458 install_dir : rootbindir)
1459 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001460
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001461 exe = executable('systemd-inhibit',
1462 'src/login/inhibit.c',
1463 include_directories : includes,
1464 link_with : [libshared],
1465 install_rpath : rootlibexecdir,
1466 install : true,
1467 install_dir : rootbindir)
1468 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001469
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001470 if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001471 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1472 pam_systemd = shared_library(
1473 'pam_systemd',
1474 pam_systemd_c,
1475 name_prefix : '',
1476 include_directories : includes,
1477 link_args : ['-shared',
1478 '-Wl,--version-script=' + version_script_arg],
1479 link_with : [libsystemd_internal,
1480 libshared_static],
1481 dependencies : [threads,
1482 libpam,
1483 libpam_misc],
1484 link_depends : pam_systemd_sym,
1485 install : true,
1486 install_dir : pamlibdir)
1487
1488 test('dlopen-pam_systemd',
1489 test_dlopen,
1490 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1491 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001492endif
1493
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001494if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001495 executable('systemd-user-sessions',
1496 'src/user-sessions/user-sessions.c',
1497 include_directories : includes,
1498 link_with : [libshared],
1499 install_rpath : rootlibexecdir,
1500 install : true,
1501 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001502endif
1503
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001504if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001505 exe = executable('bootctl',
1506 'src/boot/bootctl.c',
1507 include_directories : includes,
1508 link_with : [libshared],
1509 dependencies : [libblkid],
1510 install_rpath : rootlibexecdir,
1511 install : true)
1512 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001513endif
1514
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001515exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1516 include_directories : includes,
1517 link_with : [libshared],
1518 dependencies : [threads],
1519 install_rpath : rootlibexecdir,
1520 install : true)
1521public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001522
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001523exe = executable('systemctl', 'src/systemctl/systemctl.c',
1524 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001525 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001526 dependencies : [threads,
1527 libcap,
1528 libselinux,
1529 libxz,
1530 liblz4],
1531 install_rpath : rootlibexecdir,
1532 install : true,
1533 install_dir : rootbindir)
1534public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001535
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001536if conf.get('ENABLE_BACKLIGHT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001537 executable('systemd-backlight',
1538 'src/backlight/backlight.c',
1539 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001540 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001541 install_rpath : rootlibexecdir,
1542 install : true,
1543 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001544endif
1545
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001546if conf.get('ENABLE_RFKILL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001547 executable('systemd-rfkill',
1548 'src/rfkill/rfkill.c',
1549 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001550 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001551 install_rpath : rootlibexecdir,
1552 install : true,
1553 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001554endif
1555
1556executable('systemd-system-update-generator',
1557 'src/system-update-generator/system-update-generator.c',
1558 include_directories : includes,
1559 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001560 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001561 install : true,
1562 install_dir : systemgeneratordir)
1563
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001564if conf.get('HAVE_LIBCRYPTSETUP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001565 executable('systemd-cryptsetup',
1566 'src/cryptsetup/cryptsetup.c',
1567 include_directories : includes,
1568 link_with : [libshared],
1569 dependencies : [libcryptsetup],
1570 install_rpath : rootlibexecdir,
1571 install : true,
1572 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001573
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001574 executable('systemd-cryptsetup-generator',
1575 'src/cryptsetup/cryptsetup-generator.c',
1576 include_directories : includes,
1577 link_with : [libshared],
1578 dependencies : [libcryptsetup],
1579 install_rpath : rootlibexecdir,
1580 install : true,
1581 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001582
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001583 executable('systemd-veritysetup',
1584 'src/veritysetup/veritysetup.c',
1585 include_directories : includes,
1586 link_with : [libshared],
1587 dependencies : [libcryptsetup],
1588 install_rpath : rootlibexecdir,
1589 install : true,
1590 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001591
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001592 executable('systemd-veritysetup-generator',
1593 'src/veritysetup/veritysetup-generator.c',
1594 include_directories : includes,
1595 link_with : [libshared],
1596 dependencies : [libcryptsetup],
1597 install_rpath : rootlibexecdir,
1598 install : true,
1599 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001600endif
1601
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001602if conf.get('HAVE_SYSV_COMPAT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001603 executable('systemd-sysv-generator',
1604 'src/sysv-generator/sysv-generator.c',
1605 include_directories : includes,
1606 link_with : [libshared],
1607 install_rpath : rootlibexecdir,
1608 install : true,
1609 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001610
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001611 executable('systemd-rc-local-generator',
1612 'src/rc-local-generator/rc-local-generator.c',
1613 include_directories : includes,
1614 link_with : [libshared],
1615 install_rpath : rootlibexecdir,
1616 install : true,
1617 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001618endif
1619
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001620if conf.get('ENABLE_HOSTNAMED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001621 executable('systemd-hostnamed',
1622 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001623 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001624 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001625 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001626 install : true,
1627 install_dir : rootlibexecdir)
1628
1629 exe = executable('hostnamectl',
1630 'src/hostname/hostnamectl.c',
1631 include_directories : includes,
1632 link_with : [libshared],
1633 install_rpath : rootlibexecdir,
1634 install : true)
1635 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001636endif
1637
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001638if conf.get('ENABLE_LOCALED') == 1
1639 if conf.get('HAVE_XKBCOMMON') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001640 # logind will load libxkbcommon.so dynamically on its own
1641 deps = [libdl]
1642 else
1643 deps = []
1644 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001645
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001646 executable('systemd-localed',
1647 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001648 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001649 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001650 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001651 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001652 install : true,
1653 install_dir : rootlibexecdir)
1654
1655 exe = executable('localectl',
1656 localectl_sources,
1657 include_directories : includes,
1658 link_with : [libshared],
1659 install_rpath : rootlibexecdir,
1660 install : true)
1661 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001662endif
1663
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001664if conf.get('ENABLE_TIMEDATED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001665 executable('systemd-timedated',
1666 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001667 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001668 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001669 install_rpath : rootlibexecdir,
1670 install : true,
1671 install_dir : rootlibexecdir)
1672
1673 exe = executable('timedatectl',
1674 'src/timedate/timedatectl.c',
1675 include_directories : includes,
1676 install_rpath : rootlibexecdir,
1677 link_with : [libshared],
1678 install : true)
1679 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001680endif
1681
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001682if conf.get('ENABLE_TIMESYNCD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001683 executable('systemd-timesyncd',
1684 systemd_timesyncd_sources,
1685 include_directories : includes,
1686 link_with : [libshared],
1687 dependencies : [threads,
1688 libm],
1689 install_rpath : rootlibexecdir,
1690 install : true,
1691 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001692endif
1693
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001694if conf.get('ENABLE_MACHINED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001695 executable('systemd-machined',
1696 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001697 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001698 link_with : [libmachine_core,
1699 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001700 install_rpath : rootlibexecdir,
1701 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001702 install_dir : rootlibexecdir)
1703
1704 exe = executable('machinectl',
1705 'src/machine/machinectl.c',
1706 include_directories : includes,
1707 link_with : [libshared],
1708 dependencies : [threads,
1709 libxz,
1710 liblz4],
1711 install_rpath : rootlibexecdir,
1712 install : true,
1713 install_dir : rootbindir)
1714 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001715endif
1716
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001717if conf.get('ENABLE_IMPORTD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001718 executable('systemd-importd',
1719 systemd_importd_sources,
1720 include_directories : includes,
1721 link_with : [libshared],
1722 dependencies : [threads],
1723 install_rpath : rootlibexecdir,
1724 install : true,
1725 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001726
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001727 systemd_pull = executable('systemd-pull',
1728 systemd_pull_sources,
1729 include_directories : includes,
1730 link_with : [libshared],
1731 dependencies : [libcurl,
1732 libz,
1733 libbzip2,
1734 libxz,
1735 libgcrypt],
1736 install_rpath : rootlibexecdir,
1737 install : true,
1738 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001739
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001740 systemd_import = executable('systemd-import',
1741 systemd_import_sources,
1742 include_directories : includes,
1743 link_with : [libshared],
1744 dependencies : [libcurl,
1745 libz,
1746 libbzip2,
1747 libxz],
1748 install_rpath : rootlibexecdir,
1749 install : true,
1750 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001751
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001752 systemd_export = executable('systemd-export',
1753 systemd_export_sources,
1754 include_directories : includes,
1755 link_with : [libshared],
1756 dependencies : [libcurl,
1757 libz,
1758 libbzip2,
1759 libxz],
1760 install_rpath : rootlibexecdir,
1761 install : true,
1762 install_dir : rootlibexecdir)
1763 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001764endif
1765
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001766if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001767 exe = executable('systemd-journal-upload',
1768 systemd_journal_upload_sources,
1769 include_directories : includes,
1770 link_with : [libshared],
1771 dependencies : [threads,
1772 libcurl,
1773 libgnutls,
1774 libxz,
1775 liblz4],
1776 install_rpath : rootlibexecdir,
1777 install : true,
1778 install_dir : rootlibexecdir)
1779 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001780endif
1781
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001782if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001783 s_j_remote = executable('systemd-journal-remote',
1784 systemd_journal_remote_sources,
1785 include_directories : includes,
1786 link_with : [libshared],
1787 dependencies : [threads,
1788 libmicrohttpd,
1789 libgnutls,
1790 libxz,
1791 liblz4],
1792 install_rpath : rootlibexecdir,
1793 install : true,
1794 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001795
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001796 s_j_gatewayd = executable('systemd-journal-gatewayd',
1797 systemd_journal_gatewayd_sources,
1798 include_directories : includes,
1799 link_with : [libshared],
1800 dependencies : [threads,
1801 libmicrohttpd,
1802 libgnutls,
1803 libxz,
1804 liblz4],
1805 install_rpath : rootlibexecdir,
1806 install : true,
1807 install_dir : rootlibexecdir)
1808 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001809endif
1810
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001811if conf.get('ENABLE_COREDUMP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001812 executable('systemd-coredump',
1813 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001814 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001815 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001816 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001817 libacl,
1818 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001819 libxz,
1820 liblz4],
1821 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001822 install : true,
1823 install_dir : rootlibexecdir)
1824
1825 exe = executable('coredumpctl',
1826 coredumpctl_sources,
1827 include_directories : includes,
1828 link_with : [libshared],
1829 dependencies : [threads,
1830 libxz,
1831 liblz4],
1832 install_rpath : rootlibexecdir,
1833 install : true)
1834 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001835endif
1836
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001837if conf.get('ENABLE_BINFMT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001838 exe = executable('systemd-binfmt',
1839 'src/binfmt/binfmt.c',
1840 include_directories : includes,
1841 link_with : [libshared],
1842 install_rpath : rootlibexecdir,
1843 install : true,
1844 install_dir : rootlibexecdir)
1845 public_programs += [exe]
1846
1847 meson.add_install_script('sh', '-c',
1848 mkdir_p.format(binfmtdir))
1849 meson.add_install_script('sh', '-c',
1850 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1851endif
1852
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001853if conf.get('ENABLE_VCONSOLE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001854 executable('systemd-vconsole-setup',
1855 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001856 include_directories : includes,
1857 link_with : [libshared],
1858 install_rpath : rootlibexecdir,
1859 install : true,
1860 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001861endif
1862
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001863if conf.get('ENABLE_RANDOMSEED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001864 executable('systemd-random-seed',
1865 'src/random-seed/random-seed.c',
1866 include_directories : includes,
1867 link_with : [libshared],
1868 install_rpath : rootlibexecdir,
1869 install : true,
1870 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001871endif
1872
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001873if conf.get('ENABLE_FIRSTBOOT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001874 executable('systemd-firstboot',
1875 'src/firstboot/firstboot.c',
1876 include_directories : includes,
1877 link_with : [libshared],
1878 dependencies : [libcrypt],
1879 install_rpath : rootlibexecdir,
1880 install : true,
1881 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001882endif
1883
1884executable('systemd-remount-fs',
1885 'src/remount-fs/remount-fs.c',
1886 'src/core/mount-setup.c',
1887 'src/core/mount-setup.h',
1888 include_directories : includes,
1889 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001890 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001891 install : true,
1892 install_dir : rootlibexecdir)
1893
1894executable('systemd-machine-id-setup',
1895 'src/machine-id-setup/machine-id-setup-main.c',
1896 'src/core/machine-id-setup.c',
1897 'src/core/machine-id-setup.h',
1898 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001899 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001900 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001901 install : true,
1902 install_dir : rootbindir)
1903
1904executable('systemd-fsck',
1905 'src/fsck/fsck.c',
1906 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001907 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001908 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001909 install : true,
1910 install_dir : rootlibexecdir)
1911
1912executable('systemd-sleep',
1913 'src/sleep/sleep.c',
1914 include_directories : includes,
1915 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001916 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001917 install : true,
1918 install_dir : rootlibexecdir)
1919
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001920exe = executable('systemd-sysctl',
1921 'src/sysctl/sysctl.c',
1922 include_directories : includes,
1923 link_with : [libshared],
1924 install_rpath : rootlibexecdir,
1925 install : true,
1926 install_dir : rootlibexecdir)
1927public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001928
1929executable('systemd-ac-power',
1930 'src/ac-power/ac-power.c',
1931 include_directories : includes,
1932 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001933 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001934 install : true,
1935 install_dir : rootlibexecdir)
1936
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001937exe = executable('systemd-detect-virt',
1938 'src/detect-virt/detect-virt.c',
1939 include_directories : includes,
1940 link_with : [libshared],
1941 install_rpath : rootlibexecdir,
1942 install : true)
1943public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001944
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001945exe = executable('systemd-delta',
1946 'src/delta/delta.c',
1947 include_directories : includes,
1948 link_with : [libshared],
1949 install_rpath : rootlibexecdir,
1950 install : true)
1951public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001952
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001953exe = executable('systemd-escape',
1954 'src/escape/escape.c',
1955 include_directories : includes,
1956 link_with : [libshared],
1957 install_rpath : rootlibexecdir,
1958 install : true,
1959 install_dir : rootbindir)
1960public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001961
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001962exe = executable('systemd-notify',
1963 'src/notify/notify.c',
1964 include_directories : includes,
1965 link_with : [libshared],
1966 install_rpath : rootlibexecdir,
1967 install : true,
1968 install_dir : rootbindir)
1969public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001970
1971executable('systemd-volatile-root',
1972 'src/volatile-root/volatile-root.c',
1973 include_directories : includes,
1974 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001975 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001976 install : true,
1977 install_dir : rootlibexecdir)
1978
1979executable('systemd-cgroups-agent',
1980 'src/cgroups-agent/cgroups-agent.c',
1981 include_directories : includes,
1982 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001983 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001984 install : true,
1985 install_dir : rootlibexecdir)
1986
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001987exe = executable('systemd-path',
1988 'src/path/path.c',
1989 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001990 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001991 install_rpath : rootlibexecdir,
1992 install : true)
1993public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001994
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001995exe = executable('systemd-ask-password',
1996 'src/ask-password/ask-password.c',
1997 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001998 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001999 install_rpath : rootlibexecdir,
2000 install : true,
2001 install_dir : rootbindir)
2002public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002003
2004executable('systemd-reply-password',
2005 'src/reply-password/reply-password.c',
2006 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002007 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002008 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002009 install : true,
2010 install_dir : rootlibexecdir)
2011
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002012exe = executable('systemd-tty-ask-password-agent',
2013 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2014 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002015 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002016 install_rpath : rootlibexecdir,
2017 install : true,
2018 install_dir : rootbindir)
2019public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002020
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002021exe = executable('systemd-cgls',
2022 'src/cgls/cgls.c',
2023 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002024 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002025 install_rpath : rootlibexecdir,
2026 install : true)
2027public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002028
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002029exe = executable('systemd-cgtop',
2030 'src/cgtop/cgtop.c',
2031 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002032 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002033 install_rpath : rootlibexecdir,
2034 install : true)
2035public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002036
2037executable('systemd-initctl',
2038 'src/initctl/initctl.c',
2039 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002040 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002041 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002042 install : true,
2043 install_dir : rootlibexecdir)
2044
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002045exe = executable('systemd-mount',
2046 'src/mount/mount-tool.c',
2047 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002048 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002049 install_rpath : rootlibexecdir,
2050 install : true)
2051public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002052
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002053meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002054 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002055
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002056exe = executable('systemd-run',
2057 'src/run/run.c',
2058 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002059 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002060 install_rpath : rootlibexecdir,
2061 install : true)
2062public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002063
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002064exe = executable('systemd-stdio-bridge',
2065 'src/stdio-bridge/stdio-bridge.c',
2066 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002067 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002068 install_rpath : rootlibexecdir,
2069 install : true)
2070public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002071
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002072exe = executable('busctl',
2073 'src/busctl/busctl.c',
2074 'src/busctl/busctl-introspect.c',
2075 'src/busctl/busctl-introspect.h',
2076 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002077 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002078 install_rpath : rootlibexecdir,
2079 install : true)
2080public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002081
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002082if conf.get('ENABLE_SYSUSERS') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002083 exe = executable('systemd-sysusers',
2084 'src/sysusers/sysusers.c',
2085 include_directories : includes,
2086 link_with : [libshared],
2087 install_rpath : rootlibexecdir,
2088 install : true,
2089 install_dir : rootbindir)
2090 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002091endif
2092
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002093if conf.get('ENABLE_TMPFILES') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002094 exe = executable('systemd-tmpfiles',
2095 'src/tmpfiles/tmpfiles.c',
2096 include_directories : includes,
2097 link_with : [libshared],
2098 dependencies : [libacl],
2099 install_rpath : rootlibexecdir,
2100 install : true,
2101 install_dir : rootbindir)
2102 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002103endif
2104
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002105if conf.get('ENABLE_HWDB') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002106 exe = executable('systemd-hwdb',
2107 'src/hwdb/hwdb.c',
2108 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2109 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002110 link_with : [libudev_internal],
2111 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002112 install : true,
2113 install_dir : rootbindir)
2114 public_programs += [exe]
2115endif
2116
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002117if conf.get('ENABLE_QUOTACHECK') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002118 executable('systemd-quotacheck',
2119 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002120 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002121 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002122 install_rpath : rootlibexecdir,
2123 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002124 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002125endif
2126
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002127exe = executable('systemd-socket-proxyd',
2128 'src/socket-proxy/socket-proxyd.c',
2129 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002130 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002131 dependencies : [threads],
2132 install_rpath : rootlibexecdir,
2133 install : true,
2134 install_dir : rootlibexecdir)
2135public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002136
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002137exe = executable('systemd-udevd',
2138 systemd_udevd_sources,
2139 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002140 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002141 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002142 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002143 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002144 dependencies : [threads,
2145 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002146 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002147 libacl,
2148 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002149 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002150 install : true,
2151 install_dir : rootlibexecdir)
2152public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002153
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002154exe = executable('udevadm',
2155 udevadm_sources,
2156 include_directories : includes,
2157 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002158 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002159 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002160 dependencies : [threads,
2161 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002162 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002163 libacl,
2164 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002165 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002166 install : true,
2167 install_dir : rootbindir)
2168public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002169
2170executable('systemd-shutdown',
2171 systemd_shutdown_sources,
2172 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002173 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002174 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002175 install : true,
2176 install_dir : rootlibexecdir)
2177
2178executable('systemd-update-done',
2179 'src/update-done/update-done.c',
2180 include_directories : includes,
2181 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002182 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002183 install : true,
2184 install_dir : rootlibexecdir)
2185
2186executable('systemd-update-utmp',
2187 'src/update-utmp/update-utmp.c',
2188 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002189 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002190 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002191 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002192 install : true,
2193 install_dir : rootlibexecdir)
2194
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002195if conf.get('HAVE_KMOD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002196 executable('systemd-modules-load',
2197 'src/modules-load/modules-load.c',
2198 include_directories : includes,
2199 link_with : [libshared],
2200 dependencies : [libkmod],
2201 install_rpath : rootlibexecdir,
2202 install : true,
2203 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002204
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002205 meson.add_install_script('sh', '-c',
2206 mkdir_p.format(modulesloaddir))
2207 meson.add_install_script('sh', '-c',
2208 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002209endif
2210
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002211exe = executable('systemd-nspawn',
2212 systemd_nspawn_sources,
2213 'src/core/mount-setup.c', # FIXME: use a variable?
2214 'src/core/mount-setup.h',
2215 'src/core/loopback-setup.c',
2216 'src/core/loopback-setup.h',
2217 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002218 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002219 dependencies : [libacl,
2220 libblkid,
2221 libseccomp,
2222 libselinux],
2223 install_rpath : rootlibexecdir,
2224 install : true)
2225public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002226
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002227if conf.get('ENABLE_NETWORKD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002228 executable('systemd-networkd',
2229 systemd_networkd_sources,
2230 include_directories : includes,
2231 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002232 libsystemd_network,
2233 libudev_internal,
2234 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002235 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002236 install_rpath : rootlibexecdir,
2237 install : true,
2238 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002239
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002240 executable('systemd-networkd-wait-online',
2241 systemd_networkd_wait_online_sources,
2242 include_directories : includes,
2243 link_with : [libnetworkd_core,
2244 libshared],
2245 install_rpath : rootlibexecdir,
2246 install : true,
2247 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002248
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002249 exe = executable('networkctl',
2250 networkctl_sources,
2251 include_directories : includes,
2252 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002253 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002254 install_rpath : rootlibexecdir,
2255 install : true,
2256 install_dir : rootbindir)
2257 public_programs += [exe]
2258endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002259############################################################
2260
2261foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002262 sources = tuple[0]
2263 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2264 dependencies = tuple[2]
2265 condition = tuple.length() >= 4 ? tuple[3] : ''
2266 type = tuple.length() >= 5 ? tuple[4] : ''
2267 defs = tuple.length() >= 6 ? tuple[5] : []
2268 incs = tuple.length() >= 7 ? tuple[6] : includes
2269 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002270
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002271 name = sources[0].split('/')[-1].split('.')[0]
2272 if type.startswith('timeout=')
2273 timeout = type.split('=')[1].to_int()
2274 type = ''
2275 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002276
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002277 if condition == '' or conf.get(condition) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002278 exe = executable(
2279 name,
2280 sources,
2281 include_directories : incs,
2282 link_with : link_with,
2283 dependencies : dependencies,
2284 c_args : defs,
2285 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002286 install : install_tests,
2287 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002288
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002289 if type == 'manual'
2290 message('@0@ is a manual test'.format(name))
2291 elif type == 'unsafe' and want_tests != 'unsafe'
2292 message('@0@ is an unsafe test'.format(name))
2293 else
2294 test(name, exe,
2295 env : test_env,
2296 timeout : timeout)
2297 endif
2298 else
2299 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2300 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002301endforeach
2302
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002303test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002304 'test-libsystemd-sym',
2305 test_libsystemd_sym_c,
2306 include_directories : includes,
2307 link_with : [libsystemd],
2308 install : install_tests,
2309 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002310test('test-libsystemd-sym',
2311 test_libsystemd_sym)
2312
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002313test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002314 'test-libudev-sym',
2315 test_libudev_sym_c,
2316 include_directories : includes,
2317 c_args : ['-Wno-deprecated-declarations'],
2318 link_with : [libudev],
2319 install : install_tests,
2320 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002321test('test-libudev-sym',
2322 test_libudev_sym)
2323
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002324############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002325
2326make_directive_index_py = find_program('tools/make-directive-index.py')
2327make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002328xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002329hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002330
2331subdir('units')
2332subdir('sysctl.d')
2333subdir('sysusers.d')
2334subdir('tmpfiles.d')
2335subdir('rules')
2336subdir('hwdb')
2337subdir('network')
2338subdir('man')
2339subdir('shell-completion/bash')
2340subdir('shell-completion/zsh')
2341subdir('docs/sysvinit')
2342subdir('docs/var-log')
2343
2344# FIXME: figure out if the warning is true:
2345# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2346install_subdir('factory/etc',
2347 install_dir : factorydir)
2348
2349
2350install_data('xorg/50-systemd-user.sh',
2351 install_dir : xinitrcdir)
2352install_data('system-preset/90-systemd.preset',
2353 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002354install_data('modprobe.d/systemd.conf',
2355 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002356install_data('README',
2357 'NEWS',
2358 'CODING_STYLE',
2359 'DISTRO_PORTING',
2360 'ENVIRONMENT.md',
2361 'LICENSE.GPL2',
2362 'LICENSE.LGPL2.1',
2363 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2364 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002365
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002366meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2367meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2368
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002369############################################################
2370
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002371meson_check_help = find_program('tools/meson-check-help.sh')
2372
2373foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002374 name = exec.full_path().split('/')[-1]
2375 test('check-help-' + name,
2376 meson_check_help,
2377 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002378endforeach
2379
2380############################################################
2381
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002382if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002383 all_files = run_command(
2384 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002385 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002386 'ls-files',
2387 ':/*.[ch]'])
2388 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002389
userwithuide85a6902017-08-09 13:41:44 +00002390 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002391 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002392 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002393 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002394 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002395 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002396 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002397 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002398endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002399
2400if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002401 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002402 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002403 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002404 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002405endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002406
2407if git.found()
2408 git_head = run_command(
2409 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002410 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002411 'rev-parse', 'HEAD']).stdout().strip()
2412 git_head_short = run_command(
2413 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002414 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002415 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2416
2417 run_target(
2418 'git-snapshot',
2419 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002420 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002421 git_head_short),
2422 '--prefix', 'systemd-@0@/'.format(git_head),
2423 'HEAD'])
2424endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002425
2426############################################################
2427
2428status = [
2429 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2430
2431 'prefix: @0@'.format(prefixdir),
2432 'rootprefix: @0@'.format(rootprefixdir),
2433 'sysconf dir: @0@'.format(sysconfdir),
2434 'includedir: @0@'.format(includedir),
2435 'lib dir: @0@'.format(libdir),
2436 'rootlib dir: @0@'.format(rootlibdir),
2437 'SysV init scripts: @0@'.format(sysvinit_path),
2438 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2439 'PAM modules dir: @0@'.format(pamlibdir),
2440 'PAM configuration dir: @0@'.format(pamconfdir),
2441 'RPM macros dir: @0@'.format(rpmmacrosdir),
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002442 'modprobe.d dir: @0@'.format(modprobedir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002443 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2444 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2445 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2446 'bash completions dir: @0@'.format(bashcompletiondir),
2447 'zsh completions dir: @0@'.format(zshcompletiondir),
2448 'extra start script: @0@'.format(get_option('rc-local')),
2449 'extra stop script: @0@'.format(get_option('halt-local')),
2450 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2451 get_option('debug-tty')),
2452 'TTY GID: @0@'.format(tty_gid),
2453 'maximum system UID: @0@'.format(system_uid_max),
2454 'maximum system GID: @0@'.format(system_gid_max),
2455 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2456 'certificate root: @0@'.format(get_option('certificate-root')),
2457 'support URL: @0@'.format(support_url),
2458 'nobody user name: @0@'.format(get_option('nobody-user')),
2459 'nobody group name: @0@'.format(get_option('nobody-group')),
2460 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002461 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002462
2463 'default DNSSEC mode: @0@'.format(default_dnssec),
2464 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2465 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2466
2467alt_dns_servers = '\n '.join(dns_servers.split(' '))
2468alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2469status += [
2470 'default DNS servers: @0@'.format(alt_dns_servers),
2471 'default NTP servers: @0@'.format(alt_ntp_servers)]
2472
2473alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2474 '@@0@'.format(time_epoch)).stdout().strip()
2475status += [
2476 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2477
2478# TODO:
2479# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2480# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2481# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2482
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002483if conf.get('ENABLE_EFI') == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002484 status += [
2485 'efi arch: @0@'.format(efi_arch)]
2486
2487 if have_gnu_efi
2488 status += [
2489 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2490 'EFI CC @0@'.format(efi_cc),
2491 'EFI libdir: @0@'.format(efi_libdir),
2492 'EFI ldsdir: @0@'.format(efi_ldsdir),
2493 'EFI includedir: @0@'.format(efi_incdir)]
2494 endif
2495endif
2496
2497found = []
2498missing = []
2499
2500foreach tuple : [
2501 ['libcryptsetup'],
2502 ['PAM'],
2503 ['AUDIT'],
2504 ['IMA'],
2505 ['AppArmor'],
2506 ['SELinux'],
2507 ['SECCOMP'],
2508 ['SMACK'],
2509 ['zlib'],
2510 ['xz'],
2511 ['lz4'],
2512 ['bzip2'],
2513 ['ACL'],
2514 ['gcrypt'],
2515 ['qrencode'],
2516 ['microhttpd'],
2517 ['gnutls'],
2518 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002519 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002520 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002521 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002522 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002523 ['libiptc'],
2524 ['elfutils'],
2525 ['binfmt'],
2526 ['vconsole'],
2527 ['quotacheck'],
2528 ['tmpfiles'],
2529 ['environment.d'],
2530 ['sysusers'],
2531 ['firstboot'],
2532 ['randomseed'],
2533 ['backlight'],
2534 ['rfkill'],
2535 ['logind'],
2536 ['machined'],
2537 ['importd'],
2538 ['hostnamed'],
2539 ['timedated'],
2540 ['timesyncd'],
2541 ['localed'],
2542 ['networkd'],
2543 ['resolved'],
2544 ['coredump'],
2545 ['polkit'],
2546 ['legacy pkla', install_polkit_pkla],
2547 ['efi'],
2548 ['gnu-efi', have_gnu_efi],
2549 ['kmod'],
2550 ['xkbcommon'],
2551 ['blkid'],
2552 ['dbus'],
2553 ['glib'],
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02002554 ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002555 ['hwdb'],
2556 ['tpm'],
2557 ['man pages', want_man],
2558 ['html pages', want_html],
2559 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002560 ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002561 ['SysV compat'],
2562 ['utmp'],
2563 ['ldconfig'],
2564 ['hibernate'],
2565 ['adm group', get_option('adm-group')],
2566 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002567 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002568 ['debug hashmap'],
2569 ['debug mmap cache'],
2570]
2571
2572 cond = tuple.get(1, '')
2573 if cond == ''
2574 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2575 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002576 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002577 endif
2578 if cond
2579 found += [tuple[0]]
2580 else
2581 missing += [tuple[0]]
2582 endif
2583endforeach
2584
2585status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002586 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002587 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002588 '',
2589 'disabled features: @0@'.format(', '.join(missing)),
2590 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002591message('\n '.join(status))