blob: 3e85442a6fefff8c63ba66b76ba5c4b1f0d38d40 [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001project('systemd', 'c',
Lennart Poettering43091722017-06-27 23:11:26 +02002 version : '234',
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
13# We need the same data in three different formats, ugh!
14# Also, for hysterical reasons, we use different variable
15# names, sometimes. Not all variables are included in every
16# set. Ugh, ugh, ugh!
17conf = configuration_data()
18conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
19conf.set_quoted('PACKAGE_VERSION', meson.project_version())
20
21substs = configuration_data()
22substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
23substs.set('PACKAGE_VERSION', meson.project_version())
24
25m4_defines = []
26
27#####################################################################
28
Zbigniew Jędrzejewski-Szmek003c8872017-07-24 04:41:45 -040029# Try to install the git pre-commit hook
30git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
31if git_hook.returncode() == 0
32 message(git_hook.stdout().strip())
33endif
34
35#####################################################################
36
Zbigniew Jędrzejewski-Szmekab916f22017-04-13 22:15:01 -040037rootprefixdir = get_option('rootprefix')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040038if get_option('split-usr')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040039 conf.set('HAVE_SPLIT_USR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040040 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040041else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040042 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040043endif
44
45sysvinit_path = get_option('sysvinit-path')
46sysvrcnd_path = get_option('sysvrcnd-path')
47if sysvinit_path != '' or sysvrcnd_path != ''
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040048 conf.set('HAVE_SYSV_COMPAT', true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040049 description : 'SysV init scripts and rcN.d links are supported')
50 m4_defines += ['-DHAVE_SYSV_COMPAT']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040051endif
52
53# join_paths ignore the preceding arguments if an absolute component is
54# encountered, so this should canonicalize various paths when they are
55# absolute or relative.
56prefixdir = get_option('prefix')
57if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040058 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040059endif
60bindir = join_paths(prefixdir, get_option('bindir'))
61libdir = join_paths(prefixdir, get_option('libdir'))
62sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
63includedir = join_paths(prefixdir, get_option('includedir'))
64datadir = join_paths(prefixdir, get_option('datadir'))
65localstatedir = join_paths('/', get_option('localstatedir'))
66
67rootbindir = join_paths(rootprefixdir, 'bin')
68rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
69
70rootlibdir = get_option('rootlibdir')
71if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040072 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040073endif
74
75# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040076pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
77pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
78polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
79polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
80polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
81varlogdir = join_paths(localstatedir, 'log')
82xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040083rpmmacrosdir = get_option('rpmmacrosdir')
Yu Watanabead6fc5b2017-08-03 21:01:38 +090084modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040085
86# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -040087pkgdatadir = join_paths(datadir, 'systemd')
88environmentdir = join_paths(prefixdir, 'lib/environment.d')
89pkgsysconfdir = join_paths(sysconfdir, 'systemd')
90userunitdir = join_paths(prefixdir, 'lib/systemd/user')
91userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
92tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
93sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
94sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
95binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
96modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
97networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
98pkgincludedir = join_paths(includedir, 'systemd')
99systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
100usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
101systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
102userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
103systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
104systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
105systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
106systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
107udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
108udevhomedir = udevlibexecdir
109udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
110udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
111catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
112kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
113factorydir = join_paths(datadir, 'factory')
114docdir = join_paths(datadir, 'doc/systemd')
115bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
116testsdir = join_paths(prefixdir, 'lib/systemd/tests')
117systemdstatedir = join_paths(localstatedir, 'lib/systemd')
118catalogstatedir = join_paths(systemdstatedir, 'catalog')
119randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400120
121dbuspolicydir = get_option('dbuspolicydir')
122if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400123 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400124endif
125
126dbussessionservicedir = get_option('dbussessionservicedir')
127if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400128 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400129endif
130
131dbussystemservicedir = get_option('dbussystemservicedir')
132if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400133 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400134endif
135
136pamlibdir = get_option('pamlibdir')
137if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400138 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400139endif
140
141pamconfdir = get_option('pamconfdir')
142if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400143 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400144endif
145
146conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400147conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400148conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
149conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
150conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400151conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
152conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400153conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400154conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
155conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400156conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
157conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
158conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
159conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
160conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
161conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
162conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
163conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
164conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400165conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400166conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400167conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
168conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400169conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
170conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
171conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
172conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
173conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
174conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400175conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
176conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400177conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400178conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400179conf.set_quoted('LIBDIR', libdir)
180conf.set_quoted('ROOTLIBDIR', rootlibdir)
181conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
182conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400183conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
184conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
185conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
186conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
187conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
188conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400189
190conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
191conf.set_quoted('ABS_SRC_DIR', meson.source_root())
192
193substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400194substs.set('exec_prefix', prefixdir)
195substs.set('libdir', libdir)
196substs.set('rootlibdir', rootlibdir)
197substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400198substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400199substs.set('bindir', bindir)
200substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400201substs.set('rootlibexecdir', rootlibexecdir)
202substs.set('systemunitdir', systemunitdir)
203substs.set('userunitdir', userunitdir)
204substs.set('systempresetdir', systempresetdir)
205substs.set('userpresetdir', userpresetdir)
206substs.set('udevhwdbdir', udevhwdbdir)
207substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400208substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400209substs.set('catalogdir', catalogdir)
210substs.set('tmpfilesdir', tmpfilesdir)
211substs.set('sysusersdir', sysusersdir)
212substs.set('sysctldir', sysctldir)
213substs.set('binfmtdir', binfmtdir)
214substs.set('modulesloaddir', modulesloaddir)
215substs.set('systemgeneratordir', systemgeneratordir)
216substs.set('usergeneratordir', usergeneratordir)
217substs.set('systemenvgeneratordir', systemenvgeneratordir)
218substs.set('userenvgeneratordir', userenvgeneratordir)
219substs.set('systemshutdowndir', systemshutdowndir)
220substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400221substs.set('VARLOGDIR', varlogdir)
222substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400223substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
224substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400225substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
226substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
227substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
228substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400229
230#####################################################################
231
232cc = meson.get_compiler('c')
233pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400234check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400235
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400236cxx = find_program('c++', required : false)
237if cxx.found()
238 # Used only for tests
239 add_languages('cpp')
240endif
241
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400242foreach arg : ['-Wextra',
243 '-Wundef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400244 '-Wlogical-op',
245 '-Wmissing-include-dirs',
246 '-Wold-style-definition',
247 '-Wpointer-arith',
248 '-Winit-self',
249 '-Wdeclaration-after-statement',
250 '-Wfloat-equal',
251 '-Wsuggest-attribute=noreturn',
252 '-Werror=missing-prototypes',
253 '-Werror=implicit-function-declaration',
254 '-Werror=missing-declarations',
255 '-Werror=return-type',
256 '-Werror=incompatible-pointer-types',
257 '-Werror=format=2',
258 '-Wstrict-prototypes',
259 '-Wredundant-decls',
260 '-Wmissing-noreturn',
261 '-Wshadow',
262 '-Wendif-labels',
263 '-Wstrict-aliasing=2',
264 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400265 '-Werror=overflow',
266 '-Wdate-time',
267 '-Wnested-externs',
268 '-ffast-math',
269 '-fno-common',
270 '-fdiagnostics-show-option',
271 '-fno-strict-aliasing',
272 '-fvisibility=hidden',
273 '-fstack-protector',
274 '-fstack-protector-strong',
275 '-fPIE',
276 '--param=ssp-buffer-size=4',
277 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400278 if cc.has_argument(arg)
279 add_project_arguments(arg, language : 'c')
280 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400281endforeach
282
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400283# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
284# arguments, just emits a warnings. So test for the "positive" version instead.
285foreach arg : ['unused-parameter',
286 'missing-field-initializers',
287 'unused-result',
Zbigniew Jędrzejewski-Szmekfb1b5882017-09-04 19:49:12 +0300288 'format-signedness',
289 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
290 ]
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400291 if cc.has_argument('-W' + arg)
292 add_project_arguments('-Wno-' + arg, language : 'c')
293 endif
294endforeach
295
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400296if cc.compiles('
297 #include <time.h>
298 #include <inttypes.h>
299 typedef uint64_t usec_t;
300 usec_t now(clockid_t clock);
301 int main(void) {
302 struct timespec now;
303 return 0;
304 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400305', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400306 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400307endif
308
309if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400310 foreach arg : ['-Wno-typedef-redefinition',
311 '-Wno-gnu-variable-sized-type-not-at-end',
312 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400313 if cc.has_argument(arg,
314 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400315 add_project_arguments(arg, language : 'c')
316 endif
317 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400318endif
319
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400320link_test_c = files('tools/meson-link-test.c')
321
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400322# --as-needed and --no-undefined are provided by meson by default,
323# run mesonconf to see what is enabled
324foreach arg : ['-Wl,-z,relro',
325 '-Wl,-z,now',
326 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400327 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400328
329 have = run_command(check_compilation_sh,
330 cc.cmd_array(), '-x', 'c', arg,
331 '-include', link_test_c).returncode() == 0
332 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
333 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400334 add_project_link_arguments(arg, language : 'c')
335 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400336endforeach
337
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400338if get_option('buildtype') != 'debug'
339 foreach arg : ['-ffunction-sections',
340 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400341 if cc.has_argument(arg,
342 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400343 add_project_arguments(arg, language : 'c')
344 endif
345 endforeach
346
347 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400348 have = run_command(check_compilation_sh,
349 cc.cmd_array(), '-x', 'c', arg,
350 '-include', link_test_c).returncode() == 0
351 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
352 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400353 add_project_link_arguments(arg, language : 'c')
354 endif
355 endforeach
356endif
357
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400358cpp = ' '.join(cc.cmd_array()) + ' -E'
359
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400360#####################################################################
361# compilation result tests
362
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400363conf.set('_GNU_SOURCE', true)
364conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400365
366conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
367conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
368conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
369conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
370conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
371conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
372conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
373
374decl_headers = '''
375#include <uchar.h>
376#include <linux/ethtool.h>
Susant Sahanibce67bb2017-09-14 19:51:39 +0000377#include <linux/fib_rules.h>
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400378'''
379# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
380
381foreach decl : ['char16_t',
382 'char32_t',
383 'key_serial_t',
384 'struct ethtool_link_settings',
Susant Sahanibce67bb2017-09-14 19:51:39 +0000385 'struct fib_rule_uid_range',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400386 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400387
388 # We get -1 if the size cannot be determined
389 have = cc.sizeof(decl, prefix : decl_headers) > 0
390 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400391endforeach
392
393foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
394 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
395 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
396 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
397 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
398 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
399 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
400 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
401 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
402 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530403 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400404 # if_tunnel.h is buggy and cannot be included on its own
405 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
406 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
407 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
408 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
409 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
410 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
411 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
412 ['NDA_IFINDEX', 'linux/neighbour.h'],
413 ['IFA_FLAGS', 'linux/if_addr.h'],
Susant Sahanibce67bb2017-09-14 19:51:39 +0000414 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400415 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
416 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400417 prefix = decl.length() > 2 ? decl[2] : ''
418 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
419 conf.set10('HAVE_DECL_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400420endforeach
421
422skip = false
423foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400424 if not skip and cc.has_function(ident)
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400425 conf.set('HAVE_' + ident.to_upper(), true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400426 skip = true
427 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400428endforeach
429
430foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400431 ['memfd_create', '''#include <sys/memfd.h>'''],
432 ['gettid', '''#include <sys/types.h>'''],
433 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
434 ['name_to_handle_at', '''#define _GNU_SOURCE
435 #include <sys/types.h>
436 #include <sys/stat.h>
437 #include <fcntl.h>'''],
438 ['setns', '''#define _GNU_SOURCE
439 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400440 ['renameat2', '''#include <stdio.h>'''],
441 ['kcmp', '''#include <linux/kcmp.h>'''],
442 ['keyctl', '''#include <sys/types.h>
443 #include <keyutils.h>'''],
444 ['copy_file_range', '''#include <sys/syscall.h>
445 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400446 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400447]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400448
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400449 have = cc.has_function(ident[0], prefix : ident[1])
450 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400451endforeach
452
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400453if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400454 conf.set('USE_SYS_RANDOM_H', true)
455 conf.set10('HAVE_DECL_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400456else
457 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
458 conf.set10('HAVE_DECL_GETRANDOM', have)
459endif
460
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400461#####################################################################
462
463sed = find_program('sed')
464grep = find_program('grep')
465awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400466m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400467stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400468git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400469
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400470meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400471mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400472test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
473splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400474
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400475# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
476# /usr/sbin, /sbin, and fall back to the default from middle column.
477progs = [['telinit', '/lib/sysvinit/telinit'],
478 ['quotaon', '/usr/sbin/quotaon' ],
479 ['quotacheck', '/usr/sbin/quotacheck' ],
480 ['kill', '/usr/bin/kill' ],
481 ['kmod', '/usr/bin/kmod' ],
482 ['kexec', '/usr/sbin/kexec' ],
483 ['sulogin', '/usr/sbin/sulogin' ],
484 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
485 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
486 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
487 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
488 ]
489foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400490 path = get_option(prog[0] + '-path')
491 if path != ''
492 message('Using @1@ for @0@'.format(prog[0], path))
493 else
494 exe = find_program(prog[0],
495 '/usr/sbin/' + prog[0],
496 '/sbin/' + prog[0],
497 required: false)
498 path = exe.found() ? exe.path() : prog[1]
499 endif
500 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
501 conf.set_quoted(name, path)
502 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400503endforeach
504
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400505if run_command('ln', '--relative', '--help').returncode() != 0
506 error('ln does not support --relative')
507endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400508
509############################################################
510
511gperf = find_program('gperf')
512
513gperf_test_format = '''
514#include <string.h>
515const char * in_word_set(const char *, @0@);
516@1@
517'''
518gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
519gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
520gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
521if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400522 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400523else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400524 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
525 if cc.compiles(gperf_test)
526 gperf_len_type = 'unsigned'
527 else
528 error('unable to determine gperf len type')
529 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400530endif
531message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400532conf.set('GPERF_LEN_TYPE', gperf_len_type,
533 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400534
535############################################################
536
537if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400538 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400539endif
540foreach header : ['linux/btrfs.h',
541 'linux/memfd.h',
542 'linux/vm_sockets.h',
543 'valgrind/memcheck.h',
544 'valgrind/valgrind.h',
545 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400546
547 conf.set('HAVE_' + header.underscorify().to_upper(),
548 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400549endforeach
550
551############################################################
552
553conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400554conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
555gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400556
557default_hierarchy = get_option('default-hierarchy')
558conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
559 description : 'default cgroup hierarchy as string')
560if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400561 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400562elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400563 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400564else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400565 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400566endif
567
568time_epoch = get_option('time-epoch')
569if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400570 NEWS = files('NEWS')
571 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400572endif
573time_epoch = time_epoch.to_int()
574conf.set('TIME_EPOCH', time_epoch)
575
576system_uid_max = get_option('system-uid-max')
577if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400578 system_uid_max = run_command(
579 awk,
580 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
581 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400582endif
583system_uid_max = system_uid_max.to_int()
584conf.set('SYSTEM_UID_MAX', system_uid_max)
585substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400586message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400587
588conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
589conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
590
591system_gid_max = get_option('system-gid-max')
592if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400593 system_gid_max = run_command(
594 awk,
595 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
596 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400597endif
598system_gid_max = system_gid_max.to_int()
599conf.set('SYSTEM_GID_MAX', system_gid_max)
600substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400601message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400602
603tty_gid = get_option('tty-gid')
604conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400605substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400606
607if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400608 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400609endif
610
611if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400612 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400613endif
614
615substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
616
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400617kill_user_processes = get_option('default-kill-user-processes')
618conf.set10('KILL_USER_PROCESSES', kill_user_processes)
619substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400620
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400621dns_servers = get_option('dns-servers')
622conf.set_quoted('DNS_SERVERS', dns_servers)
623substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400624
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400625ntp_servers = get_option('ntp-servers')
626conf.set_quoted('NTP_SERVERS', ntp_servers)
627substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400628
629conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
630
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400631substs.set('SUSHELL', get_option('debug-shell'))
632substs.set('DEBUGTTY', get_option('debug-tty'))
633
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400634debug = get_option('debug')
635if debug != ''
636 foreach name : debug.split(',')
637 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400638 conf.set('ENABLE_DEBUG_HASHMAP', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400639 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400640 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400641 else
642 message('unknown debug option "@0@", ignoring'.format(name))
643 endif
644 endforeach
645endif
646
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400647#####################################################################
648
649threads = dependency('threads')
650librt = cc.find_library('rt')
651libm = cc.find_library('m')
652libdl = cc.find_library('dl')
653libcrypt = cc.find_library('crypt')
654
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400655libcap = dependency('libcap', required : false)
656if not libcap.found()
657 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
658 libcap = cc.find_library('cap')
659endif
660
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400661libmount = dependency('mount',
Zbigniew Jędrzejewski-Szmekd6e80962017-09-15 14:47:57 +0200662 version : '>= 2.30')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400663
664want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400665if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400666 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400667 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400668 required : want_seccomp == 'true')
669 if libseccomp.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400670 conf.set('HAVE_SECCOMP', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400671 m4_defines += ['-DHAVE_SECCOMP']
672 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400673else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400674 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400675endif
676
677want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400678if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400679 libselinux = dependency('libselinux',
680 version : '>= 2.1.9',
681 required : want_selinux == 'true')
682 if libselinux.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400683 conf.set('HAVE_SELINUX', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400684 m4_defines += ['-DHAVE_SELINUX']
685 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400686else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400687 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400688endif
689
690want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400691if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400692 libapparmor = dependency('libapparmor',
693 required : want_apparmor == 'true')
694 if libapparmor.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400695 conf.set('HAVE_APPARMOR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400696 m4_defines += ['-DHAVE_APPARMOR']
697 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400698else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400699 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400700endif
701
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400702smack_run_label = get_option('smack-run-label')
703if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400704 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
705 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400706endif
707
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400708want_polkit = get_option('polkit')
709install_polkit = false
710install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400711if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400712 conf.set('ENABLE_POLKIT', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400713 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400714
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400715 libpolkit = dependency('polkit-gobject-1',
716 required : false)
717 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
718 message('Old polkit detected, will install pkla files')
719 install_polkit_pkla = true
720 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400721endif
722
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400723want_acl = get_option('acl')
724if want_acl != 'false'
725 libacl = cc.find_library('acl', required : want_acl == 'true')
726 if libacl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400727 conf.set('HAVE_ACL', true)
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400728 m4_defines += ['-DHAVE_ACL']
729 endif
730else
731 libacl = []
732endif
733
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400734want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400735if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400736 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400737 conf.set('HAVE_AUDIT', libaudit.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400738else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400739 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400740endif
741
742want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400743if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400744 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400745 conf.set('HAVE_BLKID', libblkid.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400746else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400747 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400748endif
749
750want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400751if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400752 libkmod = dependency('libkmod',
753 version : '>= 15',
754 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400755 conf.set('HAVE_KMOD', libkmod.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400756else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400757 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400758endif
759
760want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400761if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400762 libpam = cc.find_library('pam', required : want_pam == 'true')
763 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
764 if libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400765 conf.set('HAVE_PAM', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400766 m4_defines += ['-DHAVE_PAM']
767 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400768else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400769 libpam = []
770 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400771endif
772
773want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400774if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400775 libmicrohttpd = dependency('libmicrohttpd',
776 version : '>= 0.9.33',
777 required : want_microhttpd == 'true')
778 if libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400779 conf.set('HAVE_MICROHTTPD', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400780 m4_defines += ['-DHAVE_MICROHTTPD']
781 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400782else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400783 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400784endif
785
786want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400787if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400788 libcryptsetup = dependency('libcryptsetup',
789 version : '>= 1.6.0',
790 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400791 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400792else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400793 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400794endif
795
796want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400797if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400798 libcurl = dependency('libcurl',
799 version : '>= 7.32.0',
800 required : want_libcurl == 'true')
801 if libcurl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400802 conf.set('HAVE_LIBCURL', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400803 m4_defines += ['-DHAVE_LIBCURL']
804 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400805else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400806 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400807endif
808
809want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400810want_libidn2 = get_option('libidn2')
811if want_libidn == 'true' and want_libidn2 == 'true'
812 error('libidn and libidn2 cannot be requested simultaneously')
813endif
814
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400815if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400816 libidn = dependency('libidn',
817 required : want_libidn == 'true')
818 if libidn.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400819 conf.set('HAVE_LIBIDN', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400820 m4_defines += ['-DHAVE_LIBIDN']
821 endif
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400822else
823 libidn = []
824endif
825if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
826 # libidn is used for both libidn and libidn2 objects
827 libidn = dependency('libidn2',
828 required : want_libidn2 == 'true')
829 if libidn.found()
830 conf.set('HAVE_LIBIDN2', true)
831 m4_defines += ['-DHAVE_LIBIDN2']
832 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400833endif
834
835want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400836if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400837 libiptc = dependency('libiptc',
838 required : want_libiptc == 'true')
839 if libiptc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400840 conf.set('HAVE_LIBIPTC', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400841 m4_defines += ['-DHAVE_LIBIPTC']
842 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400843else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400844 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400845endif
846
847want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400848if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400849 libqrencode = dependency('libqrencode',
850 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400851 conf.set('HAVE_QRENCODE', libqrencode.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400852else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400853 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400854endif
855
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400856want_gcrypt = get_option('gcrypt')
857if want_gcrypt != 'false'
858 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
859 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
860
861 have_deps = libgcrypt.found() and libgpg_error.found()
862 conf.set('HAVE_GCRYPT', have_deps)
863 if not have_deps
864 # link to neither of the libs if one is not found
865 libgcrypt = []
866 libgpg_error = []
867 endif
868else
869 libgcrypt = []
870 libgpg_error = []
871endif
872
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400873want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400874if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400875 libgnutls = dependency('gnutls',
876 version : '>= 3.1.4',
877 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400878 conf.set('HAVE_GNUTLS', libgnutls.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400879else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400880 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400881endif
882
883want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400884if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400885 libdw = dependency('libdw',
886 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400887 conf.set('HAVE_ELFUTILS', libdw.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400888else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400889 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400890endif
891
892want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400893if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400894 libz = dependency('zlib',
895 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400896 conf.set('HAVE_ZLIB', libz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400897else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400898 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400899endif
900
901want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400902if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400903 libbzip2 = cc.find_library('bz2',
904 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400905 conf.set('HAVE_BZIP2', libbzip2.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400906else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400907 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400908endif
909
910want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400911if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400912 libxz = dependency('liblzma',
913 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400914 conf.set('HAVE_XZ', libxz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400915else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400916 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400917endif
918
919want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400920if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400921 liblz4 = dependency('liblz4',
922 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400923 conf.set('HAVE_LZ4', liblz4.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400924else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400925 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400926endif
927
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400928want_xkbcommon = get_option('xkbcommon')
929if want_xkbcommon != 'false'
930 libxkbcommon = dependency('xkbcommon',
931 version : '>= 0.3.0',
932 required : want_xkbcommon == 'true')
933 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
934else
935 libxkbcommon = []
936endif
937
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400938want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400939if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400940 libglib = dependency('glib-2.0',
941 version : '>= 2.22.0',
942 required : want_glib == 'true')
943 libgobject = dependency('gobject-2.0',
944 version : '>= 2.22.0',
945 required : want_glib == 'true')
946 libgio = dependency('gio-2.0',
947 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400948 have = libglib.found() and libgobject.found() and libgio.found()
949 conf.set('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400950else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400951 libglib = []
952 libgobject = []
953 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400954endif
955
956want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400957if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400958 libdbus = dependency('dbus-1',
959 version : '>= 1.3.2',
960 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400961 conf.set('HAVE_DBUS', libdbus.found())
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400962else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400963 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400964endif
965
Yu Watanabe42303dc2017-06-18 05:22:32 +0900966default_dnssec = get_option('default-dnssec')
967if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
968 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
969 default_dnssec = 'no'
970endif
971conf.set('DEFAULT_DNSSEC_MODE',
972 'DNSSEC_' + default_dnssec.underscorify().to_upper())
973substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
974
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400975want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400976if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400977 have_deps = (conf.get('HAVE_LIBCURL', false) and
978 conf.get('HAVE_ZLIB', false) and
979 conf.get('HAVE_BZIP2', false) and
980 conf.get('HAVE_XZ', false) and
981 conf.get('HAVE_GCRYPT', false))
982 conf.set('ENABLE_IMPORTD', have_deps)
983 if want_importd == 'true' and not have_deps
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400984 error('importd support was requested, but dependencies are not available')
985 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400986endif
987
988want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400989if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400990 have_deps = [conf.get('HAVE_MICROHTTPD', false),
991 conf.get('HAVE_LIBCURL', false)]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400992 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
993 # it's possible to build one without the other. Complain only if
994 # support was explictly requested. The auxiliary files like sysusers
995 # config should be installed when any of the programs are built.
996 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
997 error('remote support was requested, but dependencies are not available')
998 endif
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400999 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001000endif
1001
1002foreach pair : [['utmp', 'HAVE_UTMP'],
1003 ['hibernate', 'ENABLE_HIBERNATE'],
1004 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1005 ['binfmt', 'ENABLE_BINFMT'],
1006 ['coredump', 'ENABLE_COREDUMP'],
1007 ['resolve', 'ENABLE_RESOLVED'],
1008 ['logind', 'ENABLE_LOGIND'],
1009 ['hostnamed', 'ENABLE_HOSTNAMED'],
1010 ['localed', 'ENABLE_LOCALED'],
1011 ['machined', 'ENABLE_MACHINED'],
1012 ['networkd', 'ENABLE_NETWORKD'],
1013 ['timedated', 'ENABLE_TIMEDATED'],
1014 ['timesyncd', 'ENABLE_TIMESYNCD'],
1015 ['myhostname', 'HAVE_MYHOSTNAME'],
1016 ['firstboot', 'ENABLE_FIRSTBOOT'],
1017 ['randomseed', 'ENABLE_RANDOMSEED'],
1018 ['backlight', 'ENABLE_BACKLIGHT'],
1019 ['vconsole', 'ENABLE_VCONSOLE'],
1020 ['quotacheck', 'ENABLE_QUOTACHECK'],
1021 ['sysusers', 'ENABLE_SYSUSERS'],
1022 ['tmpfiles', 'ENABLE_TMPFILES'],
1023 ['hwdb', 'ENABLE_HWDB'],
1024 ['rfkill', 'ENABLE_RFKILL'],
1025 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001026 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek18b9ad12017-07-13 09:31:47 -04001027 ['tpm', 'ENABLE_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -04001028 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -04001029 ['smack', 'HAVE_SMACK'],
Franck Buib14e1b42017-05-09 14:02:37 +02001030 ['gshadow', 'ENABLE_GSHADOW'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04001031 ['idn', 'ENABLE_IDN'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001032 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001033 ]
1034
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001035 if get_option(pair[0])
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001036 conf.set(pair[1], true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001037 m4_defines += ['-D' + pair[1]]
1038 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001039endforeach
1040
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001041want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001042install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001043tests = []
1044
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001045conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1046
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001047#####################################################################
1048
1049if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001050 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001051
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001052 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001053 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001054 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001055 elif efi_arch == 'x86_64'
1056 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001057 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001058 elif efi_arch == 'arm'
1059 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001060 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001061 elif efi_arch == 'aarch64'
1062 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001063 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001064 else
1065 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001066 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001067 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001068
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001069 conf.set('ENABLE_EFI', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001070 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001071
1072 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001073endif
1074
1075#####################################################################
1076
1077config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001078 output : 'config.h',
1079 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001080
1081includes = include_directories('src/basic',
1082 'src/shared',
1083 'src/systemd',
1084 'src/journal',
1085 'src/resolve',
1086 'src/timesync',
1087 'src/login',
1088 'src/udev',
1089 'src/libudev',
1090 'src/core',
1091 'src/libsystemd/sd-bus',
1092 'src/libsystemd/sd-device',
1093 'src/libsystemd/sd-hwdb',
1094 'src/libsystemd/sd-id128',
1095 'src/libsystemd/sd-netlink',
1096 'src/libsystemd/sd-network',
1097 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001098 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001099 )
1100
1101add_project_arguments('-include', 'config.h', language : 'c')
1102
1103gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1104 'src/shared/gcrypt-util.c')
1105
1106subdir('po')
1107subdir('catalog')
1108subdir('src/systemd')
1109subdir('src/basic')
1110subdir('src/libsystemd')
1111subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001112subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001113subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001114
1115libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001116 'journal-core',
1117 libjournal_core_sources,
1118 journald_gperf_c,
1119 include_directories : includes,
1120 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001121
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001122libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001123libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001124 'systemd',
1125 libsystemd_internal_sources,
1126 journal_internal_sources,
Lennart Poettering43091722017-06-27 23:11:26 +02001127 version : '0.19.0',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001128 include_directories : includes,
1129 link_args : ['-shared',
1130 '-Wl,--version-script=' + libsystemd_sym_path],
1131 link_with : [libbasic],
1132 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001133 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001134 librt,
1135 libxz,
1136 liblz4],
1137 link_depends : libsystemd_sym,
1138 install : true,
1139 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001140
1141############################################################
1142
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001143# binaries that have --help and are intended for use by humans,
1144# usually, but not always, installed in /bin.
1145public_programs = []
1146
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001147subdir('src/libudev')
1148subdir('src/shared')
1149subdir('src/core')
1150subdir('src/udev')
1151subdir('src/network')
1152
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001153subdir('src/analyze')
1154subdir('src/journal-remote')
1155subdir('src/coredump')
1156subdir('src/hostname')
1157subdir('src/import')
1158subdir('src/kernel-install')
1159subdir('src/locale')
1160subdir('src/machine')
1161subdir('src/nspawn')
1162subdir('src/resolve')
1163subdir('src/timedate')
1164subdir('src/timesync')
1165subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001166subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001167subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001168
1169subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001170subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001171
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001172############################################################
1173
1174# only static linking apart from libdl, to make sure that the
1175# module is linked to all libraries that it uses.
1176test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001177 'test-dlopen',
1178 test_dlopen_c,
1179 include_directories : includes,
1180 link_with : [libbasic],
1181 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001182
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001183foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001184 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001185 ['mymachines', 'ENABLE_MACHINED'],
1186 ['resolve', 'ENABLE_RESOLVED']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001187
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001188 condition = tuple[1] == '' or conf.get(tuple[1], false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001189 if condition
1190 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001191
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001192 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1193 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001194
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001195 nss = shared_library(
1196 'nss_' + module,
1197 'src/nss-@0@/nss-@0@.c'.format(module),
1198 version : '2',
1199 include_directories : includes,
1200 link_args : ['-shared',
1201 '-Wl,--version-script=' + version_script_arg,
1202 '-Wl,--undefined'],
1203 link_with : [libsystemd_internal,
1204 libbasic],
1205 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001206 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001207 link_depends : sym,
1208 install : true,
1209 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001210
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001211 # We cannot use shared_module because it does not support version suffix.
1212 # Unfortunately shared_library insists on creating the symlink…
1213 meson.add_install_script('sh', '-c',
1214 'rm $DESTDIR@0@/libnss_@1@.so'
1215 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001216
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001217 test('dlopen-nss_' + module,
1218 test_dlopen,
1219 args : [nss.full_path()]) # path to dlopen must include a slash
1220 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001221endforeach
1222
1223############################################################
1224
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001225executable('systemd',
1226 systemd_sources,
1227 include_directories : includes,
1228 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001229 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001230 dependencies : [threads,
1231 librt,
1232 libseccomp,
1233 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001234 libmount,
1235 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001236 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001237 install : true,
1238 install_dir : rootlibexecdir)
1239
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001240exe = executable('systemd-analyze',
1241 systemd_analyze_sources,
1242 include_directories : includes,
1243 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001244 libshared],
1245 dependencies : [threads,
1246 librt,
1247 libseccomp,
1248 libselinux,
1249 libmount,
1250 libblkid],
1251 install_rpath : rootlibexecdir,
1252 install : true)
1253public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001254
1255executable('systemd-journald',
1256 systemd_journald_sources,
1257 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001258 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001259 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001260 dependencies : [threads,
1261 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001262 liblz4,
1263 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001264 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001265 install : true,
1266 install_dir : rootlibexecdir)
1267
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001268exe = executable('systemd-cat',
1269 systemd_cat_sources,
1270 include_directories : includes,
1271 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001272 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001273 dependencies : [threads],
1274 install_rpath : rootlibexecdir,
1275 install : true)
1276public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001277
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001278exe = executable('journalctl',
1279 journalctl_sources,
1280 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001281 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001282 dependencies : [threads,
1283 libqrencode,
1284 libxz,
1285 liblz4],
1286 install_rpath : rootlibexecdir,
1287 install : true,
1288 install_dir : rootbindir)
1289public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001290
1291executable('systemd-getty-generator',
1292 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001293 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001294 link_with : [libshared],
1295 install_rpath : rootlibexecdir,
1296 install : true,
1297 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001298
1299executable('systemd-debug-generator',
1300 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001301 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001302 link_with : [libshared],
1303 install_rpath : rootlibexecdir,
1304 install : true,
1305 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001306
1307executable('systemd-fstab-generator',
1308 'src/fstab-generator/fstab-generator.c',
1309 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001310 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001311 link_with : [libshared],
1312 install_rpath : rootlibexecdir,
1313 install : true,
1314 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001315
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001316if conf.get('ENABLE_ENVIRONMENT_D', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001317 executable('30-systemd-environment-d-generator',
1318 'src/environment-d-generator/environment-d-generator.c',
1319 include_directories : includes,
1320 link_with : [libshared],
1321 install_rpath : rootlibexecdir,
1322 install : true,
1323 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001324
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001325 meson.add_install_script(meson_make_symlink,
1326 join_paths(sysconfdir, 'environment'),
1327 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001328endif
1329
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001330if conf.get('ENABLE_HIBERNATE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001331 executable('systemd-hibernate-resume-generator',
1332 'src/hibernate-resume/hibernate-resume-generator.c',
1333 include_directories : includes,
1334 link_with : [libshared],
1335 install_rpath : rootlibexecdir,
1336 install : true,
1337 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001338
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001339 executable('systemd-hibernate-resume',
1340 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001341 include_directories : includes,
1342 link_with : [libshared],
1343 install_rpath : rootlibexecdir,
1344 install : true,
1345 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001346endif
1347
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001348if conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001349 executable('systemd-gpt-auto-generator',
1350 'src/gpt-auto-generator/gpt-auto-generator.c',
1351 'src/basic/blkid-util.h',
1352 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001353 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001354 dependencies : libblkid,
1355 install_rpath : rootlibexecdir,
1356 install : true,
1357 install_dir : systemgeneratordir)
1358
1359 exe = executable('systemd-dissect',
1360 'src/dissect/dissect.c',
1361 include_directories : includes,
1362 link_with : [libshared],
1363 install_rpath : rootlibexecdir,
1364 install : true,
1365 install_dir : rootlibexecdir)
1366 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001367endif
1368
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001369if conf.get('ENABLE_RESOLVED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001370 executable('systemd-resolved',
1371 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001372 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001373 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001374 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001375 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001376 libgcrypt,
1377 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001378 libm,
1379 libidn],
1380 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001381 install : true,
1382 install_dir : rootlibexecdir)
1383
1384 exe = executable('systemd-resolve',
1385 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001386 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001387 include_directories : includes,
1388 link_with : [libshared],
1389 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001390 libgcrypt,
1391 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001392 libm,
1393 libidn],
1394 install_rpath : rootlibexecdir,
1395 install : true)
1396 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001397endif
1398
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001399if conf.get('ENABLE_LOGIND', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001400 executable('systemd-logind',
1401 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001402 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001403 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001404 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001405 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001406 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001407 install_rpath : rootlibexecdir,
1408 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001409 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001410
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001411 exe = executable('loginctl',
1412 loginctl_sources,
1413 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001414 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001415 dependencies : [threads,
1416 liblz4,
1417 libxz],
1418 install_rpath : rootlibexecdir,
1419 install : true,
1420 install_dir : rootbindir)
1421 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001422
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001423 exe = executable('systemd-inhibit',
1424 'src/login/inhibit.c',
1425 include_directories : includes,
1426 link_with : [libshared],
1427 install_rpath : rootlibexecdir,
1428 install : true,
1429 install_dir : rootbindir)
1430 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001431
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001432 if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001433 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1434 pam_systemd = shared_library(
1435 'pam_systemd',
1436 pam_systemd_c,
1437 name_prefix : '',
1438 include_directories : includes,
1439 link_args : ['-shared',
1440 '-Wl,--version-script=' + version_script_arg],
1441 link_with : [libsystemd_internal,
1442 libshared_static],
1443 dependencies : [threads,
1444 libpam,
1445 libpam_misc],
1446 link_depends : pam_systemd_sym,
1447 install : true,
1448 install_dir : pamlibdir)
1449
1450 test('dlopen-pam_systemd',
1451 test_dlopen,
1452 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1453 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001454endif
1455
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001456if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001457 executable('systemd-user-sessions',
1458 'src/user-sessions/user-sessions.c',
1459 include_directories : includes,
1460 link_with : [libshared],
1461 install_rpath : rootlibexecdir,
1462 install : true,
1463 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001464endif
1465
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001466if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001467 exe = executable('bootctl',
1468 'src/boot/bootctl.c',
1469 include_directories : includes,
1470 link_with : [libshared],
1471 dependencies : [libblkid],
1472 install_rpath : rootlibexecdir,
1473 install : true)
1474 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001475endif
1476
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001477exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1478 include_directories : includes,
1479 link_with : [libshared],
1480 dependencies : [threads],
1481 install_rpath : rootlibexecdir,
1482 install : true)
1483public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001484
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001485exe = executable('systemctl', 'src/systemctl/systemctl.c',
1486 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001487 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001488 dependencies : [threads,
1489 libcap,
1490 libselinux,
1491 libxz,
1492 liblz4],
1493 install_rpath : rootlibexecdir,
1494 install : true,
1495 install_dir : rootbindir)
1496public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001497
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001498if conf.get('ENABLE_BACKLIGHT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001499 executable('systemd-backlight',
1500 'src/backlight/backlight.c',
1501 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001502 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001503 install_rpath : rootlibexecdir,
1504 install : true,
1505 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001506endif
1507
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001508if conf.get('ENABLE_RFKILL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001509 executable('systemd-rfkill',
1510 'src/rfkill/rfkill.c',
1511 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001512 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001513 install_rpath : rootlibexecdir,
1514 install : true,
1515 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001516endif
1517
1518executable('systemd-system-update-generator',
1519 'src/system-update-generator/system-update-generator.c',
1520 include_directories : includes,
1521 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001522 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001523 install : true,
1524 install_dir : systemgeneratordir)
1525
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001526if conf.get('HAVE_LIBCRYPTSETUP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001527 executable('systemd-cryptsetup',
1528 'src/cryptsetup/cryptsetup.c',
1529 include_directories : includes,
1530 link_with : [libshared],
1531 dependencies : [libcryptsetup],
1532 install_rpath : rootlibexecdir,
1533 install : true,
1534 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001535
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001536 executable('systemd-cryptsetup-generator',
1537 'src/cryptsetup/cryptsetup-generator.c',
1538 include_directories : includes,
1539 link_with : [libshared],
1540 dependencies : [libcryptsetup],
1541 install_rpath : rootlibexecdir,
1542 install : true,
1543 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001544
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001545 executable('systemd-veritysetup',
1546 'src/veritysetup/veritysetup.c',
1547 include_directories : includes,
1548 link_with : [libshared],
1549 dependencies : [libcryptsetup],
1550 install_rpath : rootlibexecdir,
1551 install : true,
1552 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001553
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001554 executable('systemd-veritysetup-generator',
1555 'src/veritysetup/veritysetup-generator.c',
1556 include_directories : includes,
1557 link_with : [libshared],
1558 dependencies : [libcryptsetup],
1559 install_rpath : rootlibexecdir,
1560 install : true,
1561 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001562endif
1563
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001564if conf.get('HAVE_SYSV_COMPAT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001565 executable('systemd-sysv-generator',
1566 'src/sysv-generator/sysv-generator.c',
1567 include_directories : includes,
1568 link_with : [libshared],
1569 install_rpath : rootlibexecdir,
1570 install : true,
1571 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001572
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001573 executable('systemd-rc-local-generator',
1574 'src/rc-local-generator/rc-local-generator.c',
1575 include_directories : includes,
1576 link_with : [libshared],
1577 install_rpath : rootlibexecdir,
1578 install : true,
1579 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001580endif
1581
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001582if conf.get('ENABLE_HOSTNAMED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001583 executable('systemd-hostnamed',
1584 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001585 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001586 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001587 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001588 install : true,
1589 install_dir : rootlibexecdir)
1590
1591 exe = executable('hostnamectl',
1592 'src/hostname/hostnamectl.c',
1593 include_directories : includes,
1594 link_with : [libshared],
1595 install_rpath : rootlibexecdir,
1596 install : true)
1597 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001598endif
1599
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001600if conf.get('ENABLE_LOCALED', false)
1601 if conf.get('HAVE_XKBCOMMON', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001602 # logind will load libxkbcommon.so dynamically on its own
1603 deps = [libdl]
1604 else
1605 deps = []
1606 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001607
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001608 executable('systemd-localed',
1609 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001610 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001611 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001612 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001613 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001614 install : true,
1615 install_dir : rootlibexecdir)
1616
1617 exe = executable('localectl',
1618 localectl_sources,
1619 include_directories : includes,
1620 link_with : [libshared],
1621 install_rpath : rootlibexecdir,
1622 install : true)
1623 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001624endif
1625
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001626if conf.get('ENABLE_TIMEDATED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001627 executable('systemd-timedated',
1628 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001629 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001630 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001631 install_rpath : rootlibexecdir,
1632 install : true,
1633 install_dir : rootlibexecdir)
1634
1635 exe = executable('timedatectl',
1636 'src/timedate/timedatectl.c',
1637 include_directories : includes,
1638 install_rpath : rootlibexecdir,
1639 link_with : [libshared],
1640 install : true)
1641 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001642endif
1643
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001644if conf.get('ENABLE_TIMESYNCD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001645 executable('systemd-timesyncd',
1646 systemd_timesyncd_sources,
1647 include_directories : includes,
1648 link_with : [libshared],
1649 dependencies : [threads,
1650 libm],
1651 install_rpath : rootlibexecdir,
1652 install : true,
1653 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001654endif
1655
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001656if conf.get('ENABLE_MACHINED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001657 executable('systemd-machined',
1658 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001659 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001660 link_with : [libmachine_core,
1661 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001662 install_rpath : rootlibexecdir,
1663 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001664 install_dir : rootlibexecdir)
1665
1666 exe = executable('machinectl',
1667 'src/machine/machinectl.c',
1668 include_directories : includes,
1669 link_with : [libshared],
1670 dependencies : [threads,
1671 libxz,
1672 liblz4],
1673 install_rpath : rootlibexecdir,
1674 install : true,
1675 install_dir : rootbindir)
1676 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001677endif
1678
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001679if conf.get('ENABLE_IMPORTD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001680 executable('systemd-importd',
1681 systemd_importd_sources,
1682 include_directories : includes,
1683 link_with : [libshared],
1684 dependencies : [threads],
1685 install_rpath : rootlibexecdir,
1686 install : true,
1687 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001688
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001689 systemd_pull = executable('systemd-pull',
1690 systemd_pull_sources,
1691 include_directories : includes,
1692 link_with : [libshared],
1693 dependencies : [libcurl,
1694 libz,
1695 libbzip2,
1696 libxz,
1697 libgcrypt],
1698 install_rpath : rootlibexecdir,
1699 install : true,
1700 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001701
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001702 systemd_import = executable('systemd-import',
1703 systemd_import_sources,
1704 include_directories : includes,
1705 link_with : [libshared],
1706 dependencies : [libcurl,
1707 libz,
1708 libbzip2,
1709 libxz],
1710 install_rpath : rootlibexecdir,
1711 install : true,
1712 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001713
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001714 systemd_export = executable('systemd-export',
1715 systemd_export_sources,
1716 include_directories : includes,
1717 link_with : [libshared],
1718 dependencies : [libcurl,
1719 libz,
1720 libbzip2,
1721 libxz],
1722 install_rpath : rootlibexecdir,
1723 install : true,
1724 install_dir : rootlibexecdir)
1725 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001726endif
1727
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001728if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001729 exe = executable('systemd-journal-upload',
1730 systemd_journal_upload_sources,
1731 include_directories : includes,
1732 link_with : [libshared],
1733 dependencies : [threads,
1734 libcurl,
1735 libgnutls,
1736 libxz,
1737 liblz4],
1738 install_rpath : rootlibexecdir,
1739 install : true,
1740 install_dir : rootlibexecdir)
1741 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001742endif
1743
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001744if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001745 s_j_remote = executable('systemd-journal-remote',
1746 systemd_journal_remote_sources,
1747 include_directories : includes,
1748 link_with : [libshared],
1749 dependencies : [threads,
1750 libmicrohttpd,
1751 libgnutls,
1752 libxz,
1753 liblz4],
1754 install_rpath : rootlibexecdir,
1755 install : true,
1756 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001757
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001758 s_j_gatewayd = executable('systemd-journal-gatewayd',
1759 systemd_journal_gatewayd_sources,
1760 include_directories : includes,
1761 link_with : [libshared],
1762 dependencies : [threads,
1763 libmicrohttpd,
1764 libgnutls,
1765 libxz,
1766 liblz4],
1767 install_rpath : rootlibexecdir,
1768 install : true,
1769 install_dir : rootlibexecdir)
1770 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001771endif
1772
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001773if conf.get('ENABLE_COREDUMP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001774 executable('systemd-coredump',
1775 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001776 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001777 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001778 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001779 libacl,
1780 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001781 libxz,
1782 liblz4],
1783 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001784 install : true,
1785 install_dir : rootlibexecdir)
1786
1787 exe = executable('coredumpctl',
1788 coredumpctl_sources,
1789 include_directories : includes,
1790 link_with : [libshared],
1791 dependencies : [threads,
1792 libxz,
1793 liblz4],
1794 install_rpath : rootlibexecdir,
1795 install : true)
1796 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001797endif
1798
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001799if conf.get('ENABLE_BINFMT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001800 exe = executable('systemd-binfmt',
1801 'src/binfmt/binfmt.c',
1802 include_directories : includes,
1803 link_with : [libshared],
1804 install_rpath : rootlibexecdir,
1805 install : true,
1806 install_dir : rootlibexecdir)
1807 public_programs += [exe]
1808
1809 meson.add_install_script('sh', '-c',
1810 mkdir_p.format(binfmtdir))
1811 meson.add_install_script('sh', '-c',
1812 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1813endif
1814
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001815if conf.get('ENABLE_VCONSOLE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001816 executable('systemd-vconsole-setup',
1817 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001818 include_directories : includes,
1819 link_with : [libshared],
1820 install_rpath : rootlibexecdir,
1821 install : true,
1822 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001823endif
1824
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001825if conf.get('ENABLE_RANDOMSEED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001826 executable('systemd-random-seed',
1827 'src/random-seed/random-seed.c',
1828 include_directories : includes,
1829 link_with : [libshared],
1830 install_rpath : rootlibexecdir,
1831 install : true,
1832 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001833endif
1834
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001835if conf.get('ENABLE_FIRSTBOOT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001836 executable('systemd-firstboot',
1837 'src/firstboot/firstboot.c',
1838 include_directories : includes,
1839 link_with : [libshared],
1840 dependencies : [libcrypt],
1841 install_rpath : rootlibexecdir,
1842 install : true,
1843 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001844endif
1845
1846executable('systemd-remount-fs',
1847 'src/remount-fs/remount-fs.c',
1848 'src/core/mount-setup.c',
1849 'src/core/mount-setup.h',
1850 include_directories : includes,
1851 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001852 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001853 install : true,
1854 install_dir : rootlibexecdir)
1855
1856executable('systemd-machine-id-setup',
1857 'src/machine-id-setup/machine-id-setup-main.c',
1858 'src/core/machine-id-setup.c',
1859 'src/core/machine-id-setup.h',
1860 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001861 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001862 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001863 install : true,
1864 install_dir : rootbindir)
1865
1866executable('systemd-fsck',
1867 'src/fsck/fsck.c',
1868 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001869 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001870 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001871 install : true,
1872 install_dir : rootlibexecdir)
1873
1874executable('systemd-sleep',
1875 'src/sleep/sleep.c',
1876 include_directories : includes,
1877 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001878 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001879 install : true,
1880 install_dir : rootlibexecdir)
1881
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001882exe = executable('systemd-sysctl',
1883 'src/sysctl/sysctl.c',
1884 include_directories : includes,
1885 link_with : [libshared],
1886 install_rpath : rootlibexecdir,
1887 install : true,
1888 install_dir : rootlibexecdir)
1889public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001890
1891executable('systemd-ac-power',
1892 'src/ac-power/ac-power.c',
1893 include_directories : includes,
1894 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001895 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001896 install : true,
1897 install_dir : rootlibexecdir)
1898
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001899exe = executable('systemd-detect-virt',
1900 'src/detect-virt/detect-virt.c',
1901 include_directories : includes,
1902 link_with : [libshared],
1903 install_rpath : rootlibexecdir,
1904 install : true)
1905public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001906
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001907exe = executable('systemd-delta',
1908 'src/delta/delta.c',
1909 include_directories : includes,
1910 link_with : [libshared],
1911 install_rpath : rootlibexecdir,
1912 install : true)
1913public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001914
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001915exe = executable('systemd-escape',
1916 'src/escape/escape.c',
1917 include_directories : includes,
1918 link_with : [libshared],
1919 install_rpath : rootlibexecdir,
1920 install : true,
1921 install_dir : rootbindir)
1922public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001923
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001924exe = executable('systemd-notify',
1925 'src/notify/notify.c',
1926 include_directories : includes,
1927 link_with : [libshared],
1928 install_rpath : rootlibexecdir,
1929 install : true,
1930 install_dir : rootbindir)
1931public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001932
1933executable('systemd-volatile-root',
1934 'src/volatile-root/volatile-root.c',
1935 include_directories : includes,
1936 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001937 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001938 install : true,
1939 install_dir : rootlibexecdir)
1940
1941executable('systemd-cgroups-agent',
1942 'src/cgroups-agent/cgroups-agent.c',
1943 include_directories : includes,
1944 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001945 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001946 install : true,
1947 install_dir : rootlibexecdir)
1948
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001949exe = executable('systemd-path',
1950 'src/path/path.c',
1951 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001952 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001953 install_rpath : rootlibexecdir,
1954 install : true)
1955public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001956
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001957exe = executable('systemd-ask-password',
1958 'src/ask-password/ask-password.c',
1959 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001960 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001961 install_rpath : rootlibexecdir,
1962 install : true,
1963 install_dir : rootbindir)
1964public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001965
1966executable('systemd-reply-password',
1967 'src/reply-password/reply-password.c',
1968 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001969 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001970 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001971 install : true,
1972 install_dir : rootlibexecdir)
1973
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001974exe = executable('systemd-tty-ask-password-agent',
1975 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1976 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001977 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001978 install_rpath : rootlibexecdir,
1979 install : true,
1980 install_dir : rootbindir)
1981public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001982
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001983exe = executable('systemd-cgls',
1984 'src/cgls/cgls.c',
1985 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001986 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001987 install_rpath : rootlibexecdir,
1988 install : true)
1989public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001990
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001991exe = executable('systemd-cgtop',
1992 'src/cgtop/cgtop.c',
1993 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001994 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001995 install_rpath : rootlibexecdir,
1996 install : true)
1997public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001998
1999executable('systemd-initctl',
2000 'src/initctl/initctl.c',
2001 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002002 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002003 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002004 install : true,
2005 install_dir : rootlibexecdir)
2006
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002007exe = executable('systemd-mount',
2008 'src/mount/mount-tool.c',
2009 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002010 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002011 install_rpath : rootlibexecdir,
2012 install : true)
2013public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002014
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002015meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002016 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002017
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002018exe = executable('systemd-run',
2019 'src/run/run.c',
2020 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002021 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002022 install_rpath : rootlibexecdir,
2023 install : true)
2024public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002025
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002026exe = executable('systemd-stdio-bridge',
2027 'src/stdio-bridge/stdio-bridge.c',
2028 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002029 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002030 install_rpath : rootlibexecdir,
2031 install : true)
2032public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002033
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002034exe = executable('busctl',
2035 'src/busctl/busctl.c',
2036 'src/busctl/busctl-introspect.c',
2037 'src/busctl/busctl-introspect.h',
2038 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002039 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002040 install_rpath : rootlibexecdir,
2041 install : true)
2042public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002043
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002044if conf.get('ENABLE_SYSUSERS', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002045 exe = executable('systemd-sysusers',
2046 'src/sysusers/sysusers.c',
2047 include_directories : includes,
2048 link_with : [libshared],
2049 install_rpath : rootlibexecdir,
2050 install : true,
2051 install_dir : rootbindir)
2052 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002053endif
2054
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002055if conf.get('ENABLE_TMPFILES', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002056 exe = executable('systemd-tmpfiles',
2057 'src/tmpfiles/tmpfiles.c',
2058 include_directories : includes,
2059 link_with : [libshared],
2060 dependencies : [libacl],
2061 install_rpath : rootlibexecdir,
2062 install : true,
2063 install_dir : rootbindir)
2064 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002065endif
2066
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002067if conf.get('ENABLE_HWDB', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002068 exe = executable('systemd-hwdb',
2069 'src/hwdb/hwdb.c',
2070 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2071 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002072 link_with : [libudev_internal],
2073 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002074 install : true,
2075 install_dir : rootbindir)
2076 public_programs += [exe]
2077endif
2078
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002079if conf.get('ENABLE_QUOTACHECK', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002080 executable('systemd-quotacheck',
2081 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002082 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002083 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002084 install_rpath : rootlibexecdir,
2085 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002086 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002087endif
2088
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002089exe = executable('systemd-socket-proxyd',
2090 'src/socket-proxy/socket-proxyd.c',
2091 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002092 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002093 dependencies : [threads],
2094 install_rpath : rootlibexecdir,
2095 install : true,
2096 install_dir : rootlibexecdir)
2097public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002098
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002099exe = executable('systemd-udevd',
2100 systemd_udevd_sources,
2101 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002102 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002103 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002104 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002105 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002106 dependencies : [threads,
2107 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002108 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002109 libacl,
2110 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002111 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002112 install : true,
2113 install_dir : rootlibexecdir)
2114public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002115
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002116exe = executable('udevadm',
2117 udevadm_sources,
2118 include_directories : includes,
2119 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002120 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002121 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002122 dependencies : [threads,
2123 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002124 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002125 libacl,
2126 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002127 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002128 install : true,
2129 install_dir : rootbindir)
2130public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002131
2132executable('systemd-shutdown',
2133 systemd_shutdown_sources,
2134 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002135 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002136 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002137 install : true,
2138 install_dir : rootlibexecdir)
2139
2140executable('systemd-update-done',
2141 'src/update-done/update-done.c',
2142 include_directories : includes,
2143 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002144 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002145 install : true,
2146 install_dir : rootlibexecdir)
2147
2148executable('systemd-update-utmp',
2149 'src/update-utmp/update-utmp.c',
2150 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002151 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002152 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002153 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002154 install : true,
2155 install_dir : rootlibexecdir)
2156
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002157if conf.get('HAVE_KMOD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002158 executable('systemd-modules-load',
2159 'src/modules-load/modules-load.c',
2160 include_directories : includes,
2161 link_with : [libshared],
2162 dependencies : [libkmod],
2163 install_rpath : rootlibexecdir,
2164 install : true,
2165 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002166
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002167 meson.add_install_script('sh', '-c',
2168 mkdir_p.format(modulesloaddir))
2169 meson.add_install_script('sh', '-c',
2170 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002171endif
2172
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002173exe = executable('systemd-nspawn',
2174 systemd_nspawn_sources,
2175 'src/core/mount-setup.c', # FIXME: use a variable?
2176 'src/core/mount-setup.h',
2177 'src/core/loopback-setup.c',
2178 'src/core/loopback-setup.h',
2179 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002180 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002181 dependencies : [libacl,
2182 libblkid,
2183 libseccomp,
2184 libselinux],
2185 install_rpath : rootlibexecdir,
2186 install : true)
2187public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002188
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002189if conf.get('ENABLE_NETWORKD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002190 executable('systemd-networkd',
2191 systemd_networkd_sources,
2192 include_directories : includes,
2193 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002194 libsystemd_network,
2195 libudev_internal,
2196 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002197 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002198 install_rpath : rootlibexecdir,
2199 install : true,
2200 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002201
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002202 executable('systemd-networkd-wait-online',
2203 systemd_networkd_wait_online_sources,
2204 include_directories : includes,
2205 link_with : [libnetworkd_core,
2206 libshared],
2207 install_rpath : rootlibexecdir,
2208 install : true,
2209 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002210
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002211 exe = executable('networkctl',
2212 networkctl_sources,
2213 include_directories : includes,
2214 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002215 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002216 install_rpath : rootlibexecdir,
2217 install : true,
2218 install_dir : rootbindir)
2219 public_programs += [exe]
2220endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002221############################################################
2222
2223foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002224 sources = tuple[0]
2225 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2226 dependencies = tuple[2]
2227 condition = tuple.length() >= 4 ? tuple[3] : ''
2228 type = tuple.length() >= 5 ? tuple[4] : ''
2229 defs = tuple.length() >= 6 ? tuple[5] : []
2230 incs = tuple.length() >= 7 ? tuple[6] : includes
2231 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002232
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002233 name = sources[0].split('/')[-1].split('.')[0]
2234 if type.startswith('timeout=')
2235 timeout = type.split('=')[1].to_int()
2236 type = ''
2237 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002238
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002239 if condition == '' or conf.get(condition, false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002240 exe = executable(
2241 name,
2242 sources,
2243 include_directories : incs,
2244 link_with : link_with,
2245 dependencies : dependencies,
2246 c_args : defs,
2247 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002248 install : install_tests,
2249 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002250
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002251 if type == 'manual'
2252 message('@0@ is a manual test'.format(name))
2253 elif type == 'unsafe' and want_tests != 'unsafe'
2254 message('@0@ is an unsafe test'.format(name))
2255 else
2256 test(name, exe,
2257 env : test_env,
2258 timeout : timeout)
2259 endif
2260 else
2261 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2262 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002263endforeach
2264
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002265test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002266 'test-libsystemd-sym',
2267 test_libsystemd_sym_c,
2268 include_directories : includes,
2269 link_with : [libsystemd],
2270 install : install_tests,
2271 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002272test('test-libsystemd-sym',
2273 test_libsystemd_sym)
2274
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002275test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002276 'test-libudev-sym',
2277 test_libudev_sym_c,
2278 include_directories : includes,
2279 c_args : ['-Wno-deprecated-declarations'],
2280 link_with : [libudev],
2281 install : install_tests,
2282 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002283test('test-libudev-sym',
2284 test_libudev_sym)
2285
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002286############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002287
2288make_directive_index_py = find_program('tools/make-directive-index.py')
2289make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002290xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002291hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002292
2293subdir('units')
2294subdir('sysctl.d')
2295subdir('sysusers.d')
2296subdir('tmpfiles.d')
2297subdir('rules')
2298subdir('hwdb')
2299subdir('network')
2300subdir('man')
2301subdir('shell-completion/bash')
2302subdir('shell-completion/zsh')
2303subdir('docs/sysvinit')
2304subdir('docs/var-log')
2305
2306# FIXME: figure out if the warning is true:
2307# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2308install_subdir('factory/etc',
2309 install_dir : factorydir)
2310
2311
2312install_data('xorg/50-systemd-user.sh',
2313 install_dir : xinitrcdir)
2314install_data('system-preset/90-systemd.preset',
2315 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002316install_data('modprobe.d/systemd.conf',
2317 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002318install_data('README',
2319 'NEWS',
2320 'CODING_STYLE',
2321 'DISTRO_PORTING',
2322 'ENVIRONMENT.md',
2323 'LICENSE.GPL2',
2324 'LICENSE.LGPL2.1',
2325 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2326 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002327
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002328meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2329meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2330
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002331############################################################
2332
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002333meson_check_help = find_program('tools/meson-check-help.sh')
2334
2335foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002336 name = exec.full_path().split('/')[-1]
2337 test('check-help-' + name,
2338 meson_check_help,
2339 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002340endforeach
2341
2342############################################################
2343
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002344if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002345 all_files = run_command(
2346 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002347 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002348 'ls-files',
2349 ':/*.[ch]'])
2350 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002351
userwithuide85a6902017-08-09 13:41:44 +00002352 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002353 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002354 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002355 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002356 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002357 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002358 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002359 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002360endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002361
2362if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002363 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002364 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002365 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002366 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002367endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002368
2369if git.found()
2370 git_head = run_command(
2371 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002372 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002373 'rev-parse', 'HEAD']).stdout().strip()
2374 git_head_short = run_command(
2375 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002376 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002377 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2378
2379 run_target(
2380 'git-snapshot',
2381 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002382 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002383 git_head_short),
2384 '--prefix', 'systemd-@0@/'.format(git_head),
2385 'HEAD'])
2386endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002387
2388############################################################
2389
2390status = [
2391 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2392
2393 'prefix: @0@'.format(prefixdir),
2394 'rootprefix: @0@'.format(rootprefixdir),
2395 'sysconf dir: @0@'.format(sysconfdir),
2396 'includedir: @0@'.format(includedir),
2397 'lib dir: @0@'.format(libdir),
2398 'rootlib dir: @0@'.format(rootlibdir),
2399 'SysV init scripts: @0@'.format(sysvinit_path),
2400 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2401 'PAM modules dir: @0@'.format(pamlibdir),
2402 'PAM configuration dir: @0@'.format(pamconfdir),
2403 'RPM macros dir: @0@'.format(rpmmacrosdir),
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002404 'modprobe.d dir: @0@'.format(modprobedir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002405 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2406 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2407 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2408 'bash completions dir: @0@'.format(bashcompletiondir),
2409 'zsh completions dir: @0@'.format(zshcompletiondir),
2410 'extra start script: @0@'.format(get_option('rc-local')),
2411 'extra stop script: @0@'.format(get_option('halt-local')),
2412 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2413 get_option('debug-tty')),
2414 'TTY GID: @0@'.format(tty_gid),
2415 'maximum system UID: @0@'.format(system_uid_max),
2416 'maximum system GID: @0@'.format(system_gid_max),
2417 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2418 'certificate root: @0@'.format(get_option('certificate-root')),
2419 'support URL: @0@'.format(support_url),
2420 'nobody user name: @0@'.format(get_option('nobody-user')),
2421 'nobody group name: @0@'.format(get_option('nobody-group')),
2422 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002423 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002424
2425 'default DNSSEC mode: @0@'.format(default_dnssec),
2426 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2427 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2428
2429alt_dns_servers = '\n '.join(dns_servers.split(' '))
2430alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2431status += [
2432 'default DNS servers: @0@'.format(alt_dns_servers),
2433 'default NTP servers: @0@'.format(alt_ntp_servers)]
2434
2435alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2436 '@@0@'.format(time_epoch)).stdout().strip()
2437status += [
2438 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2439
2440# TODO:
2441# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2442# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2443# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2444
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002445if conf.get('ENABLE_EFI', false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002446 status += [
2447 'efi arch: @0@'.format(efi_arch)]
2448
2449 if have_gnu_efi
2450 status += [
2451 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2452 'EFI CC @0@'.format(efi_cc),
2453 'EFI libdir: @0@'.format(efi_libdir),
2454 'EFI ldsdir: @0@'.format(efi_ldsdir),
2455 'EFI includedir: @0@'.format(efi_incdir)]
2456 endif
2457endif
2458
2459found = []
2460missing = []
2461
2462foreach tuple : [
2463 ['libcryptsetup'],
2464 ['PAM'],
2465 ['AUDIT'],
2466 ['IMA'],
2467 ['AppArmor'],
2468 ['SELinux'],
2469 ['SECCOMP'],
2470 ['SMACK'],
2471 ['zlib'],
2472 ['xz'],
2473 ['lz4'],
2474 ['bzip2'],
2475 ['ACL'],
2476 ['gcrypt'],
2477 ['qrencode'],
2478 ['microhttpd'],
2479 ['gnutls'],
2480 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002481 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002482 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002483 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002484 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002485 ['libiptc'],
2486 ['elfutils'],
2487 ['binfmt'],
2488 ['vconsole'],
2489 ['quotacheck'],
2490 ['tmpfiles'],
2491 ['environment.d'],
2492 ['sysusers'],
2493 ['firstboot'],
2494 ['randomseed'],
2495 ['backlight'],
2496 ['rfkill'],
2497 ['logind'],
2498 ['machined'],
2499 ['importd'],
2500 ['hostnamed'],
2501 ['timedated'],
2502 ['timesyncd'],
2503 ['localed'],
2504 ['networkd'],
2505 ['resolved'],
2506 ['coredump'],
2507 ['polkit'],
2508 ['legacy pkla', install_polkit_pkla],
2509 ['efi'],
2510 ['gnu-efi', have_gnu_efi],
2511 ['kmod'],
2512 ['xkbcommon'],
2513 ['blkid'],
2514 ['dbus'],
2515 ['glib'],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002516 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002517 ['hwdb'],
2518 ['tpm'],
2519 ['man pages', want_man],
2520 ['html pages', want_html],
2521 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002522 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002523 ['SysV compat'],
2524 ['utmp'],
2525 ['ldconfig'],
2526 ['hibernate'],
2527 ['adm group', get_option('adm-group')],
2528 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002529 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002530 ['debug hashmap'],
2531 ['debug mmap cache'],
2532]
2533
2534 cond = tuple.get(1, '')
2535 if cond == ''
2536 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2537 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002538 cond = conf.get(ident1, false) or conf.get(ident2, false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002539 endif
2540 if cond
2541 found += [tuple[0]]
2542 else
2543 missing += [tuple[0]]
2544 endif
2545endforeach
2546
2547status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002548 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002549 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002550 '',
2551 'disabled features: @0@'.format(', '.join(missing)),
2552 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002553message('\n '.join(status))