blob: 7dcbeccb5737dfda2b659416826e7778fe3fb245 [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-Szmek5c231282017-04-04 23:03:47 -040041if get_option('split-usr')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040042 conf.set('HAVE_SPLIT_USR', true)
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')
50if sysvinit_path != '' or sysvrcnd_path != ''
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040051 conf.set('HAVE_SYSV_COMPAT', true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040052 description : 'SysV init scripts and rcN.d links are supported')
53 m4_defines += ['-DHAVE_SYSV_COMPAT']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040054endif
55
56# join_paths ignore the preceding arguments if an absolute component is
57# encountered, so this should canonicalize various paths when they are
58# absolute or relative.
59prefixdir = get_option('prefix')
60if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040061 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040062endif
63bindir = join_paths(prefixdir, get_option('bindir'))
64libdir = join_paths(prefixdir, get_option('libdir'))
65sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
66includedir = join_paths(prefixdir, get_option('includedir'))
67datadir = join_paths(prefixdir, get_option('datadir'))
68localstatedir = join_paths('/', get_option('localstatedir'))
69
70rootbindir = join_paths(rootprefixdir, 'bin')
71rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
72
73rootlibdir = get_option('rootlibdir')
74if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040075 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040076endif
77
78# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040079pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
80pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
81polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
82polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
83polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
84varlogdir = join_paths(localstatedir, 'log')
85xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040086rpmmacrosdir = get_option('rpmmacrosdir')
Yu Watanabead6fc5b2017-08-03 21:01:38 +090087modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040088
89# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -040090pkgdatadir = join_paths(datadir, 'systemd')
91environmentdir = join_paths(prefixdir, 'lib/environment.d')
92pkgsysconfdir = join_paths(sysconfdir, 'systemd')
93userunitdir = join_paths(prefixdir, 'lib/systemd/user')
94userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
95tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
96sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
97sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
98binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
99modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
100networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
101pkgincludedir = join_paths(includedir, 'systemd')
102systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
103usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
104systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
105userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
106systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
107systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
108systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
109systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
110udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
111udevhomedir = udevlibexecdir
112udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
113udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
114catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
115kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
116factorydir = join_paths(datadir, 'factory')
117docdir = join_paths(datadir, 'doc/systemd')
118bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
119testsdir = join_paths(prefixdir, 'lib/systemd/tests')
120systemdstatedir = join_paths(localstatedir, 'lib/systemd')
121catalogstatedir = join_paths(systemdstatedir, 'catalog')
122randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400123
124dbuspolicydir = get_option('dbuspolicydir')
125if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400126 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400127endif
128
129dbussessionservicedir = get_option('dbussessionservicedir')
130if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400131 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400132endif
133
134dbussystemservicedir = get_option('dbussystemservicedir')
135if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400136 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400137endif
138
139pamlibdir = get_option('pamlibdir')
140if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400141 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400142endif
143
144pamconfdir = get_option('pamconfdir')
145if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400146 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400147endif
148
149conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400150conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400151conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
152conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
153conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400154conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
155conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400156conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400157conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
158conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400159conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
160conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
161conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
162conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
163conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
164conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
165conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
166conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
167conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400168conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400169conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400170conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
171conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400172conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
173conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
174conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
175conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
176conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
177conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400178conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
179conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400180conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400181conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400182conf.set_quoted('LIBDIR', libdir)
183conf.set_quoted('ROOTLIBDIR', rootlibdir)
184conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
185conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400186conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
187conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
188conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
189conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
190conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
191conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400192
193conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
194conf.set_quoted('ABS_SRC_DIR', meson.source_root())
195
196substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400197substs.set('exec_prefix', prefixdir)
198substs.set('libdir', libdir)
199substs.set('rootlibdir', rootlibdir)
200substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400201substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400202substs.set('bindir', bindir)
203substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400204substs.set('rootlibexecdir', rootlibexecdir)
205substs.set('systemunitdir', systemunitdir)
206substs.set('userunitdir', userunitdir)
207substs.set('systempresetdir', systempresetdir)
208substs.set('userpresetdir', userpresetdir)
209substs.set('udevhwdbdir', udevhwdbdir)
210substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400211substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400212substs.set('catalogdir', catalogdir)
213substs.set('tmpfilesdir', tmpfilesdir)
214substs.set('sysusersdir', sysusersdir)
215substs.set('sysctldir', sysctldir)
216substs.set('binfmtdir', binfmtdir)
217substs.set('modulesloaddir', modulesloaddir)
218substs.set('systemgeneratordir', systemgeneratordir)
219substs.set('usergeneratordir', usergeneratordir)
220substs.set('systemenvgeneratordir', systemenvgeneratordir)
221substs.set('userenvgeneratordir', userenvgeneratordir)
222substs.set('systemshutdowndir', systemshutdowndir)
223substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400224substs.set('VARLOGDIR', varlogdir)
225substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400226substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
227substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400228substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
229substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
230substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
231substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400232
233#####################################################################
234
235cc = meson.get_compiler('c')
236pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400237check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400238
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400239cxx = find_program('c++', required : false)
240if cxx.found()
241 # Used only for tests
242 add_languages('cpp')
243endif
244
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400245foreach arg : ['-Wextra',
246 '-Wundef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400247 '-Wlogical-op',
248 '-Wmissing-include-dirs',
249 '-Wold-style-definition',
250 '-Wpointer-arith',
251 '-Winit-self',
252 '-Wdeclaration-after-statement',
253 '-Wfloat-equal',
254 '-Wsuggest-attribute=noreturn',
255 '-Werror=missing-prototypes',
256 '-Werror=implicit-function-declaration',
257 '-Werror=missing-declarations',
258 '-Werror=return-type',
259 '-Werror=incompatible-pointer-types',
260 '-Werror=format=2',
261 '-Wstrict-prototypes',
262 '-Wredundant-decls',
263 '-Wmissing-noreturn',
264 '-Wshadow',
265 '-Wendif-labels',
266 '-Wstrict-aliasing=2',
267 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400268 '-Werror=overflow',
269 '-Wdate-time',
270 '-Wnested-externs',
271 '-ffast-math',
272 '-fno-common',
273 '-fdiagnostics-show-option',
274 '-fno-strict-aliasing',
275 '-fvisibility=hidden',
276 '-fstack-protector',
277 '-fstack-protector-strong',
278 '-fPIE',
279 '--param=ssp-buffer-size=4',
280 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400281 if cc.has_argument(arg)
282 add_project_arguments(arg, language : 'c')
283 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400284endforeach
285
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400286# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
287# arguments, just emits a warnings. So test for the "positive" version instead.
288foreach arg : ['unused-parameter',
289 'missing-field-initializers',
290 'unused-result',
Zbigniew Jędrzejewski-Szmekfb1b5882017-09-04 19:49:12 +0300291 'format-signedness',
292 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
293 ]
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400294 if cc.has_argument('-W' + arg)
295 add_project_arguments('-Wno-' + arg, language : 'c')
296 endif
297endforeach
298
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400299if cc.compiles('
300 #include <time.h>
301 #include <inttypes.h>
302 typedef uint64_t usec_t;
303 usec_t now(clockid_t clock);
304 int main(void) {
305 struct timespec now;
306 return 0;
307 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400308', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400309 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400310endif
311
312if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400313 foreach arg : ['-Wno-typedef-redefinition',
314 '-Wno-gnu-variable-sized-type-not-at-end',
315 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400316 if cc.has_argument(arg,
317 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400318 add_project_arguments(arg, language : 'c')
319 endif
320 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400321endif
322
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400323link_test_c = files('tools/meson-link-test.c')
324
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400325# --as-needed and --no-undefined are provided by meson by default,
326# run mesonconf to see what is enabled
327foreach arg : ['-Wl,-z,relro',
328 '-Wl,-z,now',
329 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400330 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400331
332 have = run_command(check_compilation_sh,
333 cc.cmd_array(), '-x', 'c', arg,
334 '-include', link_test_c).returncode() == 0
335 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
336 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400337 add_project_link_arguments(arg, language : 'c')
338 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400339endforeach
340
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400341if get_option('buildtype') != 'debug'
342 foreach arg : ['-ffunction-sections',
343 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400344 if cc.has_argument(arg,
345 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400346 add_project_arguments(arg, language : 'c')
347 endif
348 endforeach
349
350 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400351 have = run_command(check_compilation_sh,
352 cc.cmd_array(), '-x', 'c', arg,
353 '-include', link_test_c).returncode() == 0
354 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
355 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400356 add_project_link_arguments(arg, language : 'c')
357 endif
358 endforeach
359endif
360
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400361cpp = ' '.join(cc.cmd_array()) + ' -E'
362
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400363#####################################################################
364# compilation result tests
365
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400366conf.set('_GNU_SOURCE', true)
367conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400368
369conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
370conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
371conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
372conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
373conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
374conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
375conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
376
377decl_headers = '''
378#include <uchar.h>
379#include <linux/ethtool.h>
Susant Sahanibce67bb2017-09-14 19:51:39 +0000380#include <linux/fib_rules.h>
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400381'''
382# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
383
384foreach decl : ['char16_t',
385 'char32_t',
386 'key_serial_t',
387 'struct ethtool_link_settings',
Susant Sahanibce67bb2017-09-14 19:51:39 +0000388 'struct fib_rule_uid_range',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400389 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400390
391 # We get -1 if the size cannot be determined
392 have = cc.sizeof(decl, prefix : decl_headers) > 0
393 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400394endforeach
395
396foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
397 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
398 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
399 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
400 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
401 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
402 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
403 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
404 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
405 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530406 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400407 # if_tunnel.h is buggy and cannot be included on its own
408 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
409 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
410 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
411 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
412 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
413 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
414 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
415 ['NDA_IFINDEX', 'linux/neighbour.h'],
416 ['IFA_FLAGS', 'linux/if_addr.h'],
Susant Sahanibce67bb2017-09-14 19:51:39 +0000417 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400418 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
419 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400420 prefix = decl.length() > 2 ? decl[2] : ''
421 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200422 conf.set10('HAVE_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400423endforeach
424
425skip = false
426foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400427 if not skip and cc.has_function(ident)
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400428 conf.set('HAVE_' + ident.to_upper(), true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400429 skip = true
430 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400431endforeach
432
433foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400434 ['memfd_create', '''#include <sys/memfd.h>'''],
435 ['gettid', '''#include <sys/types.h>'''],
436 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
437 ['name_to_handle_at', '''#define _GNU_SOURCE
438 #include <sys/types.h>
439 #include <sys/stat.h>
440 #include <fcntl.h>'''],
441 ['setns', '''#define _GNU_SOURCE
442 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400443 ['renameat2', '''#include <stdio.h>'''],
444 ['kcmp', '''#include <linux/kcmp.h>'''],
445 ['keyctl', '''#include <sys/types.h>
446 #include <keyutils.h>'''],
447 ['copy_file_range', '''#include <sys/syscall.h>
448 #include <unistd.h>'''],
Daniel Mack71e52002016-10-18 17:57:10 +0200449 ['bpf', '''#include <sys/syscall.h>
450 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400451 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400452]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400453
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400454 have = cc.has_function(ident[0], prefix : ident[1])
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200455 conf.set10('HAVE_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400456endforeach
457
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400458if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400459 conf.set('USE_SYS_RANDOM_H', true)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200460 conf.set10('HAVE_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400461else
462 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200463 conf.set10('HAVE_GETRANDOM', have)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400464endif
465
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400466#####################################################################
467
468sed = find_program('sed')
469grep = find_program('grep')
470awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400471m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400472stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400473git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400474
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400475meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400476mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400477test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
478splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400479
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400480# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
481# /usr/sbin, /sbin, and fall back to the default from middle column.
482progs = [['telinit', '/lib/sysvinit/telinit'],
483 ['quotaon', '/usr/sbin/quotaon' ],
484 ['quotacheck', '/usr/sbin/quotacheck' ],
485 ['kill', '/usr/bin/kill' ],
486 ['kmod', '/usr/bin/kmod' ],
487 ['kexec', '/usr/sbin/kexec' ],
488 ['sulogin', '/usr/sbin/sulogin' ],
489 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
490 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
491 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
492 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
493 ]
494foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400495 path = get_option(prog[0] + '-path')
496 if path != ''
497 message('Using @1@ for @0@'.format(prog[0], path))
498 else
499 exe = find_program(prog[0],
500 '/usr/sbin/' + prog[0],
501 '/sbin/' + prog[0],
502 required: false)
503 path = exe.found() ? exe.path() : prog[1]
504 endif
505 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
506 conf.set_quoted(name, path)
507 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400508endforeach
509
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400510if run_command('ln', '--relative', '--help').returncode() != 0
511 error('ln does not support --relative')
512endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400513
514############################################################
515
516gperf = find_program('gperf')
517
518gperf_test_format = '''
519#include <string.h>
520const char * in_word_set(const char *, @0@);
521@1@
522'''
523gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
524gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
525gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
526if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400527 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400528else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400529 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
530 if cc.compiles(gperf_test)
531 gperf_len_type = 'unsigned'
532 else
533 error('unable to determine gperf len type')
534 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400535endif
536message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400537conf.set('GPERF_LEN_TYPE', gperf_len_type,
538 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400539
540############################################################
541
542if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400543 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400544endif
545foreach header : ['linux/btrfs.h',
546 'linux/memfd.h',
547 'linux/vm_sockets.h',
Zbigniew Jędrzejewski-Szmekaf8786b2017-10-03 12:09:40 +0200548 'sys/auxv.h',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400549 'valgrind/memcheck.h',
550 'valgrind/valgrind.h',
551 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400552
553 conf.set('HAVE_' + header.underscorify().to_upper(),
554 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400555endforeach
556
557############################################################
558
559conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400560conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
561gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400562
563default_hierarchy = get_option('default-hierarchy')
564conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
565 description : 'default cgroup hierarchy as string')
566if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400567 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400568elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400569 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400570else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400571 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400572endif
573
574time_epoch = get_option('time-epoch')
575if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400576 NEWS = files('NEWS')
577 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400578endif
579time_epoch = time_epoch.to_int()
580conf.set('TIME_EPOCH', time_epoch)
581
582system_uid_max = get_option('system-uid-max')
583if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400584 system_uid_max = run_command(
585 awk,
586 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
587 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400588endif
589system_uid_max = system_uid_max.to_int()
590conf.set('SYSTEM_UID_MAX', system_uid_max)
591substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400592message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400593
594conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
595conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
596
597system_gid_max = get_option('system-gid-max')
598if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400599 system_gid_max = run_command(
600 awk,
601 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
602 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400603endif
604system_gid_max = system_gid_max.to_int()
605conf.set('SYSTEM_GID_MAX', system_gid_max)
606substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400607message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400608
609tty_gid = get_option('tty-gid')
610conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400611substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400612
613if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400614 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400615endif
616
617if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400618 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400619endif
620
621substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
622
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400623kill_user_processes = get_option('default-kill-user-processes')
624conf.set10('KILL_USER_PROCESSES', kill_user_processes)
625substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400626
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400627dns_servers = get_option('dns-servers')
628conf.set_quoted('DNS_SERVERS', dns_servers)
629substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400630
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400631ntp_servers = get_option('ntp-servers')
632conf.set_quoted('NTP_SERVERS', ntp_servers)
633substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400634
635conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
636
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400637substs.set('SUSHELL', get_option('debug-shell'))
638substs.set('DEBUGTTY', get_option('debug-tty'))
639
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400640debug = get_option('debug')
641if debug != ''
642 foreach name : debug.split(',')
643 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400644 conf.set('ENABLE_DEBUG_HASHMAP', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400645 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400646 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400647 else
648 message('unknown debug option "@0@", ignoring'.format(name))
649 endif
650 endforeach
651endif
652
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')
675 if libseccomp.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400676 conf.set('HAVE_SECCOMP', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400677 m4_defines += ['-DHAVE_SECCOMP']
678 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400679else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400680 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400681endif
682
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')
688 if libselinux.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400689 conf.set('HAVE_SELINUX', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400690 m4_defines += ['-DHAVE_SELINUX']
691 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400692else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400693 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400694endif
695
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')
700 if libapparmor.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400701 conf.set('HAVE_APPARMOR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400702 m4_defines += ['-DHAVE_APPARMOR']
703 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400704else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400705 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400706endif
707
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-Szmek2c201c22017-04-27 21:13:08 -0400718 conf.set('ENABLE_POLKIT', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400719 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400720
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400721 libpolkit = dependency('polkit-gobject-1',
722 required : false)
723 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
724 message('Old polkit detected, will install pkla files')
725 install_polkit_pkla = true
726 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400727endif
728
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')
732 if libacl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400733 conf.set('HAVE_ACL', true)
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400734 m4_defines += ['-DHAVE_ACL']
735 endif
736else
737 libacl = []
738endif
739
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-Szmek2c201c22017-04-27 21:13:08 -0400743 conf.set('HAVE_AUDIT', libaudit.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400744else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400745 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400746endif
747
748want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400749if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400750 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400751 conf.set('HAVE_BLKID', libblkid.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400752else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400753 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400754endif
755
756want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400757if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400758 libkmod = dependency('libkmod',
759 version : '>= 15',
760 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400761 conf.set('HAVE_KMOD', libkmod.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400762else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400763 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400764endif
765
766want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400767if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400768 libpam = cc.find_library('pam', required : want_pam == 'true')
769 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
770 if libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400771 conf.set('HAVE_PAM', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400772 m4_defines += ['-DHAVE_PAM']
773 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400774else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400775 libpam = []
776 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400777endif
778
779want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400780if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400781 libmicrohttpd = dependency('libmicrohttpd',
782 version : '>= 0.9.33',
783 required : want_microhttpd == 'true')
784 if libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400785 conf.set('HAVE_MICROHTTPD', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400786 m4_defines += ['-DHAVE_MICROHTTPD']
787 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400788else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400789 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400790endif
791
792want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400793if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400794 libcryptsetup = dependency('libcryptsetup',
795 version : '>= 1.6.0',
796 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400797 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400798else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400799 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400800endif
801
802want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400803if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400804 libcurl = dependency('libcurl',
805 version : '>= 7.32.0',
806 required : want_libcurl == 'true')
807 if libcurl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400808 conf.set('HAVE_LIBCURL', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400809 m4_defines += ['-DHAVE_LIBCURL']
810 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400811else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400812 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400813endif
814
815want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400816want_libidn2 = get_option('libidn2')
817if want_libidn == 'true' and want_libidn2 == 'true'
818 error('libidn and libidn2 cannot be requested simultaneously')
819endif
820
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400821if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400822 libidn = dependency('libidn',
823 required : want_libidn == 'true')
824 if libidn.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400825 conf.set('HAVE_LIBIDN', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400826 m4_defines += ['-DHAVE_LIBIDN']
827 endif
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400828else
829 libidn = []
830endif
831if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
832 # libidn is used for both libidn and libidn2 objects
833 libidn = dependency('libidn2',
834 required : want_libidn2 == 'true')
835 if libidn.found()
836 conf.set('HAVE_LIBIDN2', true)
837 m4_defines += ['-DHAVE_LIBIDN2']
838 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400839endif
840
841want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400842if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400843 libiptc = dependency('libiptc',
844 required : want_libiptc == 'true')
845 if libiptc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400846 conf.set('HAVE_LIBIPTC', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400847 m4_defines += ['-DHAVE_LIBIPTC']
848 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400849else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400850 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400851endif
852
853want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400854if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400855 libqrencode = dependency('libqrencode',
856 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400857 conf.set('HAVE_QRENCODE', libqrencode.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400858else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400859 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400860endif
861
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400862want_gcrypt = get_option('gcrypt')
863if want_gcrypt != 'false'
864 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
865 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
866
867 have_deps = libgcrypt.found() and libgpg_error.found()
868 conf.set('HAVE_GCRYPT', have_deps)
869 if not have_deps
870 # link to neither of the libs if one is not found
871 libgcrypt = []
872 libgpg_error = []
873 endif
874else
875 libgcrypt = []
876 libgpg_error = []
877endif
878
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400879want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400880if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400881 libgnutls = dependency('gnutls',
882 version : '>= 3.1.4',
883 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400884 conf.set('HAVE_GNUTLS', libgnutls.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400885else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400886 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400887endif
888
889want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400890if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400891 libdw = dependency('libdw',
892 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400893 conf.set('HAVE_ELFUTILS', libdw.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400894else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400895 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400896endif
897
898want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400899if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400900 libz = dependency('zlib',
901 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400902 conf.set('HAVE_ZLIB', libz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400903else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400904 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400905endif
906
907want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400908if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400909 libbzip2 = cc.find_library('bz2',
910 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400911 conf.set('HAVE_BZIP2', libbzip2.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400912else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400913 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400914endif
915
916want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400917if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400918 libxz = dependency('liblzma',
919 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400920 conf.set('HAVE_XZ', libxz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400921else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400922 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400923endif
924
925want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400926if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400927 liblz4 = dependency('liblz4',
928 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400929 conf.set('HAVE_LZ4', liblz4.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400930else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400931 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400932endif
933
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400934want_xkbcommon = get_option('xkbcommon')
935if want_xkbcommon != 'false'
936 libxkbcommon = dependency('xkbcommon',
937 version : '>= 0.3.0',
938 required : want_xkbcommon == 'true')
939 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
940else
941 libxkbcommon = []
942endif
943
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400944want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400945if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400946 libglib = dependency('glib-2.0',
947 version : '>= 2.22.0',
948 required : want_glib == 'true')
949 libgobject = dependency('gobject-2.0',
950 version : '>= 2.22.0',
951 required : want_glib == 'true')
952 libgio = dependency('gio-2.0',
953 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400954 have = libglib.found() and libgobject.found() and libgio.found()
955 conf.set('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400956else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400957 libglib = []
958 libgobject = []
959 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400960endif
961
962want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400963if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400964 libdbus = dependency('dbus-1',
965 version : '>= 1.3.2',
966 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400967 conf.set('HAVE_DBUS', libdbus.found())
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400968else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400969 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400970endif
971
Yu Watanabe42303dc2017-06-18 05:22:32 +0900972default_dnssec = get_option('default-dnssec')
973if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
974 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
975 default_dnssec = 'no'
976endif
977conf.set('DEFAULT_DNSSEC_MODE',
978 'DNSSEC_' + default_dnssec.underscorify().to_upper())
979substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
980
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400981want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400982if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400983 have_deps = (conf.get('HAVE_LIBCURL', false) and
984 conf.get('HAVE_ZLIB', false) and
985 conf.get('HAVE_BZIP2', false) and
986 conf.get('HAVE_XZ', false) and
987 conf.get('HAVE_GCRYPT', false))
988 conf.set('ENABLE_IMPORTD', have_deps)
989 if want_importd == 'true' and not have_deps
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400990 error('importd support was requested, but dependencies are not available')
991 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400992endif
993
994want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400995if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400996 have_deps = [conf.get('HAVE_MICROHTTPD', false),
997 conf.get('HAVE_LIBCURL', false)]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400998 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
999 # it's possible to build one without the other. Complain only if
1000 # support was explictly requested. The auxiliary files like sysusers
1001 # config should be installed when any of the programs are built.
1002 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1003 error('remote support was requested, but dependencies are not available')
1004 endif
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001005 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001006endif
1007
1008foreach pair : [['utmp', 'HAVE_UTMP'],
1009 ['hibernate', 'ENABLE_HIBERNATE'],
1010 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1011 ['binfmt', 'ENABLE_BINFMT'],
1012 ['coredump', 'ENABLE_COREDUMP'],
1013 ['resolve', 'ENABLE_RESOLVED'],
1014 ['logind', 'ENABLE_LOGIND'],
1015 ['hostnamed', 'ENABLE_HOSTNAMED'],
1016 ['localed', 'ENABLE_LOCALED'],
1017 ['machined', 'ENABLE_MACHINED'],
1018 ['networkd', 'ENABLE_NETWORKD'],
1019 ['timedated', 'ENABLE_TIMEDATED'],
1020 ['timesyncd', 'ENABLE_TIMESYNCD'],
1021 ['myhostname', 'HAVE_MYHOSTNAME'],
1022 ['firstboot', 'ENABLE_FIRSTBOOT'],
1023 ['randomseed', 'ENABLE_RANDOMSEED'],
1024 ['backlight', 'ENABLE_BACKLIGHT'],
1025 ['vconsole', 'ENABLE_VCONSOLE'],
1026 ['quotacheck', 'ENABLE_QUOTACHECK'],
1027 ['sysusers', 'ENABLE_SYSUSERS'],
1028 ['tmpfiles', 'ENABLE_TMPFILES'],
1029 ['hwdb', 'ENABLE_HWDB'],
1030 ['rfkill', 'ENABLE_RFKILL'],
1031 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001032 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek18b9ad12017-07-13 09:31:47 -04001033 ['tpm', 'ENABLE_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -04001034 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -04001035 ['smack', 'HAVE_SMACK'],
Franck Buib14e1b42017-05-09 14:02:37 +02001036 ['gshadow', 'ENABLE_GSHADOW'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04001037 ['idn', 'ENABLE_IDN'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001038 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001039 ]
1040
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001041 if get_option(pair[0])
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001042 conf.set(pair[1], true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001043 m4_defines += ['-D' + pair[1]]
1044 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001045endforeach
1046
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001047want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001048install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001049tests = []
1050
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001051conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1052
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001053#####################################################################
1054
1055if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001056 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001057
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001058 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001059 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001060 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001061 elif efi_arch == 'x86_64'
1062 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001063 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001064 elif efi_arch == 'arm'
1065 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001066 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001067 elif efi_arch == 'aarch64'
1068 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001069 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001070 else
1071 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001072 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001073 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001074
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001075 conf.set('ENABLE_EFI', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001076 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001077
1078 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001079endif
1080
1081#####################################################################
1082
1083config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001084 output : 'config.h',
1085 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001086
1087includes = include_directories('src/basic',
1088 'src/shared',
1089 'src/systemd',
1090 'src/journal',
1091 'src/resolve',
1092 'src/timesync',
1093 'src/login',
1094 'src/udev',
1095 'src/libudev',
1096 'src/core',
1097 'src/libsystemd/sd-bus',
1098 'src/libsystemd/sd-device',
1099 'src/libsystemd/sd-hwdb',
1100 'src/libsystemd/sd-id128',
1101 'src/libsystemd/sd-netlink',
1102 'src/libsystemd/sd-network',
1103 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001104 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001105 )
1106
1107add_project_arguments('-include', 'config.h', language : 'c')
1108
1109gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1110 'src/shared/gcrypt-util.c')
1111
1112subdir('po')
1113subdir('catalog')
1114subdir('src/systemd')
1115subdir('src/basic')
1116subdir('src/libsystemd')
1117subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001118subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001119subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001120
1121libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001122 'journal-core',
1123 libjournal_core_sources,
1124 journald_gperf_c,
1125 include_directories : includes,
1126 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001127
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001128libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001129libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001130 'systemd',
1131 libsystemd_internal_sources,
1132 journal_internal_sources,
Zbigniew Jędrzejewski-Szmek56d50ab2017-09-28 19:24:16 +02001133 version : libsystemd_version,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001134 include_directories : includes,
1135 link_args : ['-shared',
1136 '-Wl,--version-script=' + libsystemd_sym_path],
1137 link_with : [libbasic],
1138 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001139 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001140 librt,
1141 libxz,
1142 liblz4],
1143 link_depends : libsystemd_sym,
1144 install : true,
1145 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001146
1147############################################################
1148
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001149# binaries that have --help and are intended for use by humans,
1150# usually, but not always, installed in /bin.
1151public_programs = []
1152
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001153subdir('src/libudev')
1154subdir('src/shared')
1155subdir('src/core')
1156subdir('src/udev')
1157subdir('src/network')
1158
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001159subdir('src/analyze')
1160subdir('src/journal-remote')
1161subdir('src/coredump')
1162subdir('src/hostname')
1163subdir('src/import')
1164subdir('src/kernel-install')
1165subdir('src/locale')
1166subdir('src/machine')
1167subdir('src/nspawn')
1168subdir('src/resolve')
1169subdir('src/timedate')
1170subdir('src/timesync')
1171subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001172subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001173subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001174
1175subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001176subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001177
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001178############################################################
1179
1180# only static linking apart from libdl, to make sure that the
1181# module is linked to all libraries that it uses.
1182test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001183 'test-dlopen',
1184 test_dlopen_c,
1185 include_directories : includes,
1186 link_with : [libbasic],
1187 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001188
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001189foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001190 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001191 ['mymachines', 'ENABLE_MACHINED'],
1192 ['resolve', 'ENABLE_RESOLVED']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001193
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001194 condition = tuple[1] == '' or conf.get(tuple[1], false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001195 if condition
1196 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001197
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001198 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1199 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001200
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001201 nss = shared_library(
1202 'nss_' + module,
1203 'src/nss-@0@/nss-@0@.c'.format(module),
1204 version : '2',
1205 include_directories : includes,
1206 link_args : ['-shared',
1207 '-Wl,--version-script=' + version_script_arg,
1208 '-Wl,--undefined'],
1209 link_with : [libsystemd_internal,
1210 libbasic],
1211 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001212 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001213 link_depends : sym,
1214 install : true,
1215 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001216
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001217 # We cannot use shared_module because it does not support version suffix.
1218 # Unfortunately shared_library insists on creating the symlink…
1219 meson.add_install_script('sh', '-c',
1220 'rm $DESTDIR@0@/libnss_@1@.so'
1221 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001222
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001223 test('dlopen-nss_' + module,
1224 test_dlopen,
1225 args : [nss.full_path()]) # path to dlopen must include a slash
1226 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001227endforeach
1228
1229############################################################
1230
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001231executable('systemd',
1232 systemd_sources,
1233 include_directories : includes,
1234 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001235 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001236 dependencies : [threads,
1237 librt,
1238 libseccomp,
1239 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001240 libmount,
1241 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001242 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001243 install : true,
1244 install_dir : rootlibexecdir)
1245
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001246exe = executable('systemd-analyze',
1247 systemd_analyze_sources,
1248 include_directories : includes,
1249 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001250 libshared],
1251 dependencies : [threads,
1252 librt,
1253 libseccomp,
1254 libselinux,
1255 libmount,
1256 libblkid],
1257 install_rpath : rootlibexecdir,
1258 install : true)
1259public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001260
1261executable('systemd-journald',
1262 systemd_journald_sources,
1263 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001264 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001265 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001266 dependencies : [threads,
1267 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001268 liblz4,
1269 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001270 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001271 install : true,
1272 install_dir : rootlibexecdir)
1273
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001274exe = executable('systemd-cat',
1275 systemd_cat_sources,
1276 include_directories : includes,
1277 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001278 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001279 dependencies : [threads],
1280 install_rpath : rootlibexecdir,
1281 install : true)
1282public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001283
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001284exe = executable('journalctl',
1285 journalctl_sources,
1286 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001287 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001288 dependencies : [threads,
1289 libqrencode,
1290 libxz,
1291 liblz4],
1292 install_rpath : rootlibexecdir,
1293 install : true,
1294 install_dir : rootbindir)
1295public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001296
1297executable('systemd-getty-generator',
1298 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001299 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001300 link_with : [libshared],
1301 install_rpath : rootlibexecdir,
1302 install : true,
1303 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001304
1305executable('systemd-debug-generator',
1306 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001307 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001308 link_with : [libshared],
1309 install_rpath : rootlibexecdir,
1310 install : true,
1311 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001312
1313executable('systemd-fstab-generator',
1314 'src/fstab-generator/fstab-generator.c',
1315 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001316 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001317 link_with : [libshared],
1318 install_rpath : rootlibexecdir,
1319 install : true,
1320 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001321
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001322if conf.get('ENABLE_ENVIRONMENT_D', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001323 executable('30-systemd-environment-d-generator',
1324 'src/environment-d-generator/environment-d-generator.c',
1325 include_directories : includes,
1326 link_with : [libshared],
1327 install_rpath : rootlibexecdir,
1328 install : true,
1329 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001330
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001331 meson.add_install_script(meson_make_symlink,
1332 join_paths(sysconfdir, 'environment'),
1333 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001334endif
1335
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001336if conf.get('ENABLE_HIBERNATE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001337 executable('systemd-hibernate-resume-generator',
1338 'src/hibernate-resume/hibernate-resume-generator.c',
1339 include_directories : includes,
1340 link_with : [libshared],
1341 install_rpath : rootlibexecdir,
1342 install : true,
1343 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001344
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001345 executable('systemd-hibernate-resume',
1346 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001347 include_directories : includes,
1348 link_with : [libshared],
1349 install_rpath : rootlibexecdir,
1350 install : true,
1351 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001352endif
1353
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001354if conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001355 executable('systemd-gpt-auto-generator',
1356 'src/gpt-auto-generator/gpt-auto-generator.c',
1357 'src/basic/blkid-util.h',
1358 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001359 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001360 dependencies : libblkid,
1361 install_rpath : rootlibexecdir,
1362 install : true,
1363 install_dir : systemgeneratordir)
1364
1365 exe = executable('systemd-dissect',
1366 'src/dissect/dissect.c',
1367 include_directories : includes,
1368 link_with : [libshared],
1369 install_rpath : rootlibexecdir,
1370 install : true,
1371 install_dir : rootlibexecdir)
1372 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001373endif
1374
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001375if conf.get('ENABLE_RESOLVED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001376 executable('systemd-resolved',
1377 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001378 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001379 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001380 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001381 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001382 libgcrypt,
1383 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001384 libm,
1385 libidn],
1386 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001387 install : true,
1388 install_dir : rootlibexecdir)
1389
1390 exe = executable('systemd-resolve',
1391 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001392 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001393 include_directories : includes,
1394 link_with : [libshared],
1395 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001396 libgcrypt,
1397 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001398 libm,
1399 libidn],
1400 install_rpath : rootlibexecdir,
1401 install : true)
1402 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001403endif
1404
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001405if conf.get('ENABLE_LOGIND', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001406 executable('systemd-logind',
1407 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001408 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001409 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001410 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001411 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001412 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001413 install_rpath : rootlibexecdir,
1414 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001415 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001416
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001417 exe = executable('loginctl',
1418 loginctl_sources,
1419 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001420 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001421 dependencies : [threads,
1422 liblz4,
1423 libxz],
1424 install_rpath : rootlibexecdir,
1425 install : true,
1426 install_dir : rootbindir)
1427 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001428
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001429 exe = executable('systemd-inhibit',
1430 'src/login/inhibit.c',
1431 include_directories : includes,
1432 link_with : [libshared],
1433 install_rpath : rootlibexecdir,
1434 install : true,
1435 install_dir : rootbindir)
1436 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001437
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001438 if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001439 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1440 pam_systemd = shared_library(
1441 'pam_systemd',
1442 pam_systemd_c,
1443 name_prefix : '',
1444 include_directories : includes,
1445 link_args : ['-shared',
1446 '-Wl,--version-script=' + version_script_arg],
1447 link_with : [libsystemd_internal,
1448 libshared_static],
1449 dependencies : [threads,
1450 libpam,
1451 libpam_misc],
1452 link_depends : pam_systemd_sym,
1453 install : true,
1454 install_dir : pamlibdir)
1455
1456 test('dlopen-pam_systemd',
1457 test_dlopen,
1458 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1459 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001460endif
1461
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001462if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001463 executable('systemd-user-sessions',
1464 'src/user-sessions/user-sessions.c',
1465 include_directories : includes,
1466 link_with : [libshared],
1467 install_rpath : rootlibexecdir,
1468 install : true,
1469 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001470endif
1471
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001472if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001473 exe = executable('bootctl',
1474 'src/boot/bootctl.c',
1475 include_directories : includes,
1476 link_with : [libshared],
1477 dependencies : [libblkid],
1478 install_rpath : rootlibexecdir,
1479 install : true)
1480 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001481endif
1482
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001483exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1484 include_directories : includes,
1485 link_with : [libshared],
1486 dependencies : [threads],
1487 install_rpath : rootlibexecdir,
1488 install : true)
1489public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001490
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001491exe = executable('systemctl', 'src/systemctl/systemctl.c',
1492 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001493 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001494 dependencies : [threads,
1495 libcap,
1496 libselinux,
1497 libxz,
1498 liblz4],
1499 install_rpath : rootlibexecdir,
1500 install : true,
1501 install_dir : rootbindir)
1502public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001503
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001504if conf.get('ENABLE_BACKLIGHT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001505 executable('systemd-backlight',
1506 'src/backlight/backlight.c',
1507 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001508 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001509 install_rpath : rootlibexecdir,
1510 install : true,
1511 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001512endif
1513
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001514if conf.get('ENABLE_RFKILL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001515 executable('systemd-rfkill',
1516 'src/rfkill/rfkill.c',
1517 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001518 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001519 install_rpath : rootlibexecdir,
1520 install : true,
1521 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001522endif
1523
1524executable('systemd-system-update-generator',
1525 'src/system-update-generator/system-update-generator.c',
1526 include_directories : includes,
1527 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001528 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001529 install : true,
1530 install_dir : systemgeneratordir)
1531
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001532if conf.get('HAVE_LIBCRYPTSETUP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001533 executable('systemd-cryptsetup',
1534 'src/cryptsetup/cryptsetup.c',
1535 include_directories : includes,
1536 link_with : [libshared],
1537 dependencies : [libcryptsetup],
1538 install_rpath : rootlibexecdir,
1539 install : true,
1540 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001541
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001542 executable('systemd-cryptsetup-generator',
1543 'src/cryptsetup/cryptsetup-generator.c',
1544 include_directories : includes,
1545 link_with : [libshared],
1546 dependencies : [libcryptsetup],
1547 install_rpath : rootlibexecdir,
1548 install : true,
1549 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001550
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001551 executable('systemd-veritysetup',
1552 'src/veritysetup/veritysetup.c',
1553 include_directories : includes,
1554 link_with : [libshared],
1555 dependencies : [libcryptsetup],
1556 install_rpath : rootlibexecdir,
1557 install : true,
1558 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001559
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001560 executable('systemd-veritysetup-generator',
1561 'src/veritysetup/veritysetup-generator.c',
1562 include_directories : includes,
1563 link_with : [libshared],
1564 dependencies : [libcryptsetup],
1565 install_rpath : rootlibexecdir,
1566 install : true,
1567 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001568endif
1569
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001570if conf.get('HAVE_SYSV_COMPAT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001571 executable('systemd-sysv-generator',
1572 'src/sysv-generator/sysv-generator.c',
1573 include_directories : includes,
1574 link_with : [libshared],
1575 install_rpath : rootlibexecdir,
1576 install : true,
1577 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001578
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001579 executable('systemd-rc-local-generator',
1580 'src/rc-local-generator/rc-local-generator.c',
1581 include_directories : includes,
1582 link_with : [libshared],
1583 install_rpath : rootlibexecdir,
1584 install : true,
1585 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001586endif
1587
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001588if conf.get('ENABLE_HOSTNAMED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001589 executable('systemd-hostnamed',
1590 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001591 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001592 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001593 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001594 install : true,
1595 install_dir : rootlibexecdir)
1596
1597 exe = executable('hostnamectl',
1598 'src/hostname/hostnamectl.c',
1599 include_directories : includes,
1600 link_with : [libshared],
1601 install_rpath : rootlibexecdir,
1602 install : true)
1603 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001604endif
1605
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001606if conf.get('ENABLE_LOCALED', false)
1607 if conf.get('HAVE_XKBCOMMON', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001608 # logind will load libxkbcommon.so dynamically on its own
1609 deps = [libdl]
1610 else
1611 deps = []
1612 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001613
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001614 executable('systemd-localed',
1615 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001616 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001617 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001618 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001619 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001620 install : true,
1621 install_dir : rootlibexecdir)
1622
1623 exe = executable('localectl',
1624 localectl_sources,
1625 include_directories : includes,
1626 link_with : [libshared],
1627 install_rpath : rootlibexecdir,
1628 install : true)
1629 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001630endif
1631
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001632if conf.get('ENABLE_TIMEDATED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001633 executable('systemd-timedated',
1634 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001635 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001636 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001637 install_rpath : rootlibexecdir,
1638 install : true,
1639 install_dir : rootlibexecdir)
1640
1641 exe = executable('timedatectl',
1642 'src/timedate/timedatectl.c',
1643 include_directories : includes,
1644 install_rpath : rootlibexecdir,
1645 link_with : [libshared],
1646 install : true)
1647 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001648endif
1649
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001650if conf.get('ENABLE_TIMESYNCD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001651 executable('systemd-timesyncd',
1652 systemd_timesyncd_sources,
1653 include_directories : includes,
1654 link_with : [libshared],
1655 dependencies : [threads,
1656 libm],
1657 install_rpath : rootlibexecdir,
1658 install : true,
1659 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001660endif
1661
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001662if conf.get('ENABLE_MACHINED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001663 executable('systemd-machined',
1664 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001665 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001666 link_with : [libmachine_core,
1667 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001668 install_rpath : rootlibexecdir,
1669 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001670 install_dir : rootlibexecdir)
1671
1672 exe = executable('machinectl',
1673 'src/machine/machinectl.c',
1674 include_directories : includes,
1675 link_with : [libshared],
1676 dependencies : [threads,
1677 libxz,
1678 liblz4],
1679 install_rpath : rootlibexecdir,
1680 install : true,
1681 install_dir : rootbindir)
1682 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001683endif
1684
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001685if conf.get('ENABLE_IMPORTD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001686 executable('systemd-importd',
1687 systemd_importd_sources,
1688 include_directories : includes,
1689 link_with : [libshared],
1690 dependencies : [threads],
1691 install_rpath : rootlibexecdir,
1692 install : true,
1693 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001694
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001695 systemd_pull = executable('systemd-pull',
1696 systemd_pull_sources,
1697 include_directories : includes,
1698 link_with : [libshared],
1699 dependencies : [libcurl,
1700 libz,
1701 libbzip2,
1702 libxz,
1703 libgcrypt],
1704 install_rpath : rootlibexecdir,
1705 install : true,
1706 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001707
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001708 systemd_import = executable('systemd-import',
1709 systemd_import_sources,
1710 include_directories : includes,
1711 link_with : [libshared],
1712 dependencies : [libcurl,
1713 libz,
1714 libbzip2,
1715 libxz],
1716 install_rpath : rootlibexecdir,
1717 install : true,
1718 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001719
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001720 systemd_export = executable('systemd-export',
1721 systemd_export_sources,
1722 include_directories : includes,
1723 link_with : [libshared],
1724 dependencies : [libcurl,
1725 libz,
1726 libbzip2,
1727 libxz],
1728 install_rpath : rootlibexecdir,
1729 install : true,
1730 install_dir : rootlibexecdir)
1731 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001732endif
1733
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001734if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001735 exe = executable('systemd-journal-upload',
1736 systemd_journal_upload_sources,
1737 include_directories : includes,
1738 link_with : [libshared],
1739 dependencies : [threads,
1740 libcurl,
1741 libgnutls,
1742 libxz,
1743 liblz4],
1744 install_rpath : rootlibexecdir,
1745 install : true,
1746 install_dir : rootlibexecdir)
1747 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001748endif
1749
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001750if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001751 s_j_remote = executable('systemd-journal-remote',
1752 systemd_journal_remote_sources,
1753 include_directories : includes,
1754 link_with : [libshared],
1755 dependencies : [threads,
1756 libmicrohttpd,
1757 libgnutls,
1758 libxz,
1759 liblz4],
1760 install_rpath : rootlibexecdir,
1761 install : true,
1762 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001763
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001764 s_j_gatewayd = executable('systemd-journal-gatewayd',
1765 systemd_journal_gatewayd_sources,
1766 include_directories : includes,
1767 link_with : [libshared],
1768 dependencies : [threads,
1769 libmicrohttpd,
1770 libgnutls,
1771 libxz,
1772 liblz4],
1773 install_rpath : rootlibexecdir,
1774 install : true,
1775 install_dir : rootlibexecdir)
1776 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001777endif
1778
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001779if conf.get('ENABLE_COREDUMP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001780 executable('systemd-coredump',
1781 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001782 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001783 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001784 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001785 libacl,
1786 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001787 libxz,
1788 liblz4],
1789 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001790 install : true,
1791 install_dir : rootlibexecdir)
1792
1793 exe = executable('coredumpctl',
1794 coredumpctl_sources,
1795 include_directories : includes,
1796 link_with : [libshared],
1797 dependencies : [threads,
1798 libxz,
1799 liblz4],
1800 install_rpath : rootlibexecdir,
1801 install : true)
1802 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001803endif
1804
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001805if conf.get('ENABLE_BINFMT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001806 exe = executable('systemd-binfmt',
1807 'src/binfmt/binfmt.c',
1808 include_directories : includes,
1809 link_with : [libshared],
1810 install_rpath : rootlibexecdir,
1811 install : true,
1812 install_dir : rootlibexecdir)
1813 public_programs += [exe]
1814
1815 meson.add_install_script('sh', '-c',
1816 mkdir_p.format(binfmtdir))
1817 meson.add_install_script('sh', '-c',
1818 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1819endif
1820
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001821if conf.get('ENABLE_VCONSOLE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001822 executable('systemd-vconsole-setup',
1823 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001824 include_directories : includes,
1825 link_with : [libshared],
1826 install_rpath : rootlibexecdir,
1827 install : true,
1828 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001829endif
1830
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001831if conf.get('ENABLE_RANDOMSEED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001832 executable('systemd-random-seed',
1833 'src/random-seed/random-seed.c',
1834 include_directories : includes,
1835 link_with : [libshared],
1836 install_rpath : rootlibexecdir,
1837 install : true,
1838 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001839endif
1840
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001841if conf.get('ENABLE_FIRSTBOOT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001842 executable('systemd-firstboot',
1843 'src/firstboot/firstboot.c',
1844 include_directories : includes,
1845 link_with : [libshared],
1846 dependencies : [libcrypt],
1847 install_rpath : rootlibexecdir,
1848 install : true,
1849 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001850endif
1851
1852executable('systemd-remount-fs',
1853 'src/remount-fs/remount-fs.c',
1854 'src/core/mount-setup.c',
1855 'src/core/mount-setup.h',
1856 include_directories : includes,
1857 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001858 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001859 install : true,
1860 install_dir : rootlibexecdir)
1861
1862executable('systemd-machine-id-setup',
1863 'src/machine-id-setup/machine-id-setup-main.c',
1864 'src/core/machine-id-setup.c',
1865 'src/core/machine-id-setup.h',
1866 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001867 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001868 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001869 install : true,
1870 install_dir : rootbindir)
1871
1872executable('systemd-fsck',
1873 'src/fsck/fsck.c',
1874 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001875 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001876 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001877 install : true,
1878 install_dir : rootlibexecdir)
1879
1880executable('systemd-sleep',
1881 'src/sleep/sleep.c',
1882 include_directories : includes,
1883 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001884 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001885 install : true,
1886 install_dir : rootlibexecdir)
1887
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001888exe = executable('systemd-sysctl',
1889 'src/sysctl/sysctl.c',
1890 include_directories : includes,
1891 link_with : [libshared],
1892 install_rpath : rootlibexecdir,
1893 install : true,
1894 install_dir : rootlibexecdir)
1895public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001896
1897executable('systemd-ac-power',
1898 'src/ac-power/ac-power.c',
1899 include_directories : includes,
1900 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001901 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001902 install : true,
1903 install_dir : rootlibexecdir)
1904
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001905exe = executable('systemd-detect-virt',
1906 'src/detect-virt/detect-virt.c',
1907 include_directories : includes,
1908 link_with : [libshared],
1909 install_rpath : rootlibexecdir,
1910 install : true)
1911public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001912
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001913exe = executable('systemd-delta',
1914 'src/delta/delta.c',
1915 include_directories : includes,
1916 link_with : [libshared],
1917 install_rpath : rootlibexecdir,
1918 install : true)
1919public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001920
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001921exe = executable('systemd-escape',
1922 'src/escape/escape.c',
1923 include_directories : includes,
1924 link_with : [libshared],
1925 install_rpath : rootlibexecdir,
1926 install : true,
1927 install_dir : rootbindir)
1928public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001929
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001930exe = executable('systemd-notify',
1931 'src/notify/notify.c',
1932 include_directories : includes,
1933 link_with : [libshared],
1934 install_rpath : rootlibexecdir,
1935 install : true,
1936 install_dir : rootbindir)
1937public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001938
1939executable('systemd-volatile-root',
1940 'src/volatile-root/volatile-root.c',
1941 include_directories : includes,
1942 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001943 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001944 install : true,
1945 install_dir : rootlibexecdir)
1946
1947executable('systemd-cgroups-agent',
1948 'src/cgroups-agent/cgroups-agent.c',
1949 include_directories : includes,
1950 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001951 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001952 install : true,
1953 install_dir : rootlibexecdir)
1954
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001955exe = executable('systemd-path',
1956 'src/path/path.c',
1957 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001958 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001959 install_rpath : rootlibexecdir,
1960 install : true)
1961public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001962
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001963exe = executable('systemd-ask-password',
1964 'src/ask-password/ask-password.c',
1965 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001966 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001967 install_rpath : rootlibexecdir,
1968 install : true,
1969 install_dir : rootbindir)
1970public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001971
1972executable('systemd-reply-password',
1973 'src/reply-password/reply-password.c',
1974 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001975 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001976 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001977 install : true,
1978 install_dir : rootlibexecdir)
1979
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001980exe = executable('systemd-tty-ask-password-agent',
1981 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1982 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001983 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001984 install_rpath : rootlibexecdir,
1985 install : true,
1986 install_dir : rootbindir)
1987public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001988
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001989exe = executable('systemd-cgls',
1990 'src/cgls/cgls.c',
1991 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001992 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001993 install_rpath : rootlibexecdir,
1994 install : true)
1995public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001996
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001997exe = executable('systemd-cgtop',
1998 'src/cgtop/cgtop.c',
1999 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002000 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002001 install_rpath : rootlibexecdir,
2002 install : true)
2003public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002004
2005executable('systemd-initctl',
2006 'src/initctl/initctl.c',
2007 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002008 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002009 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002010 install : true,
2011 install_dir : rootlibexecdir)
2012
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002013exe = executable('systemd-mount',
2014 'src/mount/mount-tool.c',
2015 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002016 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002017 install_rpath : rootlibexecdir,
2018 install : true)
2019public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002020
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002021meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002022 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002023
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002024exe = executable('systemd-run',
2025 'src/run/run.c',
2026 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002027 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002028 install_rpath : rootlibexecdir,
2029 install : true)
2030public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002031
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002032exe = executable('systemd-stdio-bridge',
2033 'src/stdio-bridge/stdio-bridge.c',
2034 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002035 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002036 install_rpath : rootlibexecdir,
2037 install : true)
2038public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002039
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002040exe = executable('busctl',
2041 'src/busctl/busctl.c',
2042 'src/busctl/busctl-introspect.c',
2043 'src/busctl/busctl-introspect.h',
2044 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002045 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002046 install_rpath : rootlibexecdir,
2047 install : true)
2048public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002049
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002050if conf.get('ENABLE_SYSUSERS', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002051 exe = executable('systemd-sysusers',
2052 'src/sysusers/sysusers.c',
2053 include_directories : includes,
2054 link_with : [libshared],
2055 install_rpath : rootlibexecdir,
2056 install : true,
2057 install_dir : rootbindir)
2058 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002059endif
2060
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002061if conf.get('ENABLE_TMPFILES', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002062 exe = executable('systemd-tmpfiles',
2063 'src/tmpfiles/tmpfiles.c',
2064 include_directories : includes,
2065 link_with : [libshared],
2066 dependencies : [libacl],
2067 install_rpath : rootlibexecdir,
2068 install : true,
2069 install_dir : rootbindir)
2070 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002071endif
2072
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002073if conf.get('ENABLE_HWDB', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002074 exe = executable('systemd-hwdb',
2075 'src/hwdb/hwdb.c',
2076 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2077 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002078 link_with : [libudev_internal],
2079 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002080 install : true,
2081 install_dir : rootbindir)
2082 public_programs += [exe]
2083endif
2084
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002085if conf.get('ENABLE_QUOTACHECK', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002086 executable('systemd-quotacheck',
2087 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002088 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002089 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002090 install_rpath : rootlibexecdir,
2091 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002092 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002093endif
2094
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002095exe = executable('systemd-socket-proxyd',
2096 'src/socket-proxy/socket-proxyd.c',
2097 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002098 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002099 dependencies : [threads],
2100 install_rpath : rootlibexecdir,
2101 install : true,
2102 install_dir : rootlibexecdir)
2103public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002104
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002105exe = executable('systemd-udevd',
2106 systemd_udevd_sources,
2107 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002108 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002109 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002110 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002111 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002112 dependencies : [threads,
2113 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002114 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002115 libacl,
2116 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002117 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002118 install : true,
2119 install_dir : rootlibexecdir)
2120public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002121
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002122exe = executable('udevadm',
2123 udevadm_sources,
2124 include_directories : includes,
2125 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002126 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002127 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002128 dependencies : [threads,
2129 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002130 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002131 libacl,
2132 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002133 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002134 install : true,
2135 install_dir : rootbindir)
2136public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002137
2138executable('systemd-shutdown',
2139 systemd_shutdown_sources,
2140 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002141 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002142 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002143 install : true,
2144 install_dir : rootlibexecdir)
2145
2146executable('systemd-update-done',
2147 'src/update-done/update-done.c',
2148 include_directories : includes,
2149 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002150 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002151 install : true,
2152 install_dir : rootlibexecdir)
2153
2154executable('systemd-update-utmp',
2155 'src/update-utmp/update-utmp.c',
2156 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002157 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002158 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002159 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002160 install : true,
2161 install_dir : rootlibexecdir)
2162
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002163if conf.get('HAVE_KMOD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002164 executable('systemd-modules-load',
2165 'src/modules-load/modules-load.c',
2166 include_directories : includes,
2167 link_with : [libshared],
2168 dependencies : [libkmod],
2169 install_rpath : rootlibexecdir,
2170 install : true,
2171 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002172
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002173 meson.add_install_script('sh', '-c',
2174 mkdir_p.format(modulesloaddir))
2175 meson.add_install_script('sh', '-c',
2176 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002177endif
2178
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002179exe = executable('systemd-nspawn',
2180 systemd_nspawn_sources,
2181 'src/core/mount-setup.c', # FIXME: use a variable?
2182 'src/core/mount-setup.h',
2183 'src/core/loopback-setup.c',
2184 'src/core/loopback-setup.h',
2185 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002186 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002187 dependencies : [libacl,
2188 libblkid,
2189 libseccomp,
2190 libselinux],
2191 install_rpath : rootlibexecdir,
2192 install : true)
2193public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002194
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002195if conf.get('ENABLE_NETWORKD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002196 executable('systemd-networkd',
2197 systemd_networkd_sources,
2198 include_directories : includes,
2199 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002200 libsystemd_network,
2201 libudev_internal,
2202 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002203 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002204 install_rpath : rootlibexecdir,
2205 install : true,
2206 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002207
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002208 executable('systemd-networkd-wait-online',
2209 systemd_networkd_wait_online_sources,
2210 include_directories : includes,
2211 link_with : [libnetworkd_core,
2212 libshared],
2213 install_rpath : rootlibexecdir,
2214 install : true,
2215 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002216
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002217 exe = executable('networkctl',
2218 networkctl_sources,
2219 include_directories : includes,
2220 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002221 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002222 install_rpath : rootlibexecdir,
2223 install : true,
2224 install_dir : rootbindir)
2225 public_programs += [exe]
2226endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002227############################################################
2228
2229foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002230 sources = tuple[0]
2231 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2232 dependencies = tuple[2]
2233 condition = tuple.length() >= 4 ? tuple[3] : ''
2234 type = tuple.length() >= 5 ? tuple[4] : ''
2235 defs = tuple.length() >= 6 ? tuple[5] : []
2236 incs = tuple.length() >= 7 ? tuple[6] : includes
2237 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002238
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002239 name = sources[0].split('/')[-1].split('.')[0]
2240 if type.startswith('timeout=')
2241 timeout = type.split('=')[1].to_int()
2242 type = ''
2243 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002244
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002245 if condition == '' or conf.get(condition, false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002246 exe = executable(
2247 name,
2248 sources,
2249 include_directories : incs,
2250 link_with : link_with,
2251 dependencies : dependencies,
2252 c_args : defs,
2253 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002254 install : install_tests,
2255 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002256
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002257 if type == 'manual'
2258 message('@0@ is a manual test'.format(name))
2259 elif type == 'unsafe' and want_tests != 'unsafe'
2260 message('@0@ is an unsafe test'.format(name))
2261 else
2262 test(name, exe,
2263 env : test_env,
2264 timeout : timeout)
2265 endif
2266 else
2267 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2268 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002269endforeach
2270
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002271test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002272 'test-libsystemd-sym',
2273 test_libsystemd_sym_c,
2274 include_directories : includes,
2275 link_with : [libsystemd],
2276 install : install_tests,
2277 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002278test('test-libsystemd-sym',
2279 test_libsystemd_sym)
2280
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002281test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002282 'test-libudev-sym',
2283 test_libudev_sym_c,
2284 include_directories : includes,
2285 c_args : ['-Wno-deprecated-declarations'],
2286 link_with : [libudev],
2287 install : install_tests,
2288 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002289test('test-libudev-sym',
2290 test_libudev_sym)
2291
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002292############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002293
2294make_directive_index_py = find_program('tools/make-directive-index.py')
2295make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002296xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002297hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002298
2299subdir('units')
2300subdir('sysctl.d')
2301subdir('sysusers.d')
2302subdir('tmpfiles.d')
2303subdir('rules')
2304subdir('hwdb')
2305subdir('network')
2306subdir('man')
2307subdir('shell-completion/bash')
2308subdir('shell-completion/zsh')
2309subdir('docs/sysvinit')
2310subdir('docs/var-log')
2311
2312# FIXME: figure out if the warning is true:
2313# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2314install_subdir('factory/etc',
2315 install_dir : factorydir)
2316
2317
2318install_data('xorg/50-systemd-user.sh',
2319 install_dir : xinitrcdir)
2320install_data('system-preset/90-systemd.preset',
2321 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002322install_data('modprobe.d/systemd.conf',
2323 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002324install_data('README',
2325 'NEWS',
2326 'CODING_STYLE',
2327 'DISTRO_PORTING',
2328 'ENVIRONMENT.md',
2329 'LICENSE.GPL2',
2330 'LICENSE.LGPL2.1',
2331 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2332 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002333
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002334meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2335meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2336
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002337############################################################
2338
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002339meson_check_help = find_program('tools/meson-check-help.sh')
2340
2341foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002342 name = exec.full_path().split('/')[-1]
2343 test('check-help-' + name,
2344 meson_check_help,
2345 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002346endforeach
2347
2348############################################################
2349
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002350if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002351 all_files = run_command(
2352 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002353 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002354 'ls-files',
2355 ':/*.[ch]'])
2356 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002357
userwithuide85a6902017-08-09 13:41:44 +00002358 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002359 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002360 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002361 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002362 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002363 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002364 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002365 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002366endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002367
2368if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002369 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002370 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002371 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002372 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002373endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002374
2375if git.found()
2376 git_head = run_command(
2377 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002378 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002379 'rev-parse', 'HEAD']).stdout().strip()
2380 git_head_short = run_command(
2381 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002382 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002383 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2384
2385 run_target(
2386 'git-snapshot',
2387 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002388 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002389 git_head_short),
2390 '--prefix', 'systemd-@0@/'.format(git_head),
2391 'HEAD'])
2392endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002393
2394############################################################
2395
2396status = [
2397 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2398
2399 'prefix: @0@'.format(prefixdir),
2400 'rootprefix: @0@'.format(rootprefixdir),
2401 'sysconf dir: @0@'.format(sysconfdir),
2402 'includedir: @0@'.format(includedir),
2403 'lib dir: @0@'.format(libdir),
2404 'rootlib dir: @0@'.format(rootlibdir),
2405 'SysV init scripts: @0@'.format(sysvinit_path),
2406 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2407 'PAM modules dir: @0@'.format(pamlibdir),
2408 'PAM configuration dir: @0@'.format(pamconfdir),
2409 'RPM macros dir: @0@'.format(rpmmacrosdir),
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002410 'modprobe.d dir: @0@'.format(modprobedir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002411 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2412 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2413 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2414 'bash completions dir: @0@'.format(bashcompletiondir),
2415 'zsh completions dir: @0@'.format(zshcompletiondir),
2416 'extra start script: @0@'.format(get_option('rc-local')),
2417 'extra stop script: @0@'.format(get_option('halt-local')),
2418 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2419 get_option('debug-tty')),
2420 'TTY GID: @0@'.format(tty_gid),
2421 'maximum system UID: @0@'.format(system_uid_max),
2422 'maximum system GID: @0@'.format(system_gid_max),
2423 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2424 'certificate root: @0@'.format(get_option('certificate-root')),
2425 'support URL: @0@'.format(support_url),
2426 'nobody user name: @0@'.format(get_option('nobody-user')),
2427 'nobody group name: @0@'.format(get_option('nobody-group')),
2428 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002429 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002430
2431 'default DNSSEC mode: @0@'.format(default_dnssec),
2432 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2433 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2434
2435alt_dns_servers = '\n '.join(dns_servers.split(' '))
2436alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2437status += [
2438 'default DNS servers: @0@'.format(alt_dns_servers),
2439 'default NTP servers: @0@'.format(alt_ntp_servers)]
2440
2441alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2442 '@@0@'.format(time_epoch)).stdout().strip()
2443status += [
2444 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2445
2446# TODO:
2447# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2448# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2449# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2450
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002451if conf.get('ENABLE_EFI', false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002452 status += [
2453 'efi arch: @0@'.format(efi_arch)]
2454
2455 if have_gnu_efi
2456 status += [
2457 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2458 'EFI CC @0@'.format(efi_cc),
2459 'EFI libdir: @0@'.format(efi_libdir),
2460 'EFI ldsdir: @0@'.format(efi_ldsdir),
2461 'EFI includedir: @0@'.format(efi_incdir)]
2462 endif
2463endif
2464
2465found = []
2466missing = []
2467
2468foreach tuple : [
2469 ['libcryptsetup'],
2470 ['PAM'],
2471 ['AUDIT'],
2472 ['IMA'],
2473 ['AppArmor'],
2474 ['SELinux'],
2475 ['SECCOMP'],
2476 ['SMACK'],
2477 ['zlib'],
2478 ['xz'],
2479 ['lz4'],
2480 ['bzip2'],
2481 ['ACL'],
2482 ['gcrypt'],
2483 ['qrencode'],
2484 ['microhttpd'],
2485 ['gnutls'],
2486 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002487 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002488 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002489 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002490 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002491 ['libiptc'],
2492 ['elfutils'],
2493 ['binfmt'],
2494 ['vconsole'],
2495 ['quotacheck'],
2496 ['tmpfiles'],
2497 ['environment.d'],
2498 ['sysusers'],
2499 ['firstboot'],
2500 ['randomseed'],
2501 ['backlight'],
2502 ['rfkill'],
2503 ['logind'],
2504 ['machined'],
2505 ['importd'],
2506 ['hostnamed'],
2507 ['timedated'],
2508 ['timesyncd'],
2509 ['localed'],
2510 ['networkd'],
2511 ['resolved'],
2512 ['coredump'],
2513 ['polkit'],
2514 ['legacy pkla', install_polkit_pkla],
2515 ['efi'],
2516 ['gnu-efi', have_gnu_efi],
2517 ['kmod'],
2518 ['xkbcommon'],
2519 ['blkid'],
2520 ['dbus'],
2521 ['glib'],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002522 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002523 ['hwdb'],
2524 ['tpm'],
2525 ['man pages', want_man],
2526 ['html pages', want_html],
2527 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002528 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002529 ['SysV compat'],
2530 ['utmp'],
2531 ['ldconfig'],
2532 ['hibernate'],
2533 ['adm group', get_option('adm-group')],
2534 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002535 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002536 ['debug hashmap'],
2537 ['debug mmap cache'],
2538]
2539
2540 cond = tuple.get(1, '')
2541 if cond == ''
2542 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2543 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002544 cond = conf.get(ident1, false) or conf.get(ident2, false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002545 endif
2546 if cond
2547 found += [tuple[0]]
2548 else
2549 missing += [tuple[0]]
2550 endif
2551endforeach
2552
2553status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002554 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002555 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002556 '',
2557 'disabled features: @0@'.format(', '.join(missing)),
2558 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002559message('\n '.join(status))