blob: 70f40076e68988388be9cc1e7ee7d2d54a0858ad [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001project('systemd', 'c',
Lennart Poettering63950422017-09-28 11:29:52 +02002 version : '235',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04003 license : 'LGPLv2+',
4 default_options: [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04005 'c_std=gnu99',
6 'prefix=/usr',
7 'sysconfdir=/etc',
8 'localstatedir=/var',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04009 ],
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -040010 meson_version : '>= 0.40',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040011 )
12
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>'''],
Daniel Mack71e52002016-10-18 17:57:10 +0200446 ['bpf', '''#include <sys/syscall.h>
447 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400448 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400449]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400450
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400451 have = cc.has_function(ident[0], prefix : ident[1])
452 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400453endforeach
454
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400455if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400456 conf.set('USE_SYS_RANDOM_H', true)
457 conf.set10('HAVE_DECL_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400458else
459 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
460 conf.set10('HAVE_DECL_GETRANDOM', have)
461endif
462
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400463#####################################################################
464
465sed = find_program('sed')
466grep = find_program('grep')
467awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400468m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400469stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400470git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400471
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400472meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400473mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400474test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
475splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400476
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400477# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
478# /usr/sbin, /sbin, and fall back to the default from middle column.
479progs = [['telinit', '/lib/sysvinit/telinit'],
480 ['quotaon', '/usr/sbin/quotaon' ],
481 ['quotacheck', '/usr/sbin/quotacheck' ],
482 ['kill', '/usr/bin/kill' ],
483 ['kmod', '/usr/bin/kmod' ],
484 ['kexec', '/usr/sbin/kexec' ],
485 ['sulogin', '/usr/sbin/sulogin' ],
486 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
487 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
488 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
489 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
490 ]
491foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400492 path = get_option(prog[0] + '-path')
493 if path != ''
494 message('Using @1@ for @0@'.format(prog[0], path))
495 else
496 exe = find_program(prog[0],
497 '/usr/sbin/' + prog[0],
498 '/sbin/' + prog[0],
499 required: false)
500 path = exe.found() ? exe.path() : prog[1]
501 endif
502 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
503 conf.set_quoted(name, path)
504 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400505endforeach
506
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400507if run_command('ln', '--relative', '--help').returncode() != 0
508 error('ln does not support --relative')
509endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400510
511############################################################
512
513gperf = find_program('gperf')
514
515gperf_test_format = '''
516#include <string.h>
517const char * in_word_set(const char *, @0@);
518@1@
519'''
520gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
521gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
522gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
523if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400524 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400525else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400526 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
527 if cc.compiles(gperf_test)
528 gperf_len_type = 'unsigned'
529 else
530 error('unable to determine gperf len type')
531 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400532endif
533message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400534conf.set('GPERF_LEN_TYPE', gperf_len_type,
535 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400536
537############################################################
538
539if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400540 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400541endif
542foreach header : ['linux/btrfs.h',
543 'linux/memfd.h',
544 'linux/vm_sockets.h',
545 'valgrind/memcheck.h',
546 'valgrind/valgrind.h',
547 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400548
549 conf.set('HAVE_' + header.underscorify().to_upper(),
550 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400551endforeach
552
553############################################################
554
555conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400556conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
557gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400558
559default_hierarchy = get_option('default-hierarchy')
560conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
561 description : 'default cgroup hierarchy as string')
562if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400563 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400564elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400565 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400566else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400567 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400568endif
569
570time_epoch = get_option('time-epoch')
571if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400572 NEWS = files('NEWS')
573 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400574endif
575time_epoch = time_epoch.to_int()
576conf.set('TIME_EPOCH', time_epoch)
577
578system_uid_max = get_option('system-uid-max')
579if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400580 system_uid_max = run_command(
581 awk,
582 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
583 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400584endif
585system_uid_max = system_uid_max.to_int()
586conf.set('SYSTEM_UID_MAX', system_uid_max)
587substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400588message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400589
590conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
591conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
592
593system_gid_max = get_option('system-gid-max')
594if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400595 system_gid_max = run_command(
596 awk,
597 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
598 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400599endif
600system_gid_max = system_gid_max.to_int()
601conf.set('SYSTEM_GID_MAX', system_gid_max)
602substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400603message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400604
605tty_gid = get_option('tty-gid')
606conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400607substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400608
609if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400610 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400611endif
612
613if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400614 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400615endif
616
617substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
618
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400619kill_user_processes = get_option('default-kill-user-processes')
620conf.set10('KILL_USER_PROCESSES', kill_user_processes)
621substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400622
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400623dns_servers = get_option('dns-servers')
624conf.set_quoted('DNS_SERVERS', dns_servers)
625substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400626
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400627ntp_servers = get_option('ntp-servers')
628conf.set_quoted('NTP_SERVERS', ntp_servers)
629substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400630
631conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
632
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400633substs.set('SUSHELL', get_option('debug-shell'))
634substs.set('DEBUGTTY', get_option('debug-tty'))
635
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400636debug = get_option('debug')
637if debug != ''
638 foreach name : debug.split(',')
639 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400640 conf.set('ENABLE_DEBUG_HASHMAP', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400641 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400642 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400643 else
644 message('unknown debug option "@0@", ignoring'.format(name))
645 endif
646 endforeach
647endif
648
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400649#####################################################################
650
651threads = dependency('threads')
652librt = cc.find_library('rt')
653libm = cc.find_library('m')
654libdl = cc.find_library('dl')
655libcrypt = cc.find_library('crypt')
656
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400657libcap = dependency('libcap', required : false)
658if not libcap.found()
659 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
660 libcap = cc.find_library('cap')
661endif
662
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400663libmount = dependency('mount',
Zbigniew Jędrzejewski-Szmekd6e80962017-09-15 14:47:57 +0200664 version : '>= 2.30')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400665
666want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400667if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400668 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400669 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400670 required : want_seccomp == 'true')
671 if libseccomp.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400672 conf.set('HAVE_SECCOMP', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400673 m4_defines += ['-DHAVE_SECCOMP']
674 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400675else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400676 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400677endif
678
679want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400680if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400681 libselinux = dependency('libselinux',
682 version : '>= 2.1.9',
683 required : want_selinux == 'true')
684 if libselinux.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400685 conf.set('HAVE_SELINUX', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400686 m4_defines += ['-DHAVE_SELINUX']
687 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400688else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400689 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400690endif
691
692want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400693if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400694 libapparmor = dependency('libapparmor',
695 required : want_apparmor == 'true')
696 if libapparmor.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400697 conf.set('HAVE_APPARMOR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400698 m4_defines += ['-DHAVE_APPARMOR']
699 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400700else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400701 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400702endif
703
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400704smack_run_label = get_option('smack-run-label')
705if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400706 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
707 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400708endif
709
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400710want_polkit = get_option('polkit')
711install_polkit = false
712install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400713if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400714 conf.set('ENABLE_POLKIT', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400715 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400716
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400717 libpolkit = dependency('polkit-gobject-1',
718 required : false)
719 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
720 message('Old polkit detected, will install pkla files')
721 install_polkit_pkla = true
722 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400723endif
724
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400725want_acl = get_option('acl')
726if want_acl != 'false'
727 libacl = cc.find_library('acl', required : want_acl == 'true')
728 if libacl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400729 conf.set('HAVE_ACL', true)
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400730 m4_defines += ['-DHAVE_ACL']
731 endif
732else
733 libacl = []
734endif
735
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400736want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400737if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400738 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400739 conf.set('HAVE_AUDIT', libaudit.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400740else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400741 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400742endif
743
744want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400745if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400746 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400747 conf.set('HAVE_BLKID', libblkid.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400748else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400749 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400750endif
751
752want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400753if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400754 libkmod = dependency('libkmod',
755 version : '>= 15',
756 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400757 conf.set('HAVE_KMOD', libkmod.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400758else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400759 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400760endif
761
762want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400763if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400764 libpam = cc.find_library('pam', required : want_pam == 'true')
765 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
766 if libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400767 conf.set('HAVE_PAM', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400768 m4_defines += ['-DHAVE_PAM']
769 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400770else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400771 libpam = []
772 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400773endif
774
775want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400776if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400777 libmicrohttpd = dependency('libmicrohttpd',
778 version : '>= 0.9.33',
779 required : want_microhttpd == 'true')
780 if libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400781 conf.set('HAVE_MICROHTTPD', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400782 m4_defines += ['-DHAVE_MICROHTTPD']
783 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400784else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400785 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400786endif
787
788want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400789if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400790 libcryptsetup = dependency('libcryptsetup',
791 version : '>= 1.6.0',
792 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400793 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400794else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400795 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400796endif
797
798want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400799if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400800 libcurl = dependency('libcurl',
801 version : '>= 7.32.0',
802 required : want_libcurl == 'true')
803 if libcurl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400804 conf.set('HAVE_LIBCURL', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400805 m4_defines += ['-DHAVE_LIBCURL']
806 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400807else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400808 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400809endif
810
811want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400812want_libidn2 = get_option('libidn2')
813if want_libidn == 'true' and want_libidn2 == 'true'
814 error('libidn and libidn2 cannot be requested simultaneously')
815endif
816
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400817if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400818 libidn = dependency('libidn',
819 required : want_libidn == 'true')
820 if libidn.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400821 conf.set('HAVE_LIBIDN', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400822 m4_defines += ['-DHAVE_LIBIDN']
823 endif
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400824else
825 libidn = []
826endif
827if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
828 # libidn is used for both libidn and libidn2 objects
829 libidn = dependency('libidn2',
830 required : want_libidn2 == 'true')
831 if libidn.found()
832 conf.set('HAVE_LIBIDN2', true)
833 m4_defines += ['-DHAVE_LIBIDN2']
834 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400835endif
836
837want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400838if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400839 libiptc = dependency('libiptc',
840 required : want_libiptc == 'true')
841 if libiptc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400842 conf.set('HAVE_LIBIPTC', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400843 m4_defines += ['-DHAVE_LIBIPTC']
844 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400845else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400846 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400847endif
848
849want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400850if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400851 libqrencode = dependency('libqrencode',
852 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400853 conf.set('HAVE_QRENCODE', libqrencode.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400854else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400855 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400856endif
857
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400858want_gcrypt = get_option('gcrypt')
859if want_gcrypt != 'false'
860 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
861 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
862
863 have_deps = libgcrypt.found() and libgpg_error.found()
864 conf.set('HAVE_GCRYPT', have_deps)
865 if not have_deps
866 # link to neither of the libs if one is not found
867 libgcrypt = []
868 libgpg_error = []
869 endif
870else
871 libgcrypt = []
872 libgpg_error = []
873endif
874
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400875want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400876if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400877 libgnutls = dependency('gnutls',
878 version : '>= 3.1.4',
879 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400880 conf.set('HAVE_GNUTLS', libgnutls.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400881else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400882 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400883endif
884
885want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400886if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400887 libdw = dependency('libdw',
888 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400889 conf.set('HAVE_ELFUTILS', libdw.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400890else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400891 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400892endif
893
894want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400895if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400896 libz = dependency('zlib',
897 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400898 conf.set('HAVE_ZLIB', libz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400899else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400900 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400901endif
902
903want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400904if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400905 libbzip2 = cc.find_library('bz2',
906 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400907 conf.set('HAVE_BZIP2', libbzip2.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400908else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400909 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400910endif
911
912want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400913if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400914 libxz = dependency('liblzma',
915 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400916 conf.set('HAVE_XZ', libxz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400917else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400918 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400919endif
920
921want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400922if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400923 liblz4 = dependency('liblz4',
924 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400925 conf.set('HAVE_LZ4', liblz4.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400926else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400927 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400928endif
929
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400930want_xkbcommon = get_option('xkbcommon')
931if want_xkbcommon != 'false'
932 libxkbcommon = dependency('xkbcommon',
933 version : '>= 0.3.0',
934 required : want_xkbcommon == 'true')
935 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
936else
937 libxkbcommon = []
938endif
939
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400940want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400941if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400942 libglib = dependency('glib-2.0',
943 version : '>= 2.22.0',
944 required : want_glib == 'true')
945 libgobject = dependency('gobject-2.0',
946 version : '>= 2.22.0',
947 required : want_glib == 'true')
948 libgio = dependency('gio-2.0',
949 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400950 have = libglib.found() and libgobject.found() and libgio.found()
951 conf.set('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400952else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400953 libglib = []
954 libgobject = []
955 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400956endif
957
958want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400959if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400960 libdbus = dependency('dbus-1',
961 version : '>= 1.3.2',
962 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400963 conf.set('HAVE_DBUS', libdbus.found())
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400964else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400965 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400966endif
967
Yu Watanabe42303dc2017-06-18 05:22:32 +0900968default_dnssec = get_option('default-dnssec')
969if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
970 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
971 default_dnssec = 'no'
972endif
973conf.set('DEFAULT_DNSSEC_MODE',
974 'DNSSEC_' + default_dnssec.underscorify().to_upper())
975substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
976
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400977want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400978if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400979 have_deps = (conf.get('HAVE_LIBCURL', false) and
980 conf.get('HAVE_ZLIB', false) and
981 conf.get('HAVE_BZIP2', false) and
982 conf.get('HAVE_XZ', false) and
983 conf.get('HAVE_GCRYPT', false))
984 conf.set('ENABLE_IMPORTD', have_deps)
985 if want_importd == 'true' and not have_deps
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400986 error('importd support was requested, but dependencies are not available')
987 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400988endif
989
990want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400991if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400992 have_deps = [conf.get('HAVE_MICROHTTPD', false),
993 conf.get('HAVE_LIBCURL', false)]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400994 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
995 # it's possible to build one without the other. Complain only if
996 # support was explictly requested. The auxiliary files like sysusers
997 # config should be installed when any of the programs are built.
998 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
999 error('remote support was requested, but dependencies are not available')
1000 endif
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001001 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001002endif
1003
1004foreach pair : [['utmp', 'HAVE_UTMP'],
1005 ['hibernate', 'ENABLE_HIBERNATE'],
1006 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1007 ['binfmt', 'ENABLE_BINFMT'],
1008 ['coredump', 'ENABLE_COREDUMP'],
1009 ['resolve', 'ENABLE_RESOLVED'],
1010 ['logind', 'ENABLE_LOGIND'],
1011 ['hostnamed', 'ENABLE_HOSTNAMED'],
1012 ['localed', 'ENABLE_LOCALED'],
1013 ['machined', 'ENABLE_MACHINED'],
1014 ['networkd', 'ENABLE_NETWORKD'],
1015 ['timedated', 'ENABLE_TIMEDATED'],
1016 ['timesyncd', 'ENABLE_TIMESYNCD'],
1017 ['myhostname', 'HAVE_MYHOSTNAME'],
1018 ['firstboot', 'ENABLE_FIRSTBOOT'],
1019 ['randomseed', 'ENABLE_RANDOMSEED'],
1020 ['backlight', 'ENABLE_BACKLIGHT'],
1021 ['vconsole', 'ENABLE_VCONSOLE'],
1022 ['quotacheck', 'ENABLE_QUOTACHECK'],
1023 ['sysusers', 'ENABLE_SYSUSERS'],
1024 ['tmpfiles', 'ENABLE_TMPFILES'],
1025 ['hwdb', 'ENABLE_HWDB'],
1026 ['rfkill', 'ENABLE_RFKILL'],
1027 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001028 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek18b9ad12017-07-13 09:31:47 -04001029 ['tpm', 'ENABLE_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -04001030 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -04001031 ['smack', 'HAVE_SMACK'],
Franck Buib14e1b42017-05-09 14:02:37 +02001032 ['gshadow', 'ENABLE_GSHADOW'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04001033 ['idn', 'ENABLE_IDN'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001034 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001035 ]
1036
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001037 if get_option(pair[0])
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001038 conf.set(pair[1], true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001039 m4_defines += ['-D' + pair[1]]
1040 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001041endforeach
1042
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001043want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001044install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001045tests = []
1046
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001047conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1048
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001049#####################################################################
1050
1051if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001052 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001053
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001054 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001055 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001056 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001057 elif efi_arch == 'x86_64'
1058 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001059 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001060 elif efi_arch == 'arm'
1061 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001062 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001063 elif efi_arch == 'aarch64'
1064 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001065 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001066 else
1067 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001068 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001069 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001070
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001071 conf.set('ENABLE_EFI', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001072 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001073
1074 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001075endif
1076
1077#####################################################################
1078
1079config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001080 output : 'config.h',
1081 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001082
1083includes = include_directories('src/basic',
1084 'src/shared',
1085 'src/systemd',
1086 'src/journal',
1087 'src/resolve',
1088 'src/timesync',
1089 'src/login',
1090 'src/udev',
1091 'src/libudev',
1092 'src/core',
1093 'src/libsystemd/sd-bus',
1094 'src/libsystemd/sd-device',
1095 'src/libsystemd/sd-hwdb',
1096 'src/libsystemd/sd-id128',
1097 'src/libsystemd/sd-netlink',
1098 'src/libsystemd/sd-network',
1099 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001100 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001101 )
1102
1103add_project_arguments('-include', 'config.h', language : 'c')
1104
1105gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1106 'src/shared/gcrypt-util.c')
1107
1108subdir('po')
1109subdir('catalog')
1110subdir('src/systemd')
1111subdir('src/basic')
1112subdir('src/libsystemd')
1113subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001114subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001115subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001116
1117libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001118 'journal-core',
1119 libjournal_core_sources,
1120 journald_gperf_c,
1121 include_directories : includes,
1122 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001123
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001124libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001125libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001126 'systemd',
1127 libsystemd_internal_sources,
1128 journal_internal_sources,
Lennart Poettering43091722017-06-27 23:11:26 +02001129 version : '0.19.0',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001130 include_directories : includes,
1131 link_args : ['-shared',
1132 '-Wl,--version-script=' + libsystemd_sym_path],
1133 link_with : [libbasic],
1134 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001135 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001136 librt,
1137 libxz,
1138 liblz4],
1139 link_depends : libsystemd_sym,
1140 install : true,
1141 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001142
1143############################################################
1144
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001145# binaries that have --help and are intended for use by humans,
1146# usually, but not always, installed in /bin.
1147public_programs = []
1148
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001149subdir('src/libudev')
1150subdir('src/shared')
1151subdir('src/core')
1152subdir('src/udev')
1153subdir('src/network')
1154
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001155subdir('src/analyze')
1156subdir('src/journal-remote')
1157subdir('src/coredump')
1158subdir('src/hostname')
1159subdir('src/import')
1160subdir('src/kernel-install')
1161subdir('src/locale')
1162subdir('src/machine')
1163subdir('src/nspawn')
1164subdir('src/resolve')
1165subdir('src/timedate')
1166subdir('src/timesync')
1167subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001168subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001169subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001170
1171subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001172subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001173
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001174############################################################
1175
1176# only static linking apart from libdl, to make sure that the
1177# module is linked to all libraries that it uses.
1178test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001179 'test-dlopen',
1180 test_dlopen_c,
1181 include_directories : includes,
1182 link_with : [libbasic],
1183 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001184
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001185foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001186 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001187 ['mymachines', 'ENABLE_MACHINED'],
1188 ['resolve', 'ENABLE_RESOLVED']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001189
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001190 condition = tuple[1] == '' or conf.get(tuple[1], false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001191 if condition
1192 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001193
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001194 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1195 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001196
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001197 nss = shared_library(
1198 'nss_' + module,
1199 'src/nss-@0@/nss-@0@.c'.format(module),
1200 version : '2',
1201 include_directories : includes,
1202 link_args : ['-shared',
1203 '-Wl,--version-script=' + version_script_arg,
1204 '-Wl,--undefined'],
1205 link_with : [libsystemd_internal,
1206 libbasic],
1207 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001208 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001209 link_depends : sym,
1210 install : true,
1211 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001212
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001213 # We cannot use shared_module because it does not support version suffix.
1214 # Unfortunately shared_library insists on creating the symlink…
1215 meson.add_install_script('sh', '-c',
1216 'rm $DESTDIR@0@/libnss_@1@.so'
1217 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001218
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001219 test('dlopen-nss_' + module,
1220 test_dlopen,
1221 args : [nss.full_path()]) # path to dlopen must include a slash
1222 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001223endforeach
1224
1225############################################################
1226
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001227executable('systemd',
1228 systemd_sources,
1229 include_directories : includes,
1230 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001231 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001232 dependencies : [threads,
1233 librt,
1234 libseccomp,
1235 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001236 libmount,
1237 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001238 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001239 install : true,
1240 install_dir : rootlibexecdir)
1241
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001242exe = executable('systemd-analyze',
1243 systemd_analyze_sources,
1244 include_directories : includes,
1245 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001246 libshared],
1247 dependencies : [threads,
1248 librt,
1249 libseccomp,
1250 libselinux,
1251 libmount,
1252 libblkid],
1253 install_rpath : rootlibexecdir,
1254 install : true)
1255public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001256
1257executable('systemd-journald',
1258 systemd_journald_sources,
1259 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001260 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001261 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001262 dependencies : [threads,
1263 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001264 liblz4,
1265 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001266 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001267 install : true,
1268 install_dir : rootlibexecdir)
1269
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001270exe = executable('systemd-cat',
1271 systemd_cat_sources,
1272 include_directories : includes,
1273 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001274 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001275 dependencies : [threads],
1276 install_rpath : rootlibexecdir,
1277 install : true)
1278public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001279
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001280exe = executable('journalctl',
1281 journalctl_sources,
1282 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001283 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001284 dependencies : [threads,
1285 libqrencode,
1286 libxz,
1287 liblz4],
1288 install_rpath : rootlibexecdir,
1289 install : true,
1290 install_dir : rootbindir)
1291public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001292
1293executable('systemd-getty-generator',
1294 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001295 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001296 link_with : [libshared],
1297 install_rpath : rootlibexecdir,
1298 install : true,
1299 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001300
1301executable('systemd-debug-generator',
1302 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001303 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001304 link_with : [libshared],
1305 install_rpath : rootlibexecdir,
1306 install : true,
1307 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001308
1309executable('systemd-fstab-generator',
1310 'src/fstab-generator/fstab-generator.c',
1311 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001312 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001313 link_with : [libshared],
1314 install_rpath : rootlibexecdir,
1315 install : true,
1316 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001317
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001318if conf.get('ENABLE_ENVIRONMENT_D', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001319 executable('30-systemd-environment-d-generator',
1320 'src/environment-d-generator/environment-d-generator.c',
1321 include_directories : includes,
1322 link_with : [libshared],
1323 install_rpath : rootlibexecdir,
1324 install : true,
1325 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001326
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001327 meson.add_install_script(meson_make_symlink,
1328 join_paths(sysconfdir, 'environment'),
1329 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001330endif
1331
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001332if conf.get('ENABLE_HIBERNATE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001333 executable('systemd-hibernate-resume-generator',
1334 'src/hibernate-resume/hibernate-resume-generator.c',
1335 include_directories : includes,
1336 link_with : [libshared],
1337 install_rpath : rootlibexecdir,
1338 install : true,
1339 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001340
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001341 executable('systemd-hibernate-resume',
1342 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001343 include_directories : includes,
1344 link_with : [libshared],
1345 install_rpath : rootlibexecdir,
1346 install : true,
1347 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001348endif
1349
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001350if conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001351 executable('systemd-gpt-auto-generator',
1352 'src/gpt-auto-generator/gpt-auto-generator.c',
1353 'src/basic/blkid-util.h',
1354 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001355 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001356 dependencies : libblkid,
1357 install_rpath : rootlibexecdir,
1358 install : true,
1359 install_dir : systemgeneratordir)
1360
1361 exe = executable('systemd-dissect',
1362 'src/dissect/dissect.c',
1363 include_directories : includes,
1364 link_with : [libshared],
1365 install_rpath : rootlibexecdir,
1366 install : true,
1367 install_dir : rootlibexecdir)
1368 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001369endif
1370
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001371if conf.get('ENABLE_RESOLVED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001372 executable('systemd-resolved',
1373 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001374 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001375 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001376 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001377 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001378 libgcrypt,
1379 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001380 libm,
1381 libidn],
1382 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001383 install : true,
1384 install_dir : rootlibexecdir)
1385
1386 exe = executable('systemd-resolve',
1387 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001388 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001389 include_directories : includes,
1390 link_with : [libshared],
1391 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001392 libgcrypt,
1393 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001394 libm,
1395 libidn],
1396 install_rpath : rootlibexecdir,
1397 install : true)
1398 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001399endif
1400
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001401if conf.get('ENABLE_LOGIND', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001402 executable('systemd-logind',
1403 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001404 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001405 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001406 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001407 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001408 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001409 install_rpath : rootlibexecdir,
1410 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001411 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001412
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001413 exe = executable('loginctl',
1414 loginctl_sources,
1415 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001416 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001417 dependencies : [threads,
1418 liblz4,
1419 libxz],
1420 install_rpath : rootlibexecdir,
1421 install : true,
1422 install_dir : rootbindir)
1423 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001424
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001425 exe = executable('systemd-inhibit',
1426 'src/login/inhibit.c',
1427 include_directories : includes,
1428 link_with : [libshared],
1429 install_rpath : rootlibexecdir,
1430 install : true,
1431 install_dir : rootbindir)
1432 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001433
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001434 if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001435 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1436 pam_systemd = shared_library(
1437 'pam_systemd',
1438 pam_systemd_c,
1439 name_prefix : '',
1440 include_directories : includes,
1441 link_args : ['-shared',
1442 '-Wl,--version-script=' + version_script_arg],
1443 link_with : [libsystemd_internal,
1444 libshared_static],
1445 dependencies : [threads,
1446 libpam,
1447 libpam_misc],
1448 link_depends : pam_systemd_sym,
1449 install : true,
1450 install_dir : pamlibdir)
1451
1452 test('dlopen-pam_systemd',
1453 test_dlopen,
1454 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1455 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001456endif
1457
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001458if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001459 executable('systemd-user-sessions',
1460 'src/user-sessions/user-sessions.c',
1461 include_directories : includes,
1462 link_with : [libshared],
1463 install_rpath : rootlibexecdir,
1464 install : true,
1465 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001466endif
1467
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001468if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001469 exe = executable('bootctl',
1470 'src/boot/bootctl.c',
1471 include_directories : includes,
1472 link_with : [libshared],
1473 dependencies : [libblkid],
1474 install_rpath : rootlibexecdir,
1475 install : true)
1476 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001477endif
1478
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001479exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1480 include_directories : includes,
1481 link_with : [libshared],
1482 dependencies : [threads],
1483 install_rpath : rootlibexecdir,
1484 install : true)
1485public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001486
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001487exe = executable('systemctl', 'src/systemctl/systemctl.c',
1488 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001489 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001490 dependencies : [threads,
1491 libcap,
1492 libselinux,
1493 libxz,
1494 liblz4],
1495 install_rpath : rootlibexecdir,
1496 install : true,
1497 install_dir : rootbindir)
1498public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001499
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001500if conf.get('ENABLE_BACKLIGHT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001501 executable('systemd-backlight',
1502 'src/backlight/backlight.c',
1503 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001504 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001505 install_rpath : rootlibexecdir,
1506 install : true,
1507 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001508endif
1509
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001510if conf.get('ENABLE_RFKILL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001511 executable('systemd-rfkill',
1512 'src/rfkill/rfkill.c',
1513 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001514 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001515 install_rpath : rootlibexecdir,
1516 install : true,
1517 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001518endif
1519
1520executable('systemd-system-update-generator',
1521 'src/system-update-generator/system-update-generator.c',
1522 include_directories : includes,
1523 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001524 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001525 install : true,
1526 install_dir : systemgeneratordir)
1527
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001528if conf.get('HAVE_LIBCRYPTSETUP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001529 executable('systemd-cryptsetup',
1530 'src/cryptsetup/cryptsetup.c',
1531 include_directories : includes,
1532 link_with : [libshared],
1533 dependencies : [libcryptsetup],
1534 install_rpath : rootlibexecdir,
1535 install : true,
1536 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001537
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001538 executable('systemd-cryptsetup-generator',
1539 'src/cryptsetup/cryptsetup-generator.c',
1540 include_directories : includes,
1541 link_with : [libshared],
1542 dependencies : [libcryptsetup],
1543 install_rpath : rootlibexecdir,
1544 install : true,
1545 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001546
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001547 executable('systemd-veritysetup',
1548 'src/veritysetup/veritysetup.c',
1549 include_directories : includes,
1550 link_with : [libshared],
1551 dependencies : [libcryptsetup],
1552 install_rpath : rootlibexecdir,
1553 install : true,
1554 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001555
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001556 executable('systemd-veritysetup-generator',
1557 'src/veritysetup/veritysetup-generator.c',
1558 include_directories : includes,
1559 link_with : [libshared],
1560 dependencies : [libcryptsetup],
1561 install_rpath : rootlibexecdir,
1562 install : true,
1563 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001564endif
1565
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001566if conf.get('HAVE_SYSV_COMPAT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001567 executable('systemd-sysv-generator',
1568 'src/sysv-generator/sysv-generator.c',
1569 include_directories : includes,
1570 link_with : [libshared],
1571 install_rpath : rootlibexecdir,
1572 install : true,
1573 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001574
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001575 executable('systemd-rc-local-generator',
1576 'src/rc-local-generator/rc-local-generator.c',
1577 include_directories : includes,
1578 link_with : [libshared],
1579 install_rpath : rootlibexecdir,
1580 install : true,
1581 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001582endif
1583
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001584if conf.get('ENABLE_HOSTNAMED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001585 executable('systemd-hostnamed',
1586 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001587 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001588 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001589 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001590 install : true,
1591 install_dir : rootlibexecdir)
1592
1593 exe = executable('hostnamectl',
1594 'src/hostname/hostnamectl.c',
1595 include_directories : includes,
1596 link_with : [libshared],
1597 install_rpath : rootlibexecdir,
1598 install : true)
1599 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001600endif
1601
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001602if conf.get('ENABLE_LOCALED', false)
1603 if conf.get('HAVE_XKBCOMMON', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001604 # logind will load libxkbcommon.so dynamically on its own
1605 deps = [libdl]
1606 else
1607 deps = []
1608 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001609
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001610 executable('systemd-localed',
1611 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001612 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001613 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001614 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001615 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001616 install : true,
1617 install_dir : rootlibexecdir)
1618
1619 exe = executable('localectl',
1620 localectl_sources,
1621 include_directories : includes,
1622 link_with : [libshared],
1623 install_rpath : rootlibexecdir,
1624 install : true)
1625 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001626endif
1627
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001628if conf.get('ENABLE_TIMEDATED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001629 executable('systemd-timedated',
1630 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001631 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001632 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001633 install_rpath : rootlibexecdir,
1634 install : true,
1635 install_dir : rootlibexecdir)
1636
1637 exe = executable('timedatectl',
1638 'src/timedate/timedatectl.c',
1639 include_directories : includes,
1640 install_rpath : rootlibexecdir,
1641 link_with : [libshared],
1642 install : true)
1643 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001644endif
1645
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001646if conf.get('ENABLE_TIMESYNCD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001647 executable('systemd-timesyncd',
1648 systemd_timesyncd_sources,
1649 include_directories : includes,
1650 link_with : [libshared],
1651 dependencies : [threads,
1652 libm],
1653 install_rpath : rootlibexecdir,
1654 install : true,
1655 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001656endif
1657
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001658if conf.get('ENABLE_MACHINED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001659 executable('systemd-machined',
1660 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001661 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001662 link_with : [libmachine_core,
1663 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001664 install_rpath : rootlibexecdir,
1665 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001666 install_dir : rootlibexecdir)
1667
1668 exe = executable('machinectl',
1669 'src/machine/machinectl.c',
1670 include_directories : includes,
1671 link_with : [libshared],
1672 dependencies : [threads,
1673 libxz,
1674 liblz4],
1675 install_rpath : rootlibexecdir,
1676 install : true,
1677 install_dir : rootbindir)
1678 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001679endif
1680
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001681if conf.get('ENABLE_IMPORTD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001682 executable('systemd-importd',
1683 systemd_importd_sources,
1684 include_directories : includes,
1685 link_with : [libshared],
1686 dependencies : [threads],
1687 install_rpath : rootlibexecdir,
1688 install : true,
1689 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001690
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001691 systemd_pull = executable('systemd-pull',
1692 systemd_pull_sources,
1693 include_directories : includes,
1694 link_with : [libshared],
1695 dependencies : [libcurl,
1696 libz,
1697 libbzip2,
1698 libxz,
1699 libgcrypt],
1700 install_rpath : rootlibexecdir,
1701 install : true,
1702 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001703
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001704 systemd_import = executable('systemd-import',
1705 systemd_import_sources,
1706 include_directories : includes,
1707 link_with : [libshared],
1708 dependencies : [libcurl,
1709 libz,
1710 libbzip2,
1711 libxz],
1712 install_rpath : rootlibexecdir,
1713 install : true,
1714 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001715
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001716 systemd_export = executable('systemd-export',
1717 systemd_export_sources,
1718 include_directories : includes,
1719 link_with : [libshared],
1720 dependencies : [libcurl,
1721 libz,
1722 libbzip2,
1723 libxz],
1724 install_rpath : rootlibexecdir,
1725 install : true,
1726 install_dir : rootlibexecdir)
1727 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001728endif
1729
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001730if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001731 exe = executable('systemd-journal-upload',
1732 systemd_journal_upload_sources,
1733 include_directories : includes,
1734 link_with : [libshared],
1735 dependencies : [threads,
1736 libcurl,
1737 libgnutls,
1738 libxz,
1739 liblz4],
1740 install_rpath : rootlibexecdir,
1741 install : true,
1742 install_dir : rootlibexecdir)
1743 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001744endif
1745
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001746if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001747 s_j_remote = executable('systemd-journal-remote',
1748 systemd_journal_remote_sources,
1749 include_directories : includes,
1750 link_with : [libshared],
1751 dependencies : [threads,
1752 libmicrohttpd,
1753 libgnutls,
1754 libxz,
1755 liblz4],
1756 install_rpath : rootlibexecdir,
1757 install : true,
1758 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001759
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001760 s_j_gatewayd = executable('systemd-journal-gatewayd',
1761 systemd_journal_gatewayd_sources,
1762 include_directories : includes,
1763 link_with : [libshared],
1764 dependencies : [threads,
1765 libmicrohttpd,
1766 libgnutls,
1767 libxz,
1768 liblz4],
1769 install_rpath : rootlibexecdir,
1770 install : true,
1771 install_dir : rootlibexecdir)
1772 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001773endif
1774
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001775if conf.get('ENABLE_COREDUMP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001776 executable('systemd-coredump',
1777 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001778 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001779 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001780 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001781 libacl,
1782 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001783 libxz,
1784 liblz4],
1785 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001786 install : true,
1787 install_dir : rootlibexecdir)
1788
1789 exe = executable('coredumpctl',
1790 coredumpctl_sources,
1791 include_directories : includes,
1792 link_with : [libshared],
1793 dependencies : [threads,
1794 libxz,
1795 liblz4],
1796 install_rpath : rootlibexecdir,
1797 install : true)
1798 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001799endif
1800
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001801if conf.get('ENABLE_BINFMT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001802 exe = executable('systemd-binfmt',
1803 'src/binfmt/binfmt.c',
1804 include_directories : includes,
1805 link_with : [libshared],
1806 install_rpath : rootlibexecdir,
1807 install : true,
1808 install_dir : rootlibexecdir)
1809 public_programs += [exe]
1810
1811 meson.add_install_script('sh', '-c',
1812 mkdir_p.format(binfmtdir))
1813 meson.add_install_script('sh', '-c',
1814 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1815endif
1816
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001817if conf.get('ENABLE_VCONSOLE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001818 executable('systemd-vconsole-setup',
1819 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001820 include_directories : includes,
1821 link_with : [libshared],
1822 install_rpath : rootlibexecdir,
1823 install : true,
1824 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001825endif
1826
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001827if conf.get('ENABLE_RANDOMSEED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001828 executable('systemd-random-seed',
1829 'src/random-seed/random-seed.c',
1830 include_directories : includes,
1831 link_with : [libshared],
1832 install_rpath : rootlibexecdir,
1833 install : true,
1834 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001835endif
1836
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001837if conf.get('ENABLE_FIRSTBOOT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001838 executable('systemd-firstboot',
1839 'src/firstboot/firstboot.c',
1840 include_directories : includes,
1841 link_with : [libshared],
1842 dependencies : [libcrypt],
1843 install_rpath : rootlibexecdir,
1844 install : true,
1845 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001846endif
1847
1848executable('systemd-remount-fs',
1849 'src/remount-fs/remount-fs.c',
1850 'src/core/mount-setup.c',
1851 'src/core/mount-setup.h',
1852 include_directories : includes,
1853 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001854 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001855 install : true,
1856 install_dir : rootlibexecdir)
1857
1858executable('systemd-machine-id-setup',
1859 'src/machine-id-setup/machine-id-setup-main.c',
1860 'src/core/machine-id-setup.c',
1861 'src/core/machine-id-setup.h',
1862 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001863 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001864 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001865 install : true,
1866 install_dir : rootbindir)
1867
1868executable('systemd-fsck',
1869 'src/fsck/fsck.c',
1870 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001871 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001872 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001873 install : true,
1874 install_dir : rootlibexecdir)
1875
1876executable('systemd-sleep',
1877 'src/sleep/sleep.c',
1878 include_directories : includes,
1879 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001880 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001881 install : true,
1882 install_dir : rootlibexecdir)
1883
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001884exe = executable('systemd-sysctl',
1885 'src/sysctl/sysctl.c',
1886 include_directories : includes,
1887 link_with : [libshared],
1888 install_rpath : rootlibexecdir,
1889 install : true,
1890 install_dir : rootlibexecdir)
1891public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001892
1893executable('systemd-ac-power',
1894 'src/ac-power/ac-power.c',
1895 include_directories : includes,
1896 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001897 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001898 install : true,
1899 install_dir : rootlibexecdir)
1900
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001901exe = executable('systemd-detect-virt',
1902 'src/detect-virt/detect-virt.c',
1903 include_directories : includes,
1904 link_with : [libshared],
1905 install_rpath : rootlibexecdir,
1906 install : true)
1907public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001908
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001909exe = executable('systemd-delta',
1910 'src/delta/delta.c',
1911 include_directories : includes,
1912 link_with : [libshared],
1913 install_rpath : rootlibexecdir,
1914 install : true)
1915public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001916
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001917exe = executable('systemd-escape',
1918 'src/escape/escape.c',
1919 include_directories : includes,
1920 link_with : [libshared],
1921 install_rpath : rootlibexecdir,
1922 install : true,
1923 install_dir : rootbindir)
1924public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001925
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001926exe = executable('systemd-notify',
1927 'src/notify/notify.c',
1928 include_directories : includes,
1929 link_with : [libshared],
1930 install_rpath : rootlibexecdir,
1931 install : true,
1932 install_dir : rootbindir)
1933public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001934
1935executable('systemd-volatile-root',
1936 'src/volatile-root/volatile-root.c',
1937 include_directories : includes,
1938 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001939 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001940 install : true,
1941 install_dir : rootlibexecdir)
1942
1943executable('systemd-cgroups-agent',
1944 'src/cgroups-agent/cgroups-agent.c',
1945 include_directories : includes,
1946 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001947 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001948 install : true,
1949 install_dir : rootlibexecdir)
1950
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001951exe = executable('systemd-path',
1952 'src/path/path.c',
1953 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001954 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001955 install_rpath : rootlibexecdir,
1956 install : true)
1957public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001958
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001959exe = executable('systemd-ask-password',
1960 'src/ask-password/ask-password.c',
1961 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001962 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001963 install_rpath : rootlibexecdir,
1964 install : true,
1965 install_dir : rootbindir)
1966public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001967
1968executable('systemd-reply-password',
1969 'src/reply-password/reply-password.c',
1970 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001971 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001972 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001973 install : true,
1974 install_dir : rootlibexecdir)
1975
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001976exe = executable('systemd-tty-ask-password-agent',
1977 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1978 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001979 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001980 install_rpath : rootlibexecdir,
1981 install : true,
1982 install_dir : rootbindir)
1983public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001984
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001985exe = executable('systemd-cgls',
1986 'src/cgls/cgls.c',
1987 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001988 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001989 install_rpath : rootlibexecdir,
1990 install : true)
1991public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001992
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001993exe = executable('systemd-cgtop',
1994 'src/cgtop/cgtop.c',
1995 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001996 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001997 install_rpath : rootlibexecdir,
1998 install : true)
1999public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002000
2001executable('systemd-initctl',
2002 'src/initctl/initctl.c',
2003 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002004 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002005 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002006 install : true,
2007 install_dir : rootlibexecdir)
2008
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002009exe = executable('systemd-mount',
2010 'src/mount/mount-tool.c',
2011 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002012 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002013 install_rpath : rootlibexecdir,
2014 install : true)
2015public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002016
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002017meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002018 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002019
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002020exe = executable('systemd-run',
2021 'src/run/run.c',
2022 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002023 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002024 install_rpath : rootlibexecdir,
2025 install : true)
2026public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002027
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002028exe = executable('systemd-stdio-bridge',
2029 'src/stdio-bridge/stdio-bridge.c',
2030 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002031 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002032 install_rpath : rootlibexecdir,
2033 install : true)
2034public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002035
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002036exe = executable('busctl',
2037 'src/busctl/busctl.c',
2038 'src/busctl/busctl-introspect.c',
2039 'src/busctl/busctl-introspect.h',
2040 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002041 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002042 install_rpath : rootlibexecdir,
2043 install : true)
2044public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002045
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002046if conf.get('ENABLE_SYSUSERS', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002047 exe = executable('systemd-sysusers',
2048 'src/sysusers/sysusers.c',
2049 include_directories : includes,
2050 link_with : [libshared],
2051 install_rpath : rootlibexecdir,
2052 install : true,
2053 install_dir : rootbindir)
2054 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002055endif
2056
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002057if conf.get('ENABLE_TMPFILES', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002058 exe = executable('systemd-tmpfiles',
2059 'src/tmpfiles/tmpfiles.c',
2060 include_directories : includes,
2061 link_with : [libshared],
2062 dependencies : [libacl],
2063 install_rpath : rootlibexecdir,
2064 install : true,
2065 install_dir : rootbindir)
2066 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002067endif
2068
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002069if conf.get('ENABLE_HWDB', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002070 exe = executable('systemd-hwdb',
2071 'src/hwdb/hwdb.c',
2072 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2073 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002074 link_with : [libudev_internal],
2075 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002076 install : true,
2077 install_dir : rootbindir)
2078 public_programs += [exe]
2079endif
2080
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002081if conf.get('ENABLE_QUOTACHECK', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002082 executable('systemd-quotacheck',
2083 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002084 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002085 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002086 install_rpath : rootlibexecdir,
2087 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002088 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002089endif
2090
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002091exe = executable('systemd-socket-proxyd',
2092 'src/socket-proxy/socket-proxyd.c',
2093 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002094 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002095 dependencies : [threads],
2096 install_rpath : rootlibexecdir,
2097 install : true,
2098 install_dir : rootlibexecdir)
2099public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002100
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002101exe = executable('systemd-udevd',
2102 systemd_udevd_sources,
2103 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002104 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002105 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002106 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002107 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002108 dependencies : [threads,
2109 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002110 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002111 libacl,
2112 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002113 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002114 install : true,
2115 install_dir : rootlibexecdir)
2116public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002117
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002118exe = executable('udevadm',
2119 udevadm_sources,
2120 include_directories : includes,
2121 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002122 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002123 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002124 dependencies : [threads,
2125 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002126 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002127 libacl,
2128 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002129 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002130 install : true,
2131 install_dir : rootbindir)
2132public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002133
2134executable('systemd-shutdown',
2135 systemd_shutdown_sources,
2136 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002137 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002138 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002139 install : true,
2140 install_dir : rootlibexecdir)
2141
2142executable('systemd-update-done',
2143 'src/update-done/update-done.c',
2144 include_directories : includes,
2145 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002146 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002147 install : true,
2148 install_dir : rootlibexecdir)
2149
2150executable('systemd-update-utmp',
2151 'src/update-utmp/update-utmp.c',
2152 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002153 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002154 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002155 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002156 install : true,
2157 install_dir : rootlibexecdir)
2158
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002159if conf.get('HAVE_KMOD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002160 executable('systemd-modules-load',
2161 'src/modules-load/modules-load.c',
2162 include_directories : includes,
2163 link_with : [libshared],
2164 dependencies : [libkmod],
2165 install_rpath : rootlibexecdir,
2166 install : true,
2167 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002168
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002169 meson.add_install_script('sh', '-c',
2170 mkdir_p.format(modulesloaddir))
2171 meson.add_install_script('sh', '-c',
2172 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002173endif
2174
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002175exe = executable('systemd-nspawn',
2176 systemd_nspawn_sources,
2177 'src/core/mount-setup.c', # FIXME: use a variable?
2178 'src/core/mount-setup.h',
2179 'src/core/loopback-setup.c',
2180 'src/core/loopback-setup.h',
2181 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002182 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002183 dependencies : [libacl,
2184 libblkid,
2185 libseccomp,
2186 libselinux],
2187 install_rpath : rootlibexecdir,
2188 install : true)
2189public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002190
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002191if conf.get('ENABLE_NETWORKD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002192 executable('systemd-networkd',
2193 systemd_networkd_sources,
2194 include_directories : includes,
2195 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002196 libsystemd_network,
2197 libudev_internal,
2198 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002199 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002200 install_rpath : rootlibexecdir,
2201 install : true,
2202 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002203
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002204 executable('systemd-networkd-wait-online',
2205 systemd_networkd_wait_online_sources,
2206 include_directories : includes,
2207 link_with : [libnetworkd_core,
2208 libshared],
2209 install_rpath : rootlibexecdir,
2210 install : true,
2211 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002212
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002213 exe = executable('networkctl',
2214 networkctl_sources,
2215 include_directories : includes,
2216 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002217 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002218 install_rpath : rootlibexecdir,
2219 install : true,
2220 install_dir : rootbindir)
2221 public_programs += [exe]
2222endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002223############################################################
2224
2225foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002226 sources = tuple[0]
2227 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2228 dependencies = tuple[2]
2229 condition = tuple.length() >= 4 ? tuple[3] : ''
2230 type = tuple.length() >= 5 ? tuple[4] : ''
2231 defs = tuple.length() >= 6 ? tuple[5] : []
2232 incs = tuple.length() >= 7 ? tuple[6] : includes
2233 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002234
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002235 name = sources[0].split('/')[-1].split('.')[0]
2236 if type.startswith('timeout=')
2237 timeout = type.split('=')[1].to_int()
2238 type = ''
2239 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002240
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002241 if condition == '' or conf.get(condition, false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002242 exe = executable(
2243 name,
2244 sources,
2245 include_directories : incs,
2246 link_with : link_with,
2247 dependencies : dependencies,
2248 c_args : defs,
2249 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002250 install : install_tests,
2251 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002252
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002253 if type == 'manual'
2254 message('@0@ is a manual test'.format(name))
2255 elif type == 'unsafe' and want_tests != 'unsafe'
2256 message('@0@ is an unsafe test'.format(name))
2257 else
2258 test(name, exe,
2259 env : test_env,
2260 timeout : timeout)
2261 endif
2262 else
2263 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2264 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002265endforeach
2266
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002267test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002268 'test-libsystemd-sym',
2269 test_libsystemd_sym_c,
2270 include_directories : includes,
2271 link_with : [libsystemd],
2272 install : install_tests,
2273 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002274test('test-libsystemd-sym',
2275 test_libsystemd_sym)
2276
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002277test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002278 'test-libudev-sym',
2279 test_libudev_sym_c,
2280 include_directories : includes,
2281 c_args : ['-Wno-deprecated-declarations'],
2282 link_with : [libudev],
2283 install : install_tests,
2284 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002285test('test-libudev-sym',
2286 test_libudev_sym)
2287
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002288############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002289
2290make_directive_index_py = find_program('tools/make-directive-index.py')
2291make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002292xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002293hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002294
2295subdir('units')
2296subdir('sysctl.d')
2297subdir('sysusers.d')
2298subdir('tmpfiles.d')
2299subdir('rules')
2300subdir('hwdb')
2301subdir('network')
2302subdir('man')
2303subdir('shell-completion/bash')
2304subdir('shell-completion/zsh')
2305subdir('docs/sysvinit')
2306subdir('docs/var-log')
2307
2308# FIXME: figure out if the warning is true:
2309# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2310install_subdir('factory/etc',
2311 install_dir : factorydir)
2312
2313
2314install_data('xorg/50-systemd-user.sh',
2315 install_dir : xinitrcdir)
2316install_data('system-preset/90-systemd.preset',
2317 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002318install_data('modprobe.d/systemd.conf',
2319 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002320install_data('README',
2321 'NEWS',
2322 'CODING_STYLE',
2323 'DISTRO_PORTING',
2324 'ENVIRONMENT.md',
2325 'LICENSE.GPL2',
2326 'LICENSE.LGPL2.1',
2327 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2328 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002329
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002330meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2331meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2332
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002333############################################################
2334
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002335meson_check_help = find_program('tools/meson-check-help.sh')
2336
2337foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002338 name = exec.full_path().split('/')[-1]
2339 test('check-help-' + name,
2340 meson_check_help,
2341 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002342endforeach
2343
2344############################################################
2345
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002346if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002347 all_files = run_command(
2348 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002349 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002350 'ls-files',
2351 ':/*.[ch]'])
2352 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002353
userwithuide85a6902017-08-09 13:41:44 +00002354 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002355 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002356 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002357 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002358 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002359 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002360 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002361 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002362endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002363
2364if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002365 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002366 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002367 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002368 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002369endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002370
2371if git.found()
2372 git_head = run_command(
2373 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002374 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002375 'rev-parse', 'HEAD']).stdout().strip()
2376 git_head_short = run_command(
2377 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002378 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002379 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2380
2381 run_target(
2382 'git-snapshot',
2383 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002384 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002385 git_head_short),
2386 '--prefix', 'systemd-@0@/'.format(git_head),
2387 'HEAD'])
2388endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002389
2390############################################################
2391
2392status = [
2393 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2394
2395 'prefix: @0@'.format(prefixdir),
2396 'rootprefix: @0@'.format(rootprefixdir),
2397 'sysconf dir: @0@'.format(sysconfdir),
2398 'includedir: @0@'.format(includedir),
2399 'lib dir: @0@'.format(libdir),
2400 'rootlib dir: @0@'.format(rootlibdir),
2401 'SysV init scripts: @0@'.format(sysvinit_path),
2402 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2403 'PAM modules dir: @0@'.format(pamlibdir),
2404 'PAM configuration dir: @0@'.format(pamconfdir),
2405 'RPM macros dir: @0@'.format(rpmmacrosdir),
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002406 'modprobe.d dir: @0@'.format(modprobedir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002407 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2408 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2409 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2410 'bash completions dir: @0@'.format(bashcompletiondir),
2411 'zsh completions dir: @0@'.format(zshcompletiondir),
2412 'extra start script: @0@'.format(get_option('rc-local')),
2413 'extra stop script: @0@'.format(get_option('halt-local')),
2414 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2415 get_option('debug-tty')),
2416 'TTY GID: @0@'.format(tty_gid),
2417 'maximum system UID: @0@'.format(system_uid_max),
2418 'maximum system GID: @0@'.format(system_gid_max),
2419 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2420 'certificate root: @0@'.format(get_option('certificate-root')),
2421 'support URL: @0@'.format(support_url),
2422 'nobody user name: @0@'.format(get_option('nobody-user')),
2423 'nobody group name: @0@'.format(get_option('nobody-group')),
2424 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002425 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002426
2427 'default DNSSEC mode: @0@'.format(default_dnssec),
2428 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2429 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2430
2431alt_dns_servers = '\n '.join(dns_servers.split(' '))
2432alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2433status += [
2434 'default DNS servers: @0@'.format(alt_dns_servers),
2435 'default NTP servers: @0@'.format(alt_ntp_servers)]
2436
2437alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2438 '@@0@'.format(time_epoch)).stdout().strip()
2439status += [
2440 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2441
2442# TODO:
2443# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2444# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2445# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2446
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002447if conf.get('ENABLE_EFI', false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002448 status += [
2449 'efi arch: @0@'.format(efi_arch)]
2450
2451 if have_gnu_efi
2452 status += [
2453 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2454 'EFI CC @0@'.format(efi_cc),
2455 'EFI libdir: @0@'.format(efi_libdir),
2456 'EFI ldsdir: @0@'.format(efi_ldsdir),
2457 'EFI includedir: @0@'.format(efi_incdir)]
2458 endif
2459endif
2460
2461found = []
2462missing = []
2463
2464foreach tuple : [
2465 ['libcryptsetup'],
2466 ['PAM'],
2467 ['AUDIT'],
2468 ['IMA'],
2469 ['AppArmor'],
2470 ['SELinux'],
2471 ['SECCOMP'],
2472 ['SMACK'],
2473 ['zlib'],
2474 ['xz'],
2475 ['lz4'],
2476 ['bzip2'],
2477 ['ACL'],
2478 ['gcrypt'],
2479 ['qrencode'],
2480 ['microhttpd'],
2481 ['gnutls'],
2482 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002483 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002484 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002485 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002486 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002487 ['libiptc'],
2488 ['elfutils'],
2489 ['binfmt'],
2490 ['vconsole'],
2491 ['quotacheck'],
2492 ['tmpfiles'],
2493 ['environment.d'],
2494 ['sysusers'],
2495 ['firstboot'],
2496 ['randomseed'],
2497 ['backlight'],
2498 ['rfkill'],
2499 ['logind'],
2500 ['machined'],
2501 ['importd'],
2502 ['hostnamed'],
2503 ['timedated'],
2504 ['timesyncd'],
2505 ['localed'],
2506 ['networkd'],
2507 ['resolved'],
2508 ['coredump'],
2509 ['polkit'],
2510 ['legacy pkla', install_polkit_pkla],
2511 ['efi'],
2512 ['gnu-efi', have_gnu_efi],
2513 ['kmod'],
2514 ['xkbcommon'],
2515 ['blkid'],
2516 ['dbus'],
2517 ['glib'],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002518 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002519 ['hwdb'],
2520 ['tpm'],
2521 ['man pages', want_man],
2522 ['html pages', want_html],
2523 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002524 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002525 ['SysV compat'],
2526 ['utmp'],
2527 ['ldconfig'],
2528 ['hibernate'],
2529 ['adm group', get_option('adm-group')],
2530 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002531 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002532 ['debug hashmap'],
2533 ['debug mmap cache'],
2534]
2535
2536 cond = tuple.get(1, '')
2537 if cond == ''
2538 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2539 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002540 cond = conf.get(ident1, false) or conf.get(ident2, false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002541 endif
2542 if cond
2543 found += [tuple[0]]
2544 else
2545 missing += [tuple[0]]
2546 endif
2547endforeach
2548
2549status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002550 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002551 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002552 '',
2553 'disabled features: @0@'.format(', '.join(missing)),
2554 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002555message('\n '.join(status))