blob: 4102bb7490b70313cb887dcc5b40b4cfdde78e5b [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001project('systemd', 'c',
Lennart Poettering43091722017-06-27 23:11:26 +02002 version : '234',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04003 license : 'LGPLv2+',
4 default_options: [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04005 'c_std=gnu99',
6 'prefix=/usr',
7 'sysconfdir=/etc',
8 'localstatedir=/var',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04009 ],
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -040010 meson_version : '>= 0.40',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040011 )
12
13# We need the same data in three different formats, ugh!
14# Also, for hysterical reasons, we use different variable
15# names, sometimes. Not all variables are included in every
16# set. Ugh, ugh, ugh!
17conf = configuration_data()
18conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
19conf.set_quoted('PACKAGE_VERSION', meson.project_version())
20
21substs = configuration_data()
22substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
23substs.set('PACKAGE_VERSION', meson.project_version())
24
25m4_defines = []
26
27#####################################################################
28
Zbigniew Jędrzejewski-Szmek003c8872017-07-24 04:41:45 -040029# Try to install the git pre-commit hook
30git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
31if git_hook.returncode() == 0
32 message(git_hook.stdout().strip())
33endif
34
35#####################################################################
36
Zbigniew Jędrzejewski-Szmekab916f22017-04-13 22:15:01 -040037rootprefixdir = get_option('rootprefix')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040038if get_option('split-usr')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040039 conf.set('HAVE_SPLIT_USR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040040 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040041else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040042 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040043endif
44
45sysvinit_path = get_option('sysvinit-path')
46sysvrcnd_path = get_option('sysvrcnd-path')
47if sysvinit_path != '' or sysvrcnd_path != ''
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040048 conf.set('HAVE_SYSV_COMPAT', true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040049 description : 'SysV init scripts and rcN.d links are supported')
50 m4_defines += ['-DHAVE_SYSV_COMPAT']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040051endif
52
53# join_paths ignore the preceding arguments if an absolute component is
54# encountered, so this should canonicalize various paths when they are
55# absolute or relative.
56prefixdir = get_option('prefix')
57if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040058 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040059endif
60bindir = join_paths(prefixdir, get_option('bindir'))
61libdir = join_paths(prefixdir, get_option('libdir'))
62sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
63includedir = join_paths(prefixdir, get_option('includedir'))
64datadir = join_paths(prefixdir, get_option('datadir'))
65localstatedir = join_paths('/', get_option('localstatedir'))
66
67rootbindir = join_paths(rootprefixdir, 'bin')
68rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
69
70rootlibdir = get_option('rootlibdir')
71if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040072 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040073endif
74
75# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040076pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
77pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
78polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
79polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
80polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
81varlogdir = join_paths(localstatedir, 'log')
82xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040083rpmmacrosdir = get_option('rpmmacrosdir')
Yu Watanabead6fc5b2017-08-03 21:01:38 +090084modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040085
86# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -040087pkgdatadir = join_paths(datadir, 'systemd')
88environmentdir = join_paths(prefixdir, 'lib/environment.d')
89pkgsysconfdir = join_paths(sysconfdir, 'systemd')
90userunitdir = join_paths(prefixdir, 'lib/systemd/user')
91userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
92tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
93sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
94sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
95binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
96modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
97networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
98pkgincludedir = join_paths(includedir, 'systemd')
99systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
100usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
101systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
102userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
103systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
104systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
105systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
106systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
107udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
108udevhomedir = udevlibexecdir
109udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
110udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
111catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
112kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
113factorydir = join_paths(datadir, 'factory')
114docdir = join_paths(datadir, 'doc/systemd')
115bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
116testsdir = join_paths(prefixdir, 'lib/systemd/tests')
117systemdstatedir = join_paths(localstatedir, 'lib/systemd')
118catalogstatedir = join_paths(systemdstatedir, 'catalog')
119randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400120
121dbuspolicydir = get_option('dbuspolicydir')
122if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400123 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400124endif
125
126dbussessionservicedir = get_option('dbussessionservicedir')
127if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400128 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400129endif
130
131dbussystemservicedir = get_option('dbussystemservicedir')
132if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400133 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400134endif
135
136pamlibdir = get_option('pamlibdir')
137if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400138 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400139endif
140
141pamconfdir = get_option('pamconfdir')
142if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400143 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400144endif
145
146conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400147conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400148conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
149conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
150conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400151conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
152conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400153conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400154conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
155conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400156conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
157conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
158conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
159conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
160conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
161conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
162conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
163conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
164conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400165conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400166conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400167conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
168conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400169conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
170conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
171conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
172conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
173conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
174conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400175conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
176conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400177conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400178conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400179conf.set_quoted('LIBDIR', libdir)
180conf.set_quoted('ROOTLIBDIR', rootlibdir)
181conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
182conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400183conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
184conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
185conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
186conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
187conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
188conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400189
190conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
191conf.set_quoted('ABS_SRC_DIR', meson.source_root())
192
193substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400194substs.set('exec_prefix', prefixdir)
195substs.set('libdir', libdir)
196substs.set('rootlibdir', rootlibdir)
197substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400198substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400199substs.set('bindir', bindir)
200substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400201substs.set('rootlibexecdir', rootlibexecdir)
202substs.set('systemunitdir', systemunitdir)
203substs.set('userunitdir', userunitdir)
204substs.set('systempresetdir', systempresetdir)
205substs.set('userpresetdir', userpresetdir)
206substs.set('udevhwdbdir', udevhwdbdir)
207substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400208substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400209substs.set('catalogdir', catalogdir)
210substs.set('tmpfilesdir', tmpfilesdir)
211substs.set('sysusersdir', sysusersdir)
212substs.set('sysctldir', sysctldir)
213substs.set('binfmtdir', binfmtdir)
214substs.set('modulesloaddir', modulesloaddir)
215substs.set('systemgeneratordir', systemgeneratordir)
216substs.set('usergeneratordir', usergeneratordir)
217substs.set('systemenvgeneratordir', systemenvgeneratordir)
218substs.set('userenvgeneratordir', userenvgeneratordir)
219substs.set('systemshutdowndir', systemshutdowndir)
220substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400221substs.set('VARLOGDIR', varlogdir)
222substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400223substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
224substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400225substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
226substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
227substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
228substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400229
230#####################################################################
231
232cc = meson.get_compiler('c')
233pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400234check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400235
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400236cxx = find_program('c++', required : false)
237if cxx.found()
238 # Used only for tests
239 add_languages('cpp')
240endif
241
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400242foreach arg : ['-Wextra',
243 '-Wundef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400244 '-Wlogical-op',
245 '-Wmissing-include-dirs',
246 '-Wold-style-definition',
247 '-Wpointer-arith',
248 '-Winit-self',
249 '-Wdeclaration-after-statement',
250 '-Wfloat-equal',
251 '-Wsuggest-attribute=noreturn',
252 '-Werror=missing-prototypes',
253 '-Werror=implicit-function-declaration',
254 '-Werror=missing-declarations',
255 '-Werror=return-type',
256 '-Werror=incompatible-pointer-types',
257 '-Werror=format=2',
258 '-Wstrict-prototypes',
259 '-Wredundant-decls',
260 '-Wmissing-noreturn',
261 '-Wshadow',
262 '-Wendif-labels',
263 '-Wstrict-aliasing=2',
264 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400265 '-Werror=overflow',
266 '-Wdate-time',
267 '-Wnested-externs',
268 '-ffast-math',
269 '-fno-common',
270 '-fdiagnostics-show-option',
271 '-fno-strict-aliasing',
272 '-fvisibility=hidden',
273 '-fstack-protector',
274 '-fstack-protector-strong',
275 '-fPIE',
276 '--param=ssp-buffer-size=4',
277 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400278 if cc.has_argument(arg)
279 add_project_arguments(arg, language : 'c')
280 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400281endforeach
282
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400283# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
284# arguments, just emits a warnings. So test for the "positive" version instead.
285foreach arg : ['unused-parameter',
286 'missing-field-initializers',
287 'unused-result',
288 'format-signedness']
289 if cc.has_argument('-W' + arg)
290 add_project_arguments('-Wno-' + arg, language : 'c')
291 endif
292endforeach
293
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400294if cc.compiles('
295 #include <time.h>
296 #include <inttypes.h>
297 typedef uint64_t usec_t;
298 usec_t now(clockid_t clock);
299 int main(void) {
300 struct timespec now;
301 return 0;
302 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400303', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400304 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400305endif
306
307if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400308 foreach arg : ['-Wno-typedef-redefinition',
309 '-Wno-gnu-variable-sized-type-not-at-end',
310 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400311 if cc.has_argument(arg,
312 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400313 add_project_arguments(arg, language : 'c')
314 endif
315 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400316endif
317
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400318link_test_c = files('tools/meson-link-test.c')
319
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400320# --as-needed and --no-undefined are provided by meson by default,
321# run mesonconf to see what is enabled
322foreach arg : ['-Wl,-z,relro',
323 '-Wl,-z,now',
324 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400325 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400326
327 have = run_command(check_compilation_sh,
328 cc.cmd_array(), '-x', 'c', arg,
329 '-include', link_test_c).returncode() == 0
330 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
331 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400332 add_project_link_arguments(arg, language : 'c')
333 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400334endforeach
335
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400336if get_option('buildtype') != 'debug'
337 foreach arg : ['-ffunction-sections',
338 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400339 if cc.has_argument(arg,
340 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400341 add_project_arguments(arg, language : 'c')
342 endif
343 endforeach
344
345 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400346 have = run_command(check_compilation_sh,
347 cc.cmd_array(), '-x', 'c', arg,
348 '-include', link_test_c).returncode() == 0
349 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
350 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400351 add_project_link_arguments(arg, language : 'c')
352 endif
353 endforeach
354endif
355
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400356cpp = ' '.join(cc.cmd_array()) + ' -E'
357
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400358#####################################################################
359# compilation result tests
360
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400361conf.set('_GNU_SOURCE', true)
362conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400363
364conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
365conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
366conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
367conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
368conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
369conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
370conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
371
372decl_headers = '''
373#include <uchar.h>
374#include <linux/ethtool.h>
375'''
376# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
377
378foreach decl : ['char16_t',
379 'char32_t',
380 'key_serial_t',
381 'struct ethtool_link_settings',
382 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400383
384 # We get -1 if the size cannot be determined
385 have = cc.sizeof(decl, prefix : decl_headers) > 0
386 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400387endforeach
388
389foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
390 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
391 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
392 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
393 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
394 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
395 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
396 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
397 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
398 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530399 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400400 # if_tunnel.h is buggy and cannot be included on its own
401 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
402 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
403 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
404 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
405 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
406 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
407 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
408 ['NDA_IFINDEX', 'linux/neighbour.h'],
409 ['IFA_FLAGS', 'linux/if_addr.h'],
410 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
411 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400412 prefix = decl.length() > 2 ? decl[2] : ''
413 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
414 conf.set10('HAVE_DECL_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400415endforeach
416
417skip = false
418foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400419 if not skip and cc.has_function(ident)
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400420 conf.set('HAVE_' + ident.to_upper(), true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400421 skip = true
422 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400423endforeach
424
425foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400426 ['memfd_create', '''#include <sys/memfd.h>'''],
427 ['gettid', '''#include <sys/types.h>'''],
428 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
429 ['name_to_handle_at', '''#define _GNU_SOURCE
430 #include <sys/types.h>
431 #include <sys/stat.h>
432 #include <fcntl.h>'''],
433 ['setns', '''#define _GNU_SOURCE
434 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400435 ['renameat2', '''#include <stdio.h>'''],
436 ['kcmp', '''#include <linux/kcmp.h>'''],
437 ['keyctl', '''#include <sys/types.h>
438 #include <keyutils.h>'''],
439 ['copy_file_range', '''#include <sys/syscall.h>
440 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400441 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400442]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400443
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400444 have = cc.has_function(ident[0], prefix : ident[1])
445 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400446endforeach
447
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400448if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400449 conf.set('USE_SYS_RANDOM_H', true)
450 conf.set10('HAVE_DECL_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400451else
452 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
453 conf.set10('HAVE_DECL_GETRANDOM', have)
454endif
455
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400456#####################################################################
457
458sed = find_program('sed')
459grep = find_program('grep')
460awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400461m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400462stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400463git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400464
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400465meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400466mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400467test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
468splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400469
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400470# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
471# /usr/sbin, /sbin, and fall back to the default from middle column.
472progs = [['telinit', '/lib/sysvinit/telinit'],
473 ['quotaon', '/usr/sbin/quotaon' ],
474 ['quotacheck', '/usr/sbin/quotacheck' ],
475 ['kill', '/usr/bin/kill' ],
476 ['kmod', '/usr/bin/kmod' ],
477 ['kexec', '/usr/sbin/kexec' ],
478 ['sulogin', '/usr/sbin/sulogin' ],
479 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
480 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
481 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
482 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
483 ]
484foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400485 path = get_option(prog[0] + '-path')
486 if path != ''
487 message('Using @1@ for @0@'.format(prog[0], path))
488 else
489 exe = find_program(prog[0],
490 '/usr/sbin/' + prog[0],
491 '/sbin/' + prog[0],
492 required: false)
493 path = exe.found() ? exe.path() : prog[1]
494 endif
495 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
496 conf.set_quoted(name, path)
497 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400498endforeach
499
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400500if run_command('ln', '--relative', '--help').returncode() != 0
501 error('ln does not support --relative')
502endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400503
504############################################################
505
506gperf = find_program('gperf')
507
508gperf_test_format = '''
509#include <string.h>
510const char * in_word_set(const char *, @0@);
511@1@
512'''
513gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
514gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
515gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
516if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400517 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400518else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400519 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
520 if cc.compiles(gperf_test)
521 gperf_len_type = 'unsigned'
522 else
523 error('unable to determine gperf len type')
524 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400525endif
526message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400527conf.set('GPERF_LEN_TYPE', gperf_len_type,
528 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400529
530############################################################
531
532if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400533 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400534endif
535foreach header : ['linux/btrfs.h',
536 'linux/memfd.h',
537 'linux/vm_sockets.h',
538 'valgrind/memcheck.h',
539 'valgrind/valgrind.h',
540 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400541
542 conf.set('HAVE_' + header.underscorify().to_upper(),
543 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400544endforeach
545
546############################################################
547
548conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400549conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
550gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400551
552default_hierarchy = get_option('default-hierarchy')
553conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
554 description : 'default cgroup hierarchy as string')
555if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400556 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400557elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400558 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400559else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400560 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400561endif
562
563time_epoch = get_option('time-epoch')
564if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400565 NEWS = files('NEWS')
566 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400567endif
568time_epoch = time_epoch.to_int()
569conf.set('TIME_EPOCH', time_epoch)
570
571system_uid_max = get_option('system-uid-max')
572if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400573 system_uid_max = run_command(
574 awk,
575 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
576 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400577endif
578system_uid_max = system_uid_max.to_int()
579conf.set('SYSTEM_UID_MAX', system_uid_max)
580substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400581message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400582
583conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
584conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
585
586system_gid_max = get_option('system-gid-max')
587if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400588 system_gid_max = run_command(
589 awk,
590 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
591 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400592endif
593system_gid_max = system_gid_max.to_int()
594conf.set('SYSTEM_GID_MAX', system_gid_max)
595substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400596message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400597
598tty_gid = get_option('tty-gid')
599conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400600substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400601
602if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400603 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400604endif
605
606if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400607 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400608endif
609
610substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
611
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400612kill_user_processes = get_option('default-kill-user-processes')
613conf.set10('KILL_USER_PROCESSES', kill_user_processes)
614substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400615
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400616dns_servers = get_option('dns-servers')
617conf.set_quoted('DNS_SERVERS', dns_servers)
618substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400619
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400620ntp_servers = get_option('ntp-servers')
621conf.set_quoted('NTP_SERVERS', ntp_servers)
622substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400623
624conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
625
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400626substs.set('SUSHELL', get_option('debug-shell'))
627substs.set('DEBUGTTY', get_option('debug-tty'))
628
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400629debug = get_option('debug')
630if debug != ''
631 foreach name : debug.split(',')
632 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400633 conf.set('ENABLE_DEBUG_HASHMAP', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400634 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400635 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400636 else
637 message('unknown debug option "@0@", ignoring'.format(name))
638 endif
639 endforeach
640endif
641
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400642#####################################################################
643
644threads = dependency('threads')
645librt = cc.find_library('rt')
646libm = cc.find_library('m')
647libdl = cc.find_library('dl')
648libcrypt = cc.find_library('crypt')
649
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400650libcap = dependency('libcap', required : false)
651if not libcap.found()
652 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
653 libcap = cc.find_library('cap')
654endif
655
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400656libmount = dependency('mount',
657 version : '>= 2.27')
658
659want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400660if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400661 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400662 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400663 required : want_seccomp == 'true')
664 if libseccomp.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400665 conf.set('HAVE_SECCOMP', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400666 m4_defines += ['-DHAVE_SECCOMP']
667 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400668else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400669 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400670endif
671
672want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400673if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400674 libselinux = dependency('libselinux',
675 version : '>= 2.1.9',
676 required : want_selinux == 'true')
677 if libselinux.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400678 conf.set('HAVE_SELINUX', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400679 m4_defines += ['-DHAVE_SELINUX']
680 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400681else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400682 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400683endif
684
685want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400686if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400687 libapparmor = dependency('libapparmor',
688 required : want_apparmor == 'true')
689 if libapparmor.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400690 conf.set('HAVE_APPARMOR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400691 m4_defines += ['-DHAVE_APPARMOR']
692 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400693else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400694 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400695endif
696
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400697smack_run_label = get_option('smack-run-label')
698if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400699 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
700 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400701endif
702
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400703want_polkit = get_option('polkit')
704install_polkit = false
705install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400706if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400707 conf.set('ENABLE_POLKIT', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400708 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400709
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400710 libpolkit = dependency('polkit-gobject-1',
711 required : false)
712 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
713 message('Old polkit detected, will install pkla files')
714 install_polkit_pkla = true
715 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400716endif
717
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400718want_acl = get_option('acl')
719if want_acl != 'false'
720 libacl = cc.find_library('acl', required : want_acl == 'true')
721 if libacl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400722 conf.set('HAVE_ACL', true)
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400723 m4_defines += ['-DHAVE_ACL']
724 endif
725else
726 libacl = []
727endif
728
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400729want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400730if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400731 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400732 conf.set('HAVE_AUDIT', libaudit.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400733else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400734 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400735endif
736
737want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400738if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400739 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400740 conf.set('HAVE_BLKID', libblkid.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400741else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400742 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400743endif
744
745want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400746if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400747 libkmod = dependency('libkmod',
748 version : '>= 15',
749 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400750 conf.set('HAVE_KMOD', libkmod.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400751else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400752 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400753endif
754
755want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400756if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400757 libpam = cc.find_library('pam', required : want_pam == 'true')
758 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
759 if libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400760 conf.set('HAVE_PAM', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400761 m4_defines += ['-DHAVE_PAM']
762 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400763else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400764 libpam = []
765 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400766endif
767
768want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400769if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400770 libmicrohttpd = dependency('libmicrohttpd',
771 version : '>= 0.9.33',
772 required : want_microhttpd == 'true')
773 if libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400774 conf.set('HAVE_MICROHTTPD', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400775 m4_defines += ['-DHAVE_MICROHTTPD']
776 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400777else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400778 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400779endif
780
781want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400782if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400783 libcryptsetup = dependency('libcryptsetup',
784 version : '>= 1.6.0',
785 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400786 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400787else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400788 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400789endif
790
791want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400792if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400793 libcurl = dependency('libcurl',
794 version : '>= 7.32.0',
795 required : want_libcurl == 'true')
796 if libcurl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400797 conf.set('HAVE_LIBCURL', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400798 m4_defines += ['-DHAVE_LIBCURL']
799 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400800else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400801 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400802endif
803
804want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400805want_libidn2 = get_option('libidn2')
806if want_libidn == 'true' and want_libidn2 == 'true'
807 error('libidn and libidn2 cannot be requested simultaneously')
808endif
809
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400810if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400811 libidn = dependency('libidn',
812 required : want_libidn == 'true')
813 if libidn.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400814 conf.set('HAVE_LIBIDN', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400815 m4_defines += ['-DHAVE_LIBIDN']
816 endif
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400817else
818 libidn = []
819endif
820if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
821 # libidn is used for both libidn and libidn2 objects
822 libidn = dependency('libidn2',
823 required : want_libidn2 == 'true')
824 if libidn.found()
825 conf.set('HAVE_LIBIDN2', true)
826 m4_defines += ['-DHAVE_LIBIDN2']
827 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400828endif
829
830want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400831if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400832 libiptc = dependency('libiptc',
833 required : want_libiptc == 'true')
834 if libiptc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400835 conf.set('HAVE_LIBIPTC', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400836 m4_defines += ['-DHAVE_LIBIPTC']
837 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400838else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400839 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400840endif
841
842want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400843if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400844 libqrencode = dependency('libqrencode',
845 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400846 conf.set('HAVE_QRENCODE', libqrencode.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400847else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400848 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400849endif
850
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400851want_gcrypt = get_option('gcrypt')
852if want_gcrypt != 'false'
853 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
854 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
855
856 have_deps = libgcrypt.found() and libgpg_error.found()
857 conf.set('HAVE_GCRYPT', have_deps)
858 if not have_deps
859 # link to neither of the libs if one is not found
860 libgcrypt = []
861 libgpg_error = []
862 endif
863else
864 libgcrypt = []
865 libgpg_error = []
866endif
867
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400868want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400869if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400870 libgnutls = dependency('gnutls',
871 version : '>= 3.1.4',
872 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400873 conf.set('HAVE_GNUTLS', libgnutls.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400874else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400875 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400876endif
877
878want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400879if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400880 libdw = dependency('libdw',
881 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400882 conf.set('HAVE_ELFUTILS', libdw.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400883else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400884 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400885endif
886
887want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400888if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400889 libz = dependency('zlib',
890 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400891 conf.set('HAVE_ZLIB', libz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400892else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400893 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400894endif
895
896want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400897if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400898 libbzip2 = cc.find_library('bz2',
899 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400900 conf.set('HAVE_BZIP2', libbzip2.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400901else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400902 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400903endif
904
905want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400906if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400907 libxz = dependency('liblzma',
908 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400909 conf.set('HAVE_XZ', libxz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400910else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400911 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400912endif
913
914want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400915if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400916 liblz4 = dependency('liblz4',
917 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400918 conf.set('HAVE_LZ4', liblz4.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400919else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400920 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400921endif
922
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400923want_xkbcommon = get_option('xkbcommon')
924if want_xkbcommon != 'false'
925 libxkbcommon = dependency('xkbcommon',
926 version : '>= 0.3.0',
927 required : want_xkbcommon == 'true')
928 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
929else
930 libxkbcommon = []
931endif
932
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400933want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400934if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400935 libglib = dependency('glib-2.0',
936 version : '>= 2.22.0',
937 required : want_glib == 'true')
938 libgobject = dependency('gobject-2.0',
939 version : '>= 2.22.0',
940 required : want_glib == 'true')
941 libgio = dependency('gio-2.0',
942 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400943 have = libglib.found() and libgobject.found() and libgio.found()
944 conf.set('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400945else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400946 libglib = []
947 libgobject = []
948 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400949endif
950
951want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400952if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400953 libdbus = dependency('dbus-1',
954 version : '>= 1.3.2',
955 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400956 conf.set('HAVE_DBUS', libdbus.found())
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400957else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400958 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400959endif
960
Yu Watanabe42303dc2017-06-18 05:22:32 +0900961default_dnssec = get_option('default-dnssec')
962if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
963 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
964 default_dnssec = 'no'
965endif
966conf.set('DEFAULT_DNSSEC_MODE',
967 'DNSSEC_' + default_dnssec.underscorify().to_upper())
968substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
969
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400970want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400971if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400972 have_deps = (conf.get('HAVE_LIBCURL', false) and
973 conf.get('HAVE_ZLIB', false) and
974 conf.get('HAVE_BZIP2', false) and
975 conf.get('HAVE_XZ', false) and
976 conf.get('HAVE_GCRYPT', false))
977 conf.set('ENABLE_IMPORTD', have_deps)
978 if want_importd == 'true' and not have_deps
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400979 error('importd support was requested, but dependencies are not available')
980 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400981endif
982
983want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400984if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400985 have_deps = [conf.get('HAVE_MICROHTTPD', false),
986 conf.get('HAVE_LIBCURL', false)]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400987 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
988 # it's possible to build one without the other. Complain only if
989 # support was explictly requested. The auxiliary files like sysusers
990 # config should be installed when any of the programs are built.
991 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
992 error('remote support was requested, but dependencies are not available')
993 endif
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400994 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400995endif
996
997foreach pair : [['utmp', 'HAVE_UTMP'],
998 ['hibernate', 'ENABLE_HIBERNATE'],
999 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1000 ['binfmt', 'ENABLE_BINFMT'],
1001 ['coredump', 'ENABLE_COREDUMP'],
1002 ['resolve', 'ENABLE_RESOLVED'],
1003 ['logind', 'ENABLE_LOGIND'],
1004 ['hostnamed', 'ENABLE_HOSTNAMED'],
1005 ['localed', 'ENABLE_LOCALED'],
1006 ['machined', 'ENABLE_MACHINED'],
1007 ['networkd', 'ENABLE_NETWORKD'],
1008 ['timedated', 'ENABLE_TIMEDATED'],
1009 ['timesyncd', 'ENABLE_TIMESYNCD'],
1010 ['myhostname', 'HAVE_MYHOSTNAME'],
1011 ['firstboot', 'ENABLE_FIRSTBOOT'],
1012 ['randomseed', 'ENABLE_RANDOMSEED'],
1013 ['backlight', 'ENABLE_BACKLIGHT'],
1014 ['vconsole', 'ENABLE_VCONSOLE'],
1015 ['quotacheck', 'ENABLE_QUOTACHECK'],
1016 ['sysusers', 'ENABLE_SYSUSERS'],
1017 ['tmpfiles', 'ENABLE_TMPFILES'],
1018 ['hwdb', 'ENABLE_HWDB'],
1019 ['rfkill', 'ENABLE_RFKILL'],
1020 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001021 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek18b9ad12017-07-13 09:31:47 -04001022 ['tpm', 'ENABLE_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -04001023 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -04001024 ['smack', 'HAVE_SMACK'],
Franck Buib14e1b42017-05-09 14:02:37 +02001025 ['gshadow', 'ENABLE_GSHADOW'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04001026 ['idn', 'ENABLE_IDN'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001027 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001028 ]
1029
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001030 if get_option(pair[0])
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001031 conf.set(pair[1], true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001032 m4_defines += ['-D' + pair[1]]
1033 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001034endforeach
1035
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001036want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001037install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001038tests = []
1039
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001040conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1041
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001042#####################################################################
1043
1044if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001045 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001046
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001047 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001048 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001049 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001050 elif efi_arch == 'x86_64'
1051 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001052 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001053 elif efi_arch == 'arm'
1054 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001055 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001056 elif efi_arch == 'aarch64'
1057 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001058 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001059 else
1060 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001061 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001062 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001063
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001064 conf.set('ENABLE_EFI', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001065 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001066
1067 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001068endif
1069
1070#####################################################################
1071
1072config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001073 output : 'config.h',
1074 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001075
1076includes = include_directories('src/basic',
1077 'src/shared',
1078 'src/systemd',
1079 'src/journal',
1080 'src/resolve',
1081 'src/timesync',
1082 'src/login',
1083 'src/udev',
1084 'src/libudev',
1085 'src/core',
1086 'src/libsystemd/sd-bus',
1087 'src/libsystemd/sd-device',
1088 'src/libsystemd/sd-hwdb',
1089 'src/libsystemd/sd-id128',
1090 'src/libsystemd/sd-netlink',
1091 'src/libsystemd/sd-network',
1092 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001093 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001094 )
1095
1096add_project_arguments('-include', 'config.h', language : 'c')
1097
1098gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1099 'src/shared/gcrypt-util.c')
1100
1101subdir('po')
1102subdir('catalog')
1103subdir('src/systemd')
1104subdir('src/basic')
1105subdir('src/libsystemd')
1106subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001107subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001108subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001109
1110libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001111 'journal-core',
1112 libjournal_core_sources,
1113 journald_gperf_c,
1114 include_directories : includes,
1115 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001116
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001117libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001118libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001119 'systemd',
1120 libsystemd_internal_sources,
1121 journal_internal_sources,
Lennart Poettering43091722017-06-27 23:11:26 +02001122 version : '0.19.0',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001123 include_directories : includes,
1124 link_args : ['-shared',
1125 '-Wl,--version-script=' + libsystemd_sym_path],
1126 link_with : [libbasic],
1127 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001128 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001129 librt,
1130 libxz,
1131 liblz4],
1132 link_depends : libsystemd_sym,
1133 install : true,
1134 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001135
1136############################################################
1137
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001138# binaries that have --help and are intended for use by humans,
1139# usually, but not always, installed in /bin.
1140public_programs = []
1141
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001142subdir('src/libudev')
1143subdir('src/shared')
1144subdir('src/core')
1145subdir('src/udev')
1146subdir('src/network')
1147
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001148subdir('src/analyze')
1149subdir('src/journal-remote')
1150subdir('src/coredump')
1151subdir('src/hostname')
1152subdir('src/import')
1153subdir('src/kernel-install')
1154subdir('src/locale')
1155subdir('src/machine')
1156subdir('src/nspawn')
1157subdir('src/resolve')
1158subdir('src/timedate')
1159subdir('src/timesync')
1160subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001161subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001162subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001163
1164subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001165subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001166
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001167############################################################
1168
1169# only static linking apart from libdl, to make sure that the
1170# module is linked to all libraries that it uses.
1171test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001172 'test-dlopen',
1173 test_dlopen_c,
1174 include_directories : includes,
1175 link_with : [libbasic],
1176 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001177
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001178foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001179 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001180 ['mymachines', 'ENABLE_MACHINED'],
1181 ['resolve', 'ENABLE_RESOLVED']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001182
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001183 condition = tuple[1] == '' or conf.get(tuple[1], false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001184 if condition
1185 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001186
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001187 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1188 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001189
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001190 nss = shared_library(
1191 'nss_' + module,
1192 'src/nss-@0@/nss-@0@.c'.format(module),
1193 version : '2',
1194 include_directories : includes,
1195 link_args : ['-shared',
1196 '-Wl,--version-script=' + version_script_arg,
1197 '-Wl,--undefined'],
1198 link_with : [libsystemd_internal,
1199 libbasic],
1200 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001201 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001202 link_depends : sym,
1203 install : true,
1204 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001205
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001206 # We cannot use shared_module because it does not support version suffix.
1207 # Unfortunately shared_library insists on creating the symlink…
1208 meson.add_install_script('sh', '-c',
1209 'rm $DESTDIR@0@/libnss_@1@.so'
1210 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001211
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001212 test('dlopen-nss_' + module,
1213 test_dlopen,
1214 args : [nss.full_path()]) # path to dlopen must include a slash
1215 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001216endforeach
1217
1218############################################################
1219
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001220executable('systemd',
1221 systemd_sources,
1222 include_directories : includes,
1223 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001224 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001225 dependencies : [threads,
1226 librt,
1227 libseccomp,
1228 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001229 libmount,
1230 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001231 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001232 install : true,
1233 install_dir : rootlibexecdir)
1234
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001235exe = executable('systemd-analyze',
1236 systemd_analyze_sources,
1237 include_directories : includes,
1238 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001239 libshared],
1240 dependencies : [threads,
1241 librt,
1242 libseccomp,
1243 libselinux,
1244 libmount,
1245 libblkid],
1246 install_rpath : rootlibexecdir,
1247 install : true)
1248public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001249
1250executable('systemd-journald',
1251 systemd_journald_sources,
1252 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001253 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001254 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001255 dependencies : [threads,
1256 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001257 liblz4,
1258 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001259 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001260 install : true,
1261 install_dir : rootlibexecdir)
1262
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001263exe = executable('systemd-cat',
1264 systemd_cat_sources,
1265 include_directories : includes,
1266 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001267 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001268 dependencies : [threads],
1269 install_rpath : rootlibexecdir,
1270 install : true)
1271public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001272
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001273exe = executable('journalctl',
1274 journalctl_sources,
1275 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001276 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001277 dependencies : [threads,
1278 libqrencode,
1279 libxz,
1280 liblz4],
1281 install_rpath : rootlibexecdir,
1282 install : true,
1283 install_dir : rootbindir)
1284public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001285
1286executable('systemd-getty-generator',
1287 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001288 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001289 link_with : [libshared],
1290 install_rpath : rootlibexecdir,
1291 install : true,
1292 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001293
1294executable('systemd-debug-generator',
1295 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001296 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001297 link_with : [libshared],
1298 install_rpath : rootlibexecdir,
1299 install : true,
1300 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001301
1302executable('systemd-fstab-generator',
1303 'src/fstab-generator/fstab-generator.c',
1304 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001305 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001306 link_with : [libshared],
1307 install_rpath : rootlibexecdir,
1308 install : true,
1309 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001310
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001311if conf.get('ENABLE_ENVIRONMENT_D', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001312 executable('30-systemd-environment-d-generator',
1313 'src/environment-d-generator/environment-d-generator.c',
1314 include_directories : includes,
1315 link_with : [libshared],
1316 install_rpath : rootlibexecdir,
1317 install : true,
1318 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001319
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001320 meson.add_install_script(meson_make_symlink,
1321 join_paths(sysconfdir, 'environment'),
1322 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001323endif
1324
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001325if conf.get('ENABLE_HIBERNATE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001326 executable('systemd-hibernate-resume-generator',
1327 'src/hibernate-resume/hibernate-resume-generator.c',
1328 include_directories : includes,
1329 link_with : [libshared],
1330 install_rpath : rootlibexecdir,
1331 install : true,
1332 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001333
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001334 executable('systemd-hibernate-resume',
1335 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001336 include_directories : includes,
1337 link_with : [libshared],
1338 install_rpath : rootlibexecdir,
1339 install : true,
1340 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001341endif
1342
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001343if conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001344 executable('systemd-gpt-auto-generator',
1345 'src/gpt-auto-generator/gpt-auto-generator.c',
1346 'src/basic/blkid-util.h',
1347 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001348 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001349 dependencies : libblkid,
1350 install_rpath : rootlibexecdir,
1351 install : true,
1352 install_dir : systemgeneratordir)
1353
1354 exe = executable('systemd-dissect',
1355 'src/dissect/dissect.c',
1356 include_directories : includes,
1357 link_with : [libshared],
1358 install_rpath : rootlibexecdir,
1359 install : true,
1360 install_dir : rootlibexecdir)
1361 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001362endif
1363
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001364if conf.get('ENABLE_RESOLVED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001365 executable('systemd-resolved',
1366 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001367 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001368 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001369 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001370 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001371 libgcrypt,
1372 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001373 libm,
1374 libidn],
1375 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001376 install : true,
1377 install_dir : rootlibexecdir)
1378
1379 exe = executable('systemd-resolve',
1380 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001381 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001382 include_directories : includes,
1383 link_with : [libshared],
1384 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001385 libgcrypt,
1386 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001387 libm,
1388 libidn],
1389 install_rpath : rootlibexecdir,
1390 install : true)
1391 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001392endif
1393
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001394if conf.get('ENABLE_LOGIND', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001395 executable('systemd-logind',
1396 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001397 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001398 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001399 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001400 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001401 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001402 install_rpath : rootlibexecdir,
1403 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001404 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001405
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001406 exe = executable('loginctl',
1407 loginctl_sources,
1408 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001409 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001410 dependencies : [threads,
1411 liblz4,
1412 libxz],
1413 install_rpath : rootlibexecdir,
1414 install : true,
1415 install_dir : rootbindir)
1416 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001417
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001418 exe = executable('systemd-inhibit',
1419 'src/login/inhibit.c',
1420 include_directories : includes,
1421 link_with : [libshared],
1422 install_rpath : rootlibexecdir,
1423 install : true,
1424 install_dir : rootbindir)
1425 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001426
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001427 if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001428 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1429 pam_systemd = shared_library(
1430 'pam_systemd',
1431 pam_systemd_c,
1432 name_prefix : '',
1433 include_directories : includes,
1434 link_args : ['-shared',
1435 '-Wl,--version-script=' + version_script_arg],
1436 link_with : [libsystemd_internal,
1437 libshared_static],
1438 dependencies : [threads,
1439 libpam,
1440 libpam_misc],
1441 link_depends : pam_systemd_sym,
1442 install : true,
1443 install_dir : pamlibdir)
1444
1445 test('dlopen-pam_systemd',
1446 test_dlopen,
1447 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1448 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001449endif
1450
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001451if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001452 executable('systemd-user-sessions',
1453 'src/user-sessions/user-sessions.c',
1454 include_directories : includes,
1455 link_with : [libshared],
1456 install_rpath : rootlibexecdir,
1457 install : true,
1458 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001459endif
1460
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001461if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001462 exe = executable('bootctl',
1463 'src/boot/bootctl.c',
1464 include_directories : includes,
1465 link_with : [libshared],
1466 dependencies : [libblkid],
1467 install_rpath : rootlibexecdir,
1468 install : true)
1469 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001470endif
1471
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001472exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1473 include_directories : includes,
1474 link_with : [libshared],
1475 dependencies : [threads],
1476 install_rpath : rootlibexecdir,
1477 install : true)
1478public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001479
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001480exe = executable('systemctl', 'src/systemctl/systemctl.c',
1481 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001482 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001483 dependencies : [threads,
1484 libcap,
1485 libselinux,
1486 libxz,
1487 liblz4],
1488 install_rpath : rootlibexecdir,
1489 install : true,
1490 install_dir : rootbindir)
1491public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001492
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001493if conf.get('ENABLE_BACKLIGHT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001494 executable('systemd-backlight',
1495 'src/backlight/backlight.c',
1496 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001497 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001498 install_rpath : rootlibexecdir,
1499 install : true,
1500 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001501endif
1502
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001503if conf.get('ENABLE_RFKILL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001504 executable('systemd-rfkill',
1505 'src/rfkill/rfkill.c',
1506 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001507 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001508 install_rpath : rootlibexecdir,
1509 install : true,
1510 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001511endif
1512
1513executable('systemd-system-update-generator',
1514 'src/system-update-generator/system-update-generator.c',
1515 include_directories : includes,
1516 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001517 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001518 install : true,
1519 install_dir : systemgeneratordir)
1520
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001521if conf.get('HAVE_LIBCRYPTSETUP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001522 executable('systemd-cryptsetup',
1523 'src/cryptsetup/cryptsetup.c',
1524 include_directories : includes,
1525 link_with : [libshared],
1526 dependencies : [libcryptsetup],
1527 install_rpath : rootlibexecdir,
1528 install : true,
1529 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001530
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001531 executable('systemd-cryptsetup-generator',
1532 'src/cryptsetup/cryptsetup-generator.c',
1533 include_directories : includes,
1534 link_with : [libshared],
1535 dependencies : [libcryptsetup],
1536 install_rpath : rootlibexecdir,
1537 install : true,
1538 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001539
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001540 executable('systemd-veritysetup',
1541 'src/veritysetup/veritysetup.c',
1542 include_directories : includes,
1543 link_with : [libshared],
1544 dependencies : [libcryptsetup],
1545 install_rpath : rootlibexecdir,
1546 install : true,
1547 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001548
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001549 executable('systemd-veritysetup-generator',
1550 'src/veritysetup/veritysetup-generator.c',
1551 include_directories : includes,
1552 link_with : [libshared],
1553 dependencies : [libcryptsetup],
1554 install_rpath : rootlibexecdir,
1555 install : true,
1556 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001557endif
1558
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001559if conf.get('HAVE_SYSV_COMPAT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001560 executable('systemd-sysv-generator',
1561 'src/sysv-generator/sysv-generator.c',
1562 include_directories : includes,
1563 link_with : [libshared],
1564 install_rpath : rootlibexecdir,
1565 install : true,
1566 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001567
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001568 executable('systemd-rc-local-generator',
1569 'src/rc-local-generator/rc-local-generator.c',
1570 include_directories : includes,
1571 link_with : [libshared],
1572 install_rpath : rootlibexecdir,
1573 install : true,
1574 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001575endif
1576
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001577if conf.get('ENABLE_HOSTNAMED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001578 executable('systemd-hostnamed',
1579 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001580 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001581 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001582 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001583 install : true,
1584 install_dir : rootlibexecdir)
1585
1586 exe = executable('hostnamectl',
1587 'src/hostname/hostnamectl.c',
1588 include_directories : includes,
1589 link_with : [libshared],
1590 install_rpath : rootlibexecdir,
1591 install : true)
1592 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001593endif
1594
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001595if conf.get('ENABLE_LOCALED', false)
1596 if conf.get('HAVE_XKBCOMMON', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001597 # logind will load libxkbcommon.so dynamically on its own
1598 deps = [libdl]
1599 else
1600 deps = []
1601 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001602
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001603 executable('systemd-localed',
1604 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001605 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001606 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001607 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001608 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001609 install : true,
1610 install_dir : rootlibexecdir)
1611
1612 exe = executable('localectl',
1613 localectl_sources,
1614 include_directories : includes,
1615 link_with : [libshared],
1616 install_rpath : rootlibexecdir,
1617 install : true)
1618 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001619endif
1620
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001621if conf.get('ENABLE_TIMEDATED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001622 executable('systemd-timedated',
1623 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001624 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001625 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001626 install_rpath : rootlibexecdir,
1627 install : true,
1628 install_dir : rootlibexecdir)
1629
1630 exe = executable('timedatectl',
1631 'src/timedate/timedatectl.c',
1632 include_directories : includes,
1633 install_rpath : rootlibexecdir,
1634 link_with : [libshared],
1635 install : true)
1636 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001637endif
1638
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001639if conf.get('ENABLE_TIMESYNCD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001640 executable('systemd-timesyncd',
1641 systemd_timesyncd_sources,
1642 include_directories : includes,
1643 link_with : [libshared],
1644 dependencies : [threads,
1645 libm],
1646 install_rpath : rootlibexecdir,
1647 install : true,
1648 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001649endif
1650
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001651if conf.get('ENABLE_MACHINED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001652 executable('systemd-machined',
1653 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001654 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001655 link_with : [libmachine_core,
1656 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001657 install_rpath : rootlibexecdir,
1658 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001659 install_dir : rootlibexecdir)
1660
1661 exe = executable('machinectl',
1662 'src/machine/machinectl.c',
1663 include_directories : includes,
1664 link_with : [libshared],
1665 dependencies : [threads,
1666 libxz,
1667 liblz4],
1668 install_rpath : rootlibexecdir,
1669 install : true,
1670 install_dir : rootbindir)
1671 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001672endif
1673
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001674if conf.get('ENABLE_IMPORTD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001675 executable('systemd-importd',
1676 systemd_importd_sources,
1677 include_directories : includes,
1678 link_with : [libshared],
1679 dependencies : [threads],
1680 install_rpath : rootlibexecdir,
1681 install : true,
1682 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001683
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001684 systemd_pull = executable('systemd-pull',
1685 systemd_pull_sources,
1686 include_directories : includes,
1687 link_with : [libshared],
1688 dependencies : [libcurl,
1689 libz,
1690 libbzip2,
1691 libxz,
1692 libgcrypt],
1693 install_rpath : rootlibexecdir,
1694 install : true,
1695 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001696
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001697 systemd_import = executable('systemd-import',
1698 systemd_import_sources,
1699 include_directories : includes,
1700 link_with : [libshared],
1701 dependencies : [libcurl,
1702 libz,
1703 libbzip2,
1704 libxz],
1705 install_rpath : rootlibexecdir,
1706 install : true,
1707 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001708
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001709 systemd_export = executable('systemd-export',
1710 systemd_export_sources,
1711 include_directories : includes,
1712 link_with : [libshared],
1713 dependencies : [libcurl,
1714 libz,
1715 libbzip2,
1716 libxz],
1717 install_rpath : rootlibexecdir,
1718 install : true,
1719 install_dir : rootlibexecdir)
1720 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001721endif
1722
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001723if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001724 exe = executable('systemd-journal-upload',
1725 systemd_journal_upload_sources,
1726 include_directories : includes,
1727 link_with : [libshared],
1728 dependencies : [threads,
1729 libcurl,
1730 libgnutls,
1731 libxz,
1732 liblz4],
1733 install_rpath : rootlibexecdir,
1734 install : true,
1735 install_dir : rootlibexecdir)
1736 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001737endif
1738
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001739if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001740 s_j_remote = executable('systemd-journal-remote',
1741 systemd_journal_remote_sources,
1742 include_directories : includes,
1743 link_with : [libshared],
1744 dependencies : [threads,
1745 libmicrohttpd,
1746 libgnutls,
1747 libxz,
1748 liblz4],
1749 install_rpath : rootlibexecdir,
1750 install : true,
1751 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001752
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001753 s_j_gatewayd = executable('systemd-journal-gatewayd',
1754 systemd_journal_gatewayd_sources,
1755 include_directories : includes,
1756 link_with : [libshared],
1757 dependencies : [threads,
1758 libmicrohttpd,
1759 libgnutls,
1760 libxz,
1761 liblz4],
1762 install_rpath : rootlibexecdir,
1763 install : true,
1764 install_dir : rootlibexecdir)
1765 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001766endif
1767
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001768if conf.get('ENABLE_COREDUMP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001769 executable('systemd-coredump',
1770 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001771 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001772 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001773 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001774 libacl,
1775 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001776 libxz,
1777 liblz4],
1778 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001779 install : true,
1780 install_dir : rootlibexecdir)
1781
1782 exe = executable('coredumpctl',
1783 coredumpctl_sources,
1784 include_directories : includes,
1785 link_with : [libshared],
1786 dependencies : [threads,
1787 libxz,
1788 liblz4],
1789 install_rpath : rootlibexecdir,
1790 install : true)
1791 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001792endif
1793
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001794if conf.get('ENABLE_BINFMT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001795 exe = executable('systemd-binfmt',
1796 'src/binfmt/binfmt.c',
1797 include_directories : includes,
1798 link_with : [libshared],
1799 install_rpath : rootlibexecdir,
1800 install : true,
1801 install_dir : rootlibexecdir)
1802 public_programs += [exe]
1803
1804 meson.add_install_script('sh', '-c',
1805 mkdir_p.format(binfmtdir))
1806 meson.add_install_script('sh', '-c',
1807 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1808endif
1809
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001810if conf.get('ENABLE_VCONSOLE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001811 executable('systemd-vconsole-setup',
1812 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001813 include_directories : includes,
1814 link_with : [libshared],
1815 install_rpath : rootlibexecdir,
1816 install : true,
1817 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001818endif
1819
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001820if conf.get('ENABLE_RANDOMSEED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001821 executable('systemd-random-seed',
1822 'src/random-seed/random-seed.c',
1823 include_directories : includes,
1824 link_with : [libshared],
1825 install_rpath : rootlibexecdir,
1826 install : true,
1827 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001828endif
1829
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001830if conf.get('ENABLE_FIRSTBOOT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001831 executable('systemd-firstboot',
1832 'src/firstboot/firstboot.c',
1833 include_directories : includes,
1834 link_with : [libshared],
1835 dependencies : [libcrypt],
1836 install_rpath : rootlibexecdir,
1837 install : true,
1838 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001839endif
1840
1841executable('systemd-remount-fs',
1842 'src/remount-fs/remount-fs.c',
1843 'src/core/mount-setup.c',
1844 'src/core/mount-setup.h',
1845 include_directories : includes,
1846 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001847 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001848 install : true,
1849 install_dir : rootlibexecdir)
1850
1851executable('systemd-machine-id-setup',
1852 'src/machine-id-setup/machine-id-setup-main.c',
1853 'src/core/machine-id-setup.c',
1854 'src/core/machine-id-setup.h',
1855 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001856 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001857 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001858 install : true,
1859 install_dir : rootbindir)
1860
1861executable('systemd-fsck',
1862 'src/fsck/fsck.c',
1863 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001864 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001865 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001866 install : true,
1867 install_dir : rootlibexecdir)
1868
1869executable('systemd-sleep',
1870 'src/sleep/sleep.c',
1871 include_directories : includes,
1872 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001873 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001874 install : true,
1875 install_dir : rootlibexecdir)
1876
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001877exe = executable('systemd-sysctl',
1878 'src/sysctl/sysctl.c',
1879 include_directories : includes,
1880 link_with : [libshared],
1881 install_rpath : rootlibexecdir,
1882 install : true,
1883 install_dir : rootlibexecdir)
1884public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001885
1886executable('systemd-ac-power',
1887 'src/ac-power/ac-power.c',
1888 include_directories : includes,
1889 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001890 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001891 install : true,
1892 install_dir : rootlibexecdir)
1893
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001894exe = executable('systemd-detect-virt',
1895 'src/detect-virt/detect-virt.c',
1896 include_directories : includes,
1897 link_with : [libshared],
1898 install_rpath : rootlibexecdir,
1899 install : true)
1900public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001901
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001902exe = executable('systemd-delta',
1903 'src/delta/delta.c',
1904 include_directories : includes,
1905 link_with : [libshared],
1906 install_rpath : rootlibexecdir,
1907 install : true)
1908public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001909
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001910exe = executable('systemd-escape',
1911 'src/escape/escape.c',
1912 include_directories : includes,
1913 link_with : [libshared],
1914 install_rpath : rootlibexecdir,
1915 install : true,
1916 install_dir : rootbindir)
1917public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001918
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001919exe = executable('systemd-notify',
1920 'src/notify/notify.c',
1921 include_directories : includes,
1922 link_with : [libshared],
1923 install_rpath : rootlibexecdir,
1924 install : true,
1925 install_dir : rootbindir)
1926public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001927
1928executable('systemd-volatile-root',
1929 'src/volatile-root/volatile-root.c',
1930 include_directories : includes,
1931 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001932 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001933 install : true,
1934 install_dir : rootlibexecdir)
1935
1936executable('systemd-cgroups-agent',
1937 'src/cgroups-agent/cgroups-agent.c',
1938 include_directories : includes,
1939 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001940 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001941 install : true,
1942 install_dir : rootlibexecdir)
1943
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001944exe = executable('systemd-path',
1945 'src/path/path.c',
1946 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001947 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001948 install_rpath : rootlibexecdir,
1949 install : true)
1950public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001951
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001952exe = executable('systemd-ask-password',
1953 'src/ask-password/ask-password.c',
1954 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001955 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001956 install_rpath : rootlibexecdir,
1957 install : true,
1958 install_dir : rootbindir)
1959public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001960
1961executable('systemd-reply-password',
1962 'src/reply-password/reply-password.c',
1963 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001964 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001965 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001966 install : true,
1967 install_dir : rootlibexecdir)
1968
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001969exe = executable('systemd-tty-ask-password-agent',
1970 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1971 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001972 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001973 install_rpath : rootlibexecdir,
1974 install : true,
1975 install_dir : rootbindir)
1976public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001977
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001978exe = executable('systemd-cgls',
1979 'src/cgls/cgls.c',
1980 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001981 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001982 install_rpath : rootlibexecdir,
1983 install : true)
1984public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001985
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001986exe = executable('systemd-cgtop',
1987 'src/cgtop/cgtop.c',
1988 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001989 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001990 install_rpath : rootlibexecdir,
1991 install : true)
1992public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001993
1994executable('systemd-initctl',
1995 'src/initctl/initctl.c',
1996 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001997 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001998 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001999 install : true,
2000 install_dir : rootlibexecdir)
2001
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002002exe = executable('systemd-mount',
2003 'src/mount/mount-tool.c',
2004 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002005 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002006 install_rpath : rootlibexecdir,
2007 install : true)
2008public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002009
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002010meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002011 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002012
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002013exe = executable('systemd-run',
2014 'src/run/run.c',
2015 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002016 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002017 install_rpath : rootlibexecdir,
2018 install : true)
2019public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002020
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002021exe = executable('systemd-stdio-bridge',
2022 'src/stdio-bridge/stdio-bridge.c',
2023 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002024 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002025 install_rpath : rootlibexecdir,
2026 install : true)
2027public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002028
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002029exe = executable('busctl',
2030 'src/busctl/busctl.c',
2031 'src/busctl/busctl-introspect.c',
2032 'src/busctl/busctl-introspect.h',
2033 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002034 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002035 install_rpath : rootlibexecdir,
2036 install : true)
2037public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002038
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002039if conf.get('ENABLE_SYSUSERS', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002040 exe = executable('systemd-sysusers',
2041 'src/sysusers/sysusers.c',
2042 include_directories : includes,
2043 link_with : [libshared],
2044 install_rpath : rootlibexecdir,
2045 install : true,
2046 install_dir : rootbindir)
2047 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002048endif
2049
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002050if conf.get('ENABLE_TMPFILES', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002051 exe = executable('systemd-tmpfiles',
2052 'src/tmpfiles/tmpfiles.c',
2053 include_directories : includes,
2054 link_with : [libshared],
2055 dependencies : [libacl],
2056 install_rpath : rootlibexecdir,
2057 install : true,
2058 install_dir : rootbindir)
2059 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002060endif
2061
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002062if conf.get('ENABLE_HWDB', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002063 exe = executable('systemd-hwdb',
2064 'src/hwdb/hwdb.c',
2065 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2066 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002067 link_with : [libudev_internal],
2068 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002069 install : true,
2070 install_dir : rootbindir)
2071 public_programs += [exe]
2072endif
2073
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002074if conf.get('ENABLE_QUOTACHECK', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002075 executable('systemd-quotacheck',
2076 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002077 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002078 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002079 install_rpath : rootlibexecdir,
2080 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002081 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002082endif
2083
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002084exe = executable('systemd-socket-proxyd',
2085 'src/socket-proxy/socket-proxyd.c',
2086 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002087 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002088 dependencies : [threads],
2089 install_rpath : rootlibexecdir,
2090 install : true,
2091 install_dir : rootlibexecdir)
2092public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002093
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002094exe = executable('systemd-udevd',
2095 systemd_udevd_sources,
2096 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002097 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002098 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002099 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002100 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002101 dependencies : [threads,
2102 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002103 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002104 libacl,
2105 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002106 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002107 install : true,
2108 install_dir : rootlibexecdir)
2109public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002110
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002111exe = executable('udevadm',
2112 udevadm_sources,
2113 include_directories : includes,
2114 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002115 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002116 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002117 dependencies : [threads,
2118 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002119 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002120 libacl,
2121 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002122 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002123 install : true,
2124 install_dir : rootbindir)
2125public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002126
2127executable('systemd-shutdown',
2128 systemd_shutdown_sources,
2129 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002130 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002131 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002132 install : true,
2133 install_dir : rootlibexecdir)
2134
2135executable('systemd-update-done',
2136 'src/update-done/update-done.c',
2137 include_directories : includes,
2138 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002139 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002140 install : true,
2141 install_dir : rootlibexecdir)
2142
2143executable('systemd-update-utmp',
2144 'src/update-utmp/update-utmp.c',
2145 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002146 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002147 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002148 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002149 install : true,
2150 install_dir : rootlibexecdir)
2151
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002152if conf.get('HAVE_KMOD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002153 executable('systemd-modules-load',
2154 'src/modules-load/modules-load.c',
2155 include_directories : includes,
2156 link_with : [libshared],
2157 dependencies : [libkmod],
2158 install_rpath : rootlibexecdir,
2159 install : true,
2160 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002161
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002162 meson.add_install_script('sh', '-c',
2163 mkdir_p.format(modulesloaddir))
2164 meson.add_install_script('sh', '-c',
2165 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002166endif
2167
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002168exe = executable('systemd-nspawn',
2169 systemd_nspawn_sources,
2170 'src/core/mount-setup.c', # FIXME: use a variable?
2171 'src/core/mount-setup.h',
2172 'src/core/loopback-setup.c',
2173 'src/core/loopback-setup.h',
2174 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002175 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002176 dependencies : [libacl,
2177 libblkid,
2178 libseccomp,
2179 libselinux],
2180 install_rpath : rootlibexecdir,
2181 install : true)
2182public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002183
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002184if conf.get('ENABLE_NETWORKD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002185 executable('systemd-networkd',
2186 systemd_networkd_sources,
2187 include_directories : includes,
2188 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002189 libsystemd_network,
2190 libudev_internal,
2191 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002192 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002193 install_rpath : rootlibexecdir,
2194 install : true,
2195 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002196
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002197 executable('systemd-networkd-wait-online',
2198 systemd_networkd_wait_online_sources,
2199 include_directories : includes,
2200 link_with : [libnetworkd_core,
2201 libshared],
2202 install_rpath : rootlibexecdir,
2203 install : true,
2204 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002205
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002206 exe = executable('networkctl',
2207 networkctl_sources,
2208 include_directories : includes,
2209 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002210 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002211 install_rpath : rootlibexecdir,
2212 install : true,
2213 install_dir : rootbindir)
2214 public_programs += [exe]
2215endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002216############################################################
2217
2218foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002219 sources = tuple[0]
2220 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2221 dependencies = tuple[2]
2222 condition = tuple.length() >= 4 ? tuple[3] : ''
2223 type = tuple.length() >= 5 ? tuple[4] : ''
2224 defs = tuple.length() >= 6 ? tuple[5] : []
2225 incs = tuple.length() >= 7 ? tuple[6] : includes
2226 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002227
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002228 name = sources[0].split('/')[-1].split('.')[0]
2229 if type.startswith('timeout=')
2230 timeout = type.split('=')[1].to_int()
2231 type = ''
2232 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002233
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002234 if condition == '' or conf.get(condition, false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002235 exe = executable(
2236 name,
2237 sources,
2238 include_directories : incs,
2239 link_with : link_with,
2240 dependencies : dependencies,
2241 c_args : defs,
2242 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002243 install : install_tests,
2244 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002245
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002246 if type == 'manual'
2247 message('@0@ is a manual test'.format(name))
2248 elif type == 'unsafe' and want_tests != 'unsafe'
2249 message('@0@ is an unsafe test'.format(name))
2250 else
2251 test(name, exe,
2252 env : test_env,
2253 timeout : timeout)
2254 endif
2255 else
2256 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2257 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002258endforeach
2259
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002260test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002261 'test-libsystemd-sym',
2262 test_libsystemd_sym_c,
2263 include_directories : includes,
2264 link_with : [libsystemd],
2265 install : install_tests,
2266 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002267test('test-libsystemd-sym',
2268 test_libsystemd_sym)
2269
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002270test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002271 'test-libudev-sym',
2272 test_libudev_sym_c,
2273 include_directories : includes,
2274 c_args : ['-Wno-deprecated-declarations'],
2275 link_with : [libudev],
2276 install : install_tests,
2277 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002278test('test-libudev-sym',
2279 test_libudev_sym)
2280
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002281############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002282
2283make_directive_index_py = find_program('tools/make-directive-index.py')
2284make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002285xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002286hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002287
2288subdir('units')
2289subdir('sysctl.d')
2290subdir('sysusers.d')
2291subdir('tmpfiles.d')
2292subdir('rules')
2293subdir('hwdb')
2294subdir('network')
2295subdir('man')
2296subdir('shell-completion/bash')
2297subdir('shell-completion/zsh')
2298subdir('docs/sysvinit')
2299subdir('docs/var-log')
2300
2301# FIXME: figure out if the warning is true:
2302# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2303install_subdir('factory/etc',
2304 install_dir : factorydir)
2305
2306
2307install_data('xorg/50-systemd-user.sh',
2308 install_dir : xinitrcdir)
2309install_data('system-preset/90-systemd.preset',
2310 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002311install_data('modprobe.d/systemd.conf',
2312 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002313install_data('README',
2314 'NEWS',
2315 'CODING_STYLE',
2316 'DISTRO_PORTING',
2317 'ENVIRONMENT.md',
2318 'LICENSE.GPL2',
2319 'LICENSE.LGPL2.1',
2320 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2321 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002322
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002323meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2324meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2325
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002326############################################################
2327
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002328meson_check_help = find_program('tools/meson-check-help.sh')
2329
2330foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002331 name = exec.full_path().split('/')[-1]
2332 test('check-help-' + name,
2333 meson_check_help,
2334 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002335endforeach
2336
2337############################################################
2338
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002339if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002340 all_files = run_command(
2341 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002342 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002343 'ls-files',
2344 ':/*.[ch]'])
2345 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002346
userwithuide85a6902017-08-09 13:41:44 +00002347 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002348 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002349 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002350 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002351 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002352 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002353 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002354 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002355endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002356
2357if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002358 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002359 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002360 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002361 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002362endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002363
2364if git.found()
2365 git_head = run_command(
2366 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002367 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002368 'rev-parse', 'HEAD']).stdout().strip()
2369 git_head_short = run_command(
2370 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002371 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002372 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2373
2374 run_target(
2375 'git-snapshot',
2376 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002377 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002378 git_head_short),
2379 '--prefix', 'systemd-@0@/'.format(git_head),
2380 'HEAD'])
2381endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002382
2383############################################################
2384
2385status = [
2386 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2387
2388 'prefix: @0@'.format(prefixdir),
2389 'rootprefix: @0@'.format(rootprefixdir),
2390 'sysconf dir: @0@'.format(sysconfdir),
2391 'includedir: @0@'.format(includedir),
2392 'lib dir: @0@'.format(libdir),
2393 'rootlib dir: @0@'.format(rootlibdir),
2394 'SysV init scripts: @0@'.format(sysvinit_path),
2395 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2396 'PAM modules dir: @0@'.format(pamlibdir),
2397 'PAM configuration dir: @0@'.format(pamconfdir),
2398 'RPM macros dir: @0@'.format(rpmmacrosdir),
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002399 'modprobe.d dir: @0@'.format(modprobedir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002400 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2401 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2402 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2403 'bash completions dir: @0@'.format(bashcompletiondir),
2404 'zsh completions dir: @0@'.format(zshcompletiondir),
2405 'extra start script: @0@'.format(get_option('rc-local')),
2406 'extra stop script: @0@'.format(get_option('halt-local')),
2407 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2408 get_option('debug-tty')),
2409 'TTY GID: @0@'.format(tty_gid),
2410 'maximum system UID: @0@'.format(system_uid_max),
2411 'maximum system GID: @0@'.format(system_gid_max),
2412 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2413 'certificate root: @0@'.format(get_option('certificate-root')),
2414 'support URL: @0@'.format(support_url),
2415 'nobody user name: @0@'.format(get_option('nobody-user')),
2416 'nobody group name: @0@'.format(get_option('nobody-group')),
2417 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002418 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002419
2420 'default DNSSEC mode: @0@'.format(default_dnssec),
2421 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2422 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2423
2424alt_dns_servers = '\n '.join(dns_servers.split(' '))
2425alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2426status += [
2427 'default DNS servers: @0@'.format(alt_dns_servers),
2428 'default NTP servers: @0@'.format(alt_ntp_servers)]
2429
2430alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2431 '@@0@'.format(time_epoch)).stdout().strip()
2432status += [
2433 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2434
2435# TODO:
2436# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2437# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2438# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2439
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002440if conf.get('ENABLE_EFI', false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002441 status += [
2442 'efi arch: @0@'.format(efi_arch)]
2443
2444 if have_gnu_efi
2445 status += [
2446 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2447 'EFI CC @0@'.format(efi_cc),
2448 'EFI libdir: @0@'.format(efi_libdir),
2449 'EFI ldsdir: @0@'.format(efi_ldsdir),
2450 'EFI includedir: @0@'.format(efi_incdir)]
2451 endif
2452endif
2453
2454found = []
2455missing = []
2456
2457foreach tuple : [
2458 ['libcryptsetup'],
2459 ['PAM'],
2460 ['AUDIT'],
2461 ['IMA'],
2462 ['AppArmor'],
2463 ['SELinux'],
2464 ['SECCOMP'],
2465 ['SMACK'],
2466 ['zlib'],
2467 ['xz'],
2468 ['lz4'],
2469 ['bzip2'],
2470 ['ACL'],
2471 ['gcrypt'],
2472 ['qrencode'],
2473 ['microhttpd'],
2474 ['gnutls'],
2475 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002476 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002477 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002478 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002479 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002480 ['libiptc'],
2481 ['elfutils'],
2482 ['binfmt'],
2483 ['vconsole'],
2484 ['quotacheck'],
2485 ['tmpfiles'],
2486 ['environment.d'],
2487 ['sysusers'],
2488 ['firstboot'],
2489 ['randomseed'],
2490 ['backlight'],
2491 ['rfkill'],
2492 ['logind'],
2493 ['machined'],
2494 ['importd'],
2495 ['hostnamed'],
2496 ['timedated'],
2497 ['timesyncd'],
2498 ['localed'],
2499 ['networkd'],
2500 ['resolved'],
2501 ['coredump'],
2502 ['polkit'],
2503 ['legacy pkla', install_polkit_pkla],
2504 ['efi'],
2505 ['gnu-efi', have_gnu_efi],
2506 ['kmod'],
2507 ['xkbcommon'],
2508 ['blkid'],
2509 ['dbus'],
2510 ['glib'],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002511 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002512 ['hwdb'],
2513 ['tpm'],
2514 ['man pages', want_man],
2515 ['html pages', want_html],
2516 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002517 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002518 ['SysV compat'],
2519 ['utmp'],
2520 ['ldconfig'],
2521 ['hibernate'],
2522 ['adm group', get_option('adm-group')],
2523 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002524 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002525 ['debug hashmap'],
2526 ['debug mmap cache'],
2527]
2528
2529 cond = tuple.get(1, '')
2530 if cond == ''
2531 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2532 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002533 cond = conf.get(ident1, false) or conf.get(ident2, false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002534 endif
2535 if cond
2536 found += [tuple[0]]
2537 else
2538 missing += [tuple[0]]
2539 endif
2540endforeach
2541
2542status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002543 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002544 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002545 '',
2546 'disabled features: @0@'.format(', '.join(missing)),
2547 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002548message('\n '.join(status))