blob: 1d842274f77c5078f697d94fa5fab4a3548e253b [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001project('systemd', 'c',
2 version : '233',
3 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-Szmekab916f22017-04-13 22:15:01 -040029rootprefixdir = get_option('rootprefix')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040030if get_option('split-usr')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040031 conf.set('HAVE_SPLIT_USR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040032 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040033else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040034 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040035endif
36
37sysvinit_path = get_option('sysvinit-path')
38sysvrcnd_path = get_option('sysvrcnd-path')
39if sysvinit_path != '' or sysvrcnd_path != ''
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040040 conf.set('HAVE_SYSV_COMPAT', true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040041 description : 'SysV init scripts and rcN.d links are supported')
42 m4_defines += ['-DHAVE_SYSV_COMPAT']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040043endif
44
45# join_paths ignore the preceding arguments if an absolute component is
46# encountered, so this should canonicalize various paths when they are
47# absolute or relative.
48prefixdir = get_option('prefix')
49if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040050 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040051endif
52bindir = join_paths(prefixdir, get_option('bindir'))
53libdir = join_paths(prefixdir, get_option('libdir'))
54sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
55includedir = join_paths(prefixdir, get_option('includedir'))
56datadir = join_paths(prefixdir, get_option('datadir'))
57localstatedir = join_paths('/', get_option('localstatedir'))
58
59rootbindir = join_paths(rootprefixdir, 'bin')
60rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
61
62rootlibdir = get_option('rootlibdir')
63if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040064 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040065endif
66
67# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040068pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
69pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
70polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
71polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
72polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
73varlogdir = join_paths(localstatedir, 'log')
74xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040075rpmmacrosdir = get_option('rpmmacrosdir')
76
77# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -040078pkgdatadir = join_paths(datadir, 'systemd')
79environmentdir = join_paths(prefixdir, 'lib/environment.d')
80pkgsysconfdir = join_paths(sysconfdir, 'systemd')
81userunitdir = join_paths(prefixdir, 'lib/systemd/user')
82userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
83tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
84sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
85sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
86binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
87modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
88networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
89pkgincludedir = join_paths(includedir, 'systemd')
90systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
91usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
92systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
93userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
94systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
95systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
96systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
97systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
98udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
99udevhomedir = udevlibexecdir
100udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
101udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
102catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
103kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
104factorydir = join_paths(datadir, 'factory')
105docdir = join_paths(datadir, 'doc/systemd')
106bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
107testsdir = join_paths(prefixdir, 'lib/systemd/tests')
108systemdstatedir = join_paths(localstatedir, 'lib/systemd')
109catalogstatedir = join_paths(systemdstatedir, 'catalog')
110randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400111
112dbuspolicydir = get_option('dbuspolicydir')
113if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400114 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400115endif
116
117dbussessionservicedir = get_option('dbussessionservicedir')
118if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400119 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400120endif
121
122dbussystemservicedir = get_option('dbussystemservicedir')
123if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400124 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400125endif
126
127pamlibdir = get_option('pamlibdir')
128if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400129 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400130endif
131
132pamconfdir = get_option('pamconfdir')
133if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400134 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400135endif
136
137conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400138conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400139conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
140conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
141conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400142conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
143conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400144conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400145conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
146conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400147conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
148conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
149conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
150conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
151conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
152conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
153conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
154conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
155conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400156conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400157conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400158conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
159conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400160conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
161conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
162conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
163conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
164conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
165conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400166conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
167conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400168conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400169conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400170conf.set_quoted('LIBDIR', libdir)
171conf.set_quoted('ROOTLIBDIR', rootlibdir)
172conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
173conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400174conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
175conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
176conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
177conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
178conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
179conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400180
181conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
182conf.set_quoted('ABS_SRC_DIR', meson.source_root())
183
184substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400185substs.set('exec_prefix', prefixdir)
186substs.set('libdir', libdir)
187substs.set('rootlibdir', rootlibdir)
188substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400189substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400190substs.set('bindir', bindir)
191substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400192substs.set('rootlibexecdir', rootlibexecdir)
193substs.set('systemunitdir', systemunitdir)
194substs.set('userunitdir', userunitdir)
195substs.set('systempresetdir', systempresetdir)
196substs.set('userpresetdir', userpresetdir)
197substs.set('udevhwdbdir', udevhwdbdir)
198substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400199substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400200substs.set('catalogdir', catalogdir)
201substs.set('tmpfilesdir', tmpfilesdir)
202substs.set('sysusersdir', sysusersdir)
203substs.set('sysctldir', sysctldir)
204substs.set('binfmtdir', binfmtdir)
205substs.set('modulesloaddir', modulesloaddir)
206substs.set('systemgeneratordir', systemgeneratordir)
207substs.set('usergeneratordir', usergeneratordir)
208substs.set('systemenvgeneratordir', systemenvgeneratordir)
209substs.set('userenvgeneratordir', userenvgeneratordir)
210substs.set('systemshutdowndir', systemshutdowndir)
211substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400212substs.set('VARLOGDIR', varlogdir)
213substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400214substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
215substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400216substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
217substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
218substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
219substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400220
221#####################################################################
222
223cc = meson.get_compiler('c')
224pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400225check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400226
227foreach arg : ['-Wundef',
228 '-Wlogical-op',
229 '-Wmissing-include-dirs',
230 '-Wold-style-definition',
231 '-Wpointer-arith',
232 '-Winit-self',
233 '-Wdeclaration-after-statement',
234 '-Wfloat-equal',
235 '-Wsuggest-attribute=noreturn',
236 '-Werror=missing-prototypes',
237 '-Werror=implicit-function-declaration',
238 '-Werror=missing-declarations',
239 '-Werror=return-type',
240 '-Werror=incompatible-pointer-types',
241 '-Werror=format=2',
242 '-Wstrict-prototypes',
243 '-Wredundant-decls',
244 '-Wmissing-noreturn',
245 '-Wshadow',
246 '-Wendif-labels',
247 '-Wstrict-aliasing=2',
248 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400249 '-Werror=overflow',
250 '-Wdate-time',
251 '-Wnested-externs',
252 '-ffast-math',
253 '-fno-common',
254 '-fdiagnostics-show-option',
255 '-fno-strict-aliasing',
256 '-fvisibility=hidden',
257 '-fstack-protector',
258 '-fstack-protector-strong',
259 '-fPIE',
260 '--param=ssp-buffer-size=4',
261 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400262 if cc.has_argument(arg)
263 add_project_arguments(arg, language : 'c')
264 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400265endforeach
266
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400267# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
268# arguments, just emits a warnings. So test for the "positive" version instead.
269foreach arg : ['unused-parameter',
270 'missing-field-initializers',
271 'unused-result',
272 'format-signedness']
273 if cc.has_argument('-W' + arg)
274 add_project_arguments('-Wno-' + arg, language : 'c')
275 endif
276endforeach
277
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400278if cc.compiles('
279 #include <time.h>
280 #include <inttypes.h>
281 typedef uint64_t usec_t;
282 usec_t now(clockid_t clock);
283 int main(void) {
284 struct timespec now;
285 return 0;
286 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400287', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400288 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400289endif
290
291if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400292 foreach arg : ['-Wno-typedef-redefinition',
293 '-Wno-gnu-variable-sized-type-not-at-end',
294 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400295 if cc.has_argument(arg,
296 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400297 add_project_arguments(arg, language : 'c')
298 endif
299 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400300endif
301
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400302link_test_c = files('tools/meson-link-test.c')
303
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400304# --as-needed and --no-undefined are provided by meson by default,
305# run mesonconf to see what is enabled
306foreach arg : ['-Wl,-z,relro',
307 '-Wl,-z,now',
308 '-pie',
309 '-Wl,-fuse-ld=gold',
310 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400311
312 have = run_command(check_compilation_sh,
313 cc.cmd_array(), '-x', 'c', arg,
314 '-include', link_test_c).returncode() == 0
315 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
316 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400317 add_project_link_arguments(arg, language : 'c')
318 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400319endforeach
320
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400321if get_option('buildtype') != 'debug'
322 foreach arg : ['-ffunction-sections',
323 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400324 if cc.has_argument(arg,
325 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400326 add_project_arguments(arg, language : 'c')
327 endif
328 endforeach
329
330 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400331 have = run_command(check_compilation_sh,
332 cc.cmd_array(), '-x', 'c', arg,
333 '-include', link_test_c).returncode() == 0
334 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
335 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400336 add_project_link_arguments(arg, language : 'c')
337 endif
338 endforeach
339endif
340
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400341cpp = ' '.join(cc.cmd_array()) + ' -E'
342
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400343#####################################################################
344# compilation result tests
345
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400346conf.set('_GNU_SOURCE', true)
347conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400348
349conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
350conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
351conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
352conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
353conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
354conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
355conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
356
357decl_headers = '''
358#include <uchar.h>
359#include <linux/ethtool.h>
360'''
361# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
362
363foreach decl : ['char16_t',
364 'char32_t',
365 'key_serial_t',
366 'struct ethtool_link_settings',
367 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400368
369 # We get -1 if the size cannot be determined
370 have = cc.sizeof(decl, prefix : decl_headers) > 0
371 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400372endforeach
373
374foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
375 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
376 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
377 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
378 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
379 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
380 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
381 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
382 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
383 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530384 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400385 # if_tunnel.h is buggy and cannot be included on its own
386 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
387 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
388 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
389 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
390 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
391 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
392 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
393 ['NDA_IFINDEX', 'linux/neighbour.h'],
394 ['IFA_FLAGS', 'linux/if_addr.h'],
395 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
396 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400397 prefix = decl.length() > 2 ? decl[2] : ''
398 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
399 conf.set10('HAVE_DECL_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400400endforeach
401
402skip = false
403foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400404 if not skip and cc.has_function(ident)
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400405 conf.set('HAVE_' + ident.to_upper(), true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400406 skip = true
407 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400408endforeach
409
410foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400411 ['memfd_create', '''#include <sys/memfd.h>'''],
412 ['gettid', '''#include <sys/types.h>'''],
413 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
414 ['name_to_handle_at', '''#define _GNU_SOURCE
415 #include <sys/types.h>
416 #include <sys/stat.h>
417 #include <fcntl.h>'''],
418 ['setns', '''#define _GNU_SOURCE
419 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400420 ['renameat2', '''#include <stdio.h>'''],
421 ['kcmp', '''#include <linux/kcmp.h>'''],
422 ['keyctl', '''#include <sys/types.h>
423 #include <keyutils.h>'''],
424 ['copy_file_range', '''#include <sys/syscall.h>
425 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400426 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400427]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400428
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400429 have = cc.has_function(ident[0], prefix : ident[1])
430 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400431endforeach
432
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400433if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400434 conf.set('USE_SYS_RANDOM_H', true)
435 conf.set10('HAVE_DECL_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400436else
437 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
438 conf.set10('HAVE_DECL_GETRANDOM', have)
439endif
440
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400441#####################################################################
442
443sed = find_program('sed')
444grep = find_program('grep')
445awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400446m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400447stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400448git = find_program('git', required : false)
449etags = find_program('etags', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400450
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400451meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400452mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400453test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
454splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400455
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400456# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
457# /usr/sbin, /sbin, and fall back to the default from middle column.
458progs = [['telinit', '/lib/sysvinit/telinit'],
459 ['quotaon', '/usr/sbin/quotaon' ],
460 ['quotacheck', '/usr/sbin/quotacheck' ],
461 ['kill', '/usr/bin/kill' ],
462 ['kmod', '/usr/bin/kmod' ],
463 ['kexec', '/usr/sbin/kexec' ],
464 ['sulogin', '/usr/sbin/sulogin' ],
465 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
466 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
467 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
468 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
469 ]
470foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400471 path = get_option(prog[0] + '-path')
472 if path != ''
473 message('Using @1@ for @0@'.format(prog[0], path))
474 else
475 exe = find_program(prog[0],
476 '/usr/sbin/' + prog[0],
477 '/sbin/' + prog[0],
478 required: false)
479 path = exe.found() ? exe.path() : prog[1]
480 endif
481 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
482 conf.set_quoted(name, path)
483 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400484endforeach
485
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400486if run_command('ln', '--relative', '--help').returncode() != 0
487 error('ln does not support --relative')
488endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400489
490############################################################
491
492gperf = find_program('gperf')
493
494gperf_test_format = '''
495#include <string.h>
496const char * in_word_set(const char *, @0@);
497@1@
498'''
499gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
500gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
501gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
502if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400503 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400504else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400505 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
506 if cc.compiles(gperf_test)
507 gperf_len_type = 'unsigned'
508 else
509 error('unable to determine gperf len type')
510 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400511endif
512message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400513conf.set('GPERF_LEN_TYPE', gperf_len_type,
514 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400515
516############################################################
517
518if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400519 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400520endif
521foreach header : ['linux/btrfs.h',
522 'linux/memfd.h',
523 'linux/vm_sockets.h',
524 'valgrind/memcheck.h',
525 'valgrind/valgrind.h',
526 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400527
528 conf.set('HAVE_' + header.underscorify().to_upper(),
529 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400530endforeach
531
532############################################################
533
534conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
535
536default_hierarchy = get_option('default-hierarchy')
537conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
538 description : 'default cgroup hierarchy as string')
539if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400540 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400541elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400542 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400543else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400544 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400545endif
546
547time_epoch = get_option('time-epoch')
548if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400549 NEWS = files('NEWS')
550 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400551endif
552time_epoch = time_epoch.to_int()
553conf.set('TIME_EPOCH', time_epoch)
554
555system_uid_max = get_option('system-uid-max')
556if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400557 system_uid_max = run_command(
558 awk,
559 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
560 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400561endif
562system_uid_max = system_uid_max.to_int()
563conf.set('SYSTEM_UID_MAX', system_uid_max)
564substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400565message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400566
567conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
568conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
569
570system_gid_max = get_option('system-gid-max')
571if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400572 system_gid_max = run_command(
573 awk,
574 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
575 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400576endif
577system_gid_max = system_gid_max.to_int()
578conf.set('SYSTEM_GID_MAX', system_gid_max)
579substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400580message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400581
582tty_gid = get_option('tty-gid')
583conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400584substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400585
586if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400587 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400588endif
589
590if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400591 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400592endif
593
594substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
595
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400596kill_user_processes = get_option('default-kill-user-processes')
597conf.set10('KILL_USER_PROCESSES', kill_user_processes)
598substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400599
600default_dnssec = get_option('default-dnssec')
601conf.set('DEFAULT_DNSSEC_MODE',
602 'DNSSEC_' + default_dnssec.underscorify().to_upper())
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400603substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400604
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400605dns_servers = get_option('dns-servers')
606conf.set_quoted('DNS_SERVERS', dns_servers)
607substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400608
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400609ntp_servers = get_option('ntp-servers')
610conf.set_quoted('NTP_SERVERS', ntp_servers)
611substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400612
613conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
614
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400615substs.set('SUSHELL', get_option('debug-shell'))
616substs.set('DEBUGTTY', get_option('debug-tty'))
617
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400618debug = get_option('debug')
619if debug != ''
620 foreach name : debug.split(',')
621 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400622 conf.set('ENABLE_DEBUG_HASHMAP', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400623 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400624 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400625 else
626 message('unknown debug option "@0@", ignoring'.format(name))
627 endif
628 endforeach
629endif
630
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400631#####################################################################
632
633threads = dependency('threads')
634librt = cc.find_library('rt')
635libm = cc.find_library('m')
636libdl = cc.find_library('dl')
637libcrypt = cc.find_library('crypt')
638
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400639libcap = dependency('libcap', required : false)
640if not libcap.found()
641 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
642 libcap = cc.find_library('cap')
643endif
644
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400645libmount = dependency('mount',
646 version : '>= 2.27')
647
648want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400649if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400650 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400651 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400652 required : want_seccomp == 'true')
653 if libseccomp.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400654 conf.set('HAVE_SECCOMP', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400655 m4_defines += ['-DHAVE_SECCOMP']
656 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400657else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400658 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400659endif
660
661want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400662if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400663 libselinux = dependency('libselinux',
664 version : '>= 2.1.9',
665 required : want_selinux == 'true')
666 if libselinux.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400667 conf.set('HAVE_SELINUX', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400668 m4_defines += ['-DHAVE_SELINUX']
669 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400670else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400671 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400672endif
673
674want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400675if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400676 libapparmor = dependency('libapparmor',
677 required : want_apparmor == 'true')
678 if libapparmor.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400679 conf.set('HAVE_APPARMOR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400680 m4_defines += ['-DHAVE_APPARMOR']
681 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400682else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400683 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400684endif
685
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400686smack_run_label = get_option('smack-run-label')
687if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400688 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
689 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400690endif
691
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400692want_polkit = get_option('polkit')
693install_polkit = false
694install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400695if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400696 conf.set('ENABLE_POLKIT', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400697 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400698
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400699 libpolkit = dependency('polkit-gobject-1',
700 required : false)
701 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
702 message('Old polkit detected, will install pkla files')
703 install_polkit_pkla = true
704 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400705endif
706
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400707want_acl = get_option('acl')
708if want_acl != 'false'
709 libacl = cc.find_library('acl', required : want_acl == 'true')
710 if libacl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400711 conf.set('HAVE_ACL', true)
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400712 m4_defines += ['-DHAVE_ACL']
713 endif
714else
715 libacl = []
716endif
717
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400718want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400719if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400720 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400721 conf.set('HAVE_AUDIT', libaudit.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400722else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400723 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400724endif
725
726want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400727if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400728 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400729 conf.set('HAVE_BLKID', libblkid.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400730else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400731 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400732endif
733
734want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400735if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400736 libkmod = dependency('libkmod',
737 version : '>= 15',
738 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400739 conf.set('HAVE_KMOD', libkmod.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400740else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400741 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400742endif
743
744want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400745if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400746 libpam = cc.find_library('pam', required : want_pam == 'true')
747 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
748 if libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400749 conf.set('HAVE_PAM', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400750 m4_defines += ['-DHAVE_PAM']
751 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400752else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400753 libpam = []
754 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400755endif
756
757want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400758if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400759 libmicrohttpd = dependency('libmicrohttpd',
760 version : '>= 0.9.33',
761 required : want_microhttpd == 'true')
762 if libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400763 conf.set('HAVE_MICROHTTPD', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400764 m4_defines += ['-DHAVE_MICROHTTPD']
765 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400766else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400767 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400768endif
769
770want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400771if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400772 libcryptsetup = dependency('libcryptsetup',
773 version : '>= 1.6.0',
774 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400775 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400776else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400777 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400778endif
779
780want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400781if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400782 libcurl = dependency('libcurl',
783 version : '>= 7.32.0',
784 required : want_libcurl == 'true')
785 if libcurl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400786 conf.set('HAVE_LIBCURL', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400787 m4_defines += ['-DHAVE_LIBCURL']
788 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400789else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400790 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400791endif
792
793want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400794if want_libidn != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400795 libidn = dependency('libidn',
796 required : want_libidn == 'true')
797 if libidn.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400798 conf.set('HAVE_LIBIDN', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400799 m4_defines += ['-DHAVE_LIBIDN']
800 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400801else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400802 libidn = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400803endif
804
805want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400806if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400807 libiptc = dependency('libiptc',
808 required : want_libiptc == 'true')
809 if libiptc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400810 conf.set('HAVE_LIBIPTC', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400811 m4_defines += ['-DHAVE_LIBIPTC']
812 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400813else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400814 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400815endif
816
817want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400818if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400819 libqrencode = dependency('libqrencode',
820 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400821 conf.set('HAVE_QRENCODE', libqrencode.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400822else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400823 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400824endif
825
826want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400827if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400828 libgnutls = dependency('gnutls',
829 version : '>= 3.1.4',
830 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400831 conf.set('HAVE_GNUTLS', libgnutls.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400832else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400833 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400834endif
835
836want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400837if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400838 libdw = dependency('libdw',
839 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400840 conf.set('HAVE_ELFUTILS', libdw.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400841else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400842 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400843endif
844
845want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400846if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400847 libz = dependency('zlib',
848 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400849 conf.set('HAVE_ZLIB', libz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400850else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400851 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400852endif
853
854want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400855if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400856 libbzip2 = cc.find_library('bz2',
857 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400858 conf.set('HAVE_BZIP2', libbzip2.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400859else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400860 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400861endif
862
863want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400864if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400865 libxz = dependency('liblzma',
866 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400867 conf.set('HAVE_XZ', libxz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400868else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400869 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400870endif
871
872want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400873if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400874 liblz4 = dependency('liblz4',
875 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400876 conf.set('HAVE_LZ4', liblz4.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400877else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400878 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400879endif
880
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400881want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400882if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400883 libglib = dependency('glib-2.0',
884 version : '>= 2.22.0',
885 required : want_glib == 'true')
886 libgobject = dependency('gobject-2.0',
887 version : '>= 2.22.0',
888 required : want_glib == 'true')
889 libgio = dependency('gio-2.0',
890 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400891 have = libglib.found() and libgobject.found() and libgio.found()
892 conf.set('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400893else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400894 libglib = []
895 libgobject = []
896 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400897endif
898
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400899want_xkbcommon = get_option('xkbcommon')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400900if want_xkbcommon != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400901 libxkbcommon = dependency('xkbcommon',
902 version : '>= 0.3.0',
903 required : want_xkbcommon == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400904 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400905else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400906 libxkbcommon = []
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400907endif
908
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400909want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400910if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400911 libdbus = dependency('dbus-1',
912 version : '>= 1.3.2',
913 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400914 conf.set('HAVE_DBUS', libdbus.found())
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400915else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400916 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400917endif
918
Michael Biebl76c87412017-04-21 23:45:54 +0200919want_gcrypt = get_option('gcrypt')
920if want_gcrypt != 'false'
921 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
922 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
923
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400924 have_deps = libgcrypt.found() and libgpg_error.found()
925 conf.set('HAVE_GCRYPT', have_deps)
926 if not have_deps
Michael Biebl76c87412017-04-21 23:45:54 +0200927 # link to neither of the libs if one is not found
928 libgcrypt = []
929 libgpg_error = []
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400930 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400931else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400932 libgcrypt = []
Michael Biebl76c87412017-04-21 23:45:54 +0200933 libgpg_error = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400934endif
935
936want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400937if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400938 have_deps = (conf.get('HAVE_LIBCURL', false) and
939 conf.get('HAVE_ZLIB', false) and
940 conf.get('HAVE_BZIP2', false) and
941 conf.get('HAVE_XZ', false) and
942 conf.get('HAVE_GCRYPT', false))
943 conf.set('ENABLE_IMPORTD', have_deps)
944 if want_importd == 'true' and not have_deps
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400945 error('importd support was requested, but dependencies are not available')
946 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400947endif
948
949want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400950if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400951 have_deps = [conf.get('HAVE_MICROHTTPD', false),
952 conf.get('HAVE_LIBCURL', false)]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400953 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
954 # it's possible to build one without the other. Complain only if
955 # support was explictly requested. The auxiliary files like sysusers
956 # config should be installed when any of the programs are built.
957 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
958 error('remote support was requested, but dependencies are not available')
959 endif
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400960 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400961endif
962
963foreach pair : [['utmp', 'HAVE_UTMP'],
964 ['hibernate', 'ENABLE_HIBERNATE'],
965 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
966 ['binfmt', 'ENABLE_BINFMT'],
967 ['coredump', 'ENABLE_COREDUMP'],
968 ['resolve', 'ENABLE_RESOLVED'],
969 ['logind', 'ENABLE_LOGIND'],
970 ['hostnamed', 'ENABLE_HOSTNAMED'],
971 ['localed', 'ENABLE_LOCALED'],
972 ['machined', 'ENABLE_MACHINED'],
973 ['networkd', 'ENABLE_NETWORKD'],
974 ['timedated', 'ENABLE_TIMEDATED'],
975 ['timesyncd', 'ENABLE_TIMESYNCD'],
976 ['myhostname', 'HAVE_MYHOSTNAME'],
977 ['firstboot', 'ENABLE_FIRSTBOOT'],
978 ['randomseed', 'ENABLE_RANDOMSEED'],
979 ['backlight', 'ENABLE_BACKLIGHT'],
980 ['vconsole', 'ENABLE_VCONSOLE'],
981 ['quotacheck', 'ENABLE_QUOTACHECK'],
982 ['sysusers', 'ENABLE_SYSUSERS'],
983 ['tmpfiles', 'ENABLE_TMPFILES'],
984 ['hwdb', 'ENABLE_HWDB'],
985 ['rfkill', 'ENABLE_RFKILL'],
986 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -0400987 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -0400988 ['tpm', 'SD_BOOT_LOG_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -0400989 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -0400990 ['smack', 'HAVE_SMACK'],
Franck Buib14e1b42017-05-09 14:02:37 +0200991 ['gshadow', 'ENABLE_GSHADOW'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400992 ]
993
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400994 if get_option(pair[0])
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400995 conf.set(pair[1], true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400996 m4_defines += ['-D' + pair[1]]
997 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400998endforeach
999
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001000want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001001install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001002tests = []
1003
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001004#####################################################################
1005
1006if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001007 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001008
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001009 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001010 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001011 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001012 elif efi_arch == 'x86_64'
1013 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001014 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001015 elif efi_arch == 'arm'
1016 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001017 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001018 elif efi_arch == 'aarch64'
1019 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001020 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001021 else
1022 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001023 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001024 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001025
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001026 conf.set('ENABLE_EFI', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001027 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001028
1029 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001030endif
1031
1032#####################################################################
1033
1034config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001035 output : 'config.h',
1036 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001037
1038includes = include_directories('src/basic',
1039 'src/shared',
1040 'src/systemd',
1041 'src/journal',
1042 'src/resolve',
1043 'src/timesync',
1044 'src/login',
1045 'src/udev',
1046 'src/libudev',
1047 'src/core',
1048 'src/libsystemd/sd-bus',
1049 'src/libsystemd/sd-device',
1050 'src/libsystemd/sd-hwdb',
1051 'src/libsystemd/sd-id128',
1052 'src/libsystemd/sd-netlink',
1053 'src/libsystemd/sd-network',
1054 'src/libsystemd-network',
1055 )
1056
1057add_project_arguments('-include', 'config.h', language : 'c')
1058
1059gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1060 'src/shared/gcrypt-util.c')
1061
1062subdir('po')
1063subdir('catalog')
1064subdir('src/systemd')
1065subdir('src/basic')
1066subdir('src/libsystemd')
1067subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001068subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001069subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001070
1071libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001072 'journal-core',
1073 libjournal_core_sources,
1074 journald_gperf_c,
1075 include_directories : includes,
1076 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001077
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001078libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001079libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001080 'systemd',
1081 libsystemd_internal_sources,
1082 journal_internal_sources,
1083 version : '0.18.0',
1084 include_directories : includes,
1085 link_args : ['-shared',
1086 '-Wl,--version-script=' + libsystemd_sym_path],
1087 link_with : [libbasic],
1088 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001089 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001090 librt,
1091 libxz,
1092 liblz4],
1093 link_depends : libsystemd_sym,
1094 install : true,
1095 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001096
1097############################################################
1098
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001099# binaries that have --help and are intended for use by humans,
1100# usually, but not always, installed in /bin.
1101public_programs = []
1102
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001103subdir('src/libudev')
1104subdir('src/shared')
1105subdir('src/core')
1106subdir('src/udev')
1107subdir('src/network')
1108
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001109subdir('src/analyze')
1110subdir('src/journal-remote')
1111subdir('src/coredump')
1112subdir('src/hostname')
1113subdir('src/import')
1114subdir('src/kernel-install')
1115subdir('src/locale')
1116subdir('src/machine')
1117subdir('src/nspawn')
1118subdir('src/resolve')
1119subdir('src/timedate')
1120subdir('src/timesync')
1121subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001122subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001123subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001124
1125subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001126subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001127
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001128############################################################
1129
1130# only static linking apart from libdl, to make sure that the
1131# module is linked to all libraries that it uses.
1132test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001133 'test-dlopen',
1134 test_dlopen_c,
1135 include_directories : includes,
1136 link_with : [libbasic],
1137 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001138
1139foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
1140 ['systemd', '', []],
1141 ['mymachines', 'ENABLE_MACHINED', []],
1142 ['resolve', 'ENABLE_RESOLVED', [libdl]]]
1143
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001144 condition = tuple[1] == '' or conf.get(tuple[1], false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001145 if condition
1146 module = tuple[0]
1147 extra_deps = tuple[2]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001148
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001149 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1150 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001151
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001152 nss = shared_library(
1153 'nss_' + module,
1154 'src/nss-@0@/nss-@0@.c'.format(module),
1155 version : '2',
1156 include_directories : includes,
1157 link_args : ['-shared',
1158 '-Wl,--version-script=' + version_script_arg,
1159 '-Wl,--undefined'],
1160 link_with : [libsystemd_internal,
1161 libbasic],
1162 dependencies : [threads,
1163 librt] + extra_deps,
1164 link_depends : sym,
1165 install : true,
1166 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001167
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001168 # We cannot use shared_module because it does not support version suffix.
1169 # Unfortunately shared_library insists on creating the symlink…
1170 meson.add_install_script('sh', '-c',
1171 'rm $DESTDIR@0@/libnss_@1@.so'
1172 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001173
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001174 test('dlopen-nss_' + module,
1175 test_dlopen,
1176 args : [nss.full_path()]) # path to dlopen must include a slash
1177 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001178endforeach
1179
1180############################################################
1181
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001182executable('systemd',
1183 systemd_sources,
1184 include_directories : includes,
1185 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001186 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001187 dependencies : [threads,
1188 librt,
1189 libseccomp,
1190 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001191 libmount,
1192 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001193 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001194 install : true,
1195 install_dir : rootlibexecdir)
1196
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001197exe = executable('systemd-analyze',
1198 systemd_analyze_sources,
1199 include_directories : includes,
1200 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001201 libshared],
1202 dependencies : [threads,
1203 librt,
1204 libseccomp,
1205 libselinux,
1206 libmount,
1207 libblkid],
1208 install_rpath : rootlibexecdir,
1209 install : true)
1210public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001211
1212executable('systemd-journald',
1213 systemd_journald_sources,
1214 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001215 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001216 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001217 dependencies : [threads,
1218 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001219 liblz4,
1220 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001221 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001222 install : true,
1223 install_dir : rootlibexecdir)
1224
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001225exe = executable('systemd-cat',
1226 systemd_cat_sources,
1227 include_directories : includes,
1228 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001229 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001230 dependencies : [threads],
1231 install_rpath : rootlibexecdir,
1232 install : true)
1233public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001234
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001235exe = executable('journalctl',
1236 journalctl_sources,
1237 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001238 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001239 dependencies : [threads,
1240 libqrencode,
1241 libxz,
1242 liblz4],
1243 install_rpath : rootlibexecdir,
1244 install : true,
1245 install_dir : rootbindir)
1246public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001247
1248executable('systemd-getty-generator',
1249 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001250 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001251 link_with : [libshared],
1252 install_rpath : rootlibexecdir,
1253 install : true,
1254 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001255
1256executable('systemd-debug-generator',
1257 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001258 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001259 link_with : [libshared],
1260 install_rpath : rootlibexecdir,
1261 install : true,
1262 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001263
1264executable('systemd-fstab-generator',
1265 'src/fstab-generator/fstab-generator.c',
1266 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001267 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001268 link_with : [libshared],
1269 install_rpath : rootlibexecdir,
1270 install : true,
1271 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001272
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001273if conf.get('ENABLE_ENVIRONMENT_D', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001274 executable('30-systemd-environment-d-generator',
1275 'src/environment-d-generator/environment-d-generator.c',
1276 include_directories : includes,
1277 link_with : [libshared],
1278 install_rpath : rootlibexecdir,
1279 install : true,
1280 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001281
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001282 meson.add_install_script(meson_make_symlink,
1283 join_paths(sysconfdir, 'environment'),
1284 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001285endif
1286
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001287if conf.get('ENABLE_HIBERNATE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001288 executable('systemd-hibernate-resume-generator',
1289 'src/hibernate-resume/hibernate-resume-generator.c',
1290 include_directories : includes,
1291 link_with : [libshared],
1292 install_rpath : rootlibexecdir,
1293 install : true,
1294 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001295
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001296 executable('systemd-hibernate-resume',
1297 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001298 include_directories : includes,
1299 link_with : [libshared],
1300 install_rpath : rootlibexecdir,
1301 install : true,
1302 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001303endif
1304
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001305if conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001306 executable('systemd-gpt-auto-generator',
1307 'src/gpt-auto-generator/gpt-auto-generator.c',
1308 'src/basic/blkid-util.h',
1309 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001310 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001311 dependencies : libblkid,
1312 install_rpath : rootlibexecdir,
1313 install : true,
1314 install_dir : systemgeneratordir)
1315
1316 exe = executable('systemd-dissect',
1317 'src/dissect/dissect.c',
1318 include_directories : includes,
1319 link_with : [libshared],
1320 install_rpath : rootlibexecdir,
1321 install : true,
1322 install_dir : rootlibexecdir)
1323 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001324endif
1325
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001326if conf.get('ENABLE_RESOLVED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001327 executable('systemd-resolved',
1328 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001329 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001330 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001331 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001332 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001333 libgcrypt,
1334 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001335 libm,
1336 libidn],
1337 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001338 install : true,
1339 install_dir : rootlibexecdir)
1340
1341 exe = executable('systemd-resolve',
1342 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001343 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001344 include_directories : includes,
1345 link_with : [libshared],
1346 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001347 libgcrypt,
1348 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001349 libm,
1350 libidn],
1351 install_rpath : rootlibexecdir,
1352 install : true)
1353 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001354endif
1355
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001356if conf.get('ENABLE_LOGIND', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001357 executable('systemd-logind',
1358 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001359 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001360 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001361 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001362 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001363 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001364 install_rpath : rootlibexecdir,
1365 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001366 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001367
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001368 exe = executable('loginctl',
1369 loginctl_sources,
1370 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001371 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001372 dependencies : [threads,
1373 liblz4,
1374 libxz],
1375 install_rpath : rootlibexecdir,
1376 install : true,
1377 install_dir : rootbindir)
1378 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001379
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001380 exe = executable('systemd-inhibit',
1381 'src/login/inhibit.c',
1382 include_directories : includes,
1383 link_with : [libshared],
1384 install_rpath : rootlibexecdir,
1385 install : true,
1386 install_dir : rootbindir)
1387 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001388
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001389 if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001390 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1391 pam_systemd = shared_library(
1392 'pam_systemd',
1393 pam_systemd_c,
1394 name_prefix : '',
1395 include_directories : includes,
1396 link_args : ['-shared',
1397 '-Wl,--version-script=' + version_script_arg],
1398 link_with : [libsystemd_internal,
1399 libshared_static],
1400 dependencies : [threads,
1401 libpam,
1402 libpam_misc],
1403 link_depends : pam_systemd_sym,
1404 install : true,
1405 install_dir : pamlibdir)
1406
1407 test('dlopen-pam_systemd',
1408 test_dlopen,
1409 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1410 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001411endif
1412
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001413if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001414 executable('systemd-user-sessions',
1415 'src/user-sessions/user-sessions.c',
1416 include_directories : includes,
1417 link_with : [libshared],
1418 install_rpath : rootlibexecdir,
1419 install : true,
1420 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001421endif
1422
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001423if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001424 exe = executable('bootctl',
1425 'src/boot/bootctl.c',
1426 include_directories : includes,
1427 link_with : [libshared],
1428 dependencies : [libblkid],
1429 install_rpath : rootlibexecdir,
1430 install : true)
1431 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001432endif
1433
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001434exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1435 include_directories : includes,
1436 link_with : [libshared],
1437 dependencies : [threads],
1438 install_rpath : rootlibexecdir,
1439 install : true)
1440public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001441
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001442exe = executable('systemctl', 'src/systemctl/systemctl.c',
1443 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001444 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001445 dependencies : [threads,
1446 libcap,
1447 libselinux,
1448 libxz,
1449 liblz4],
1450 install_rpath : rootlibexecdir,
1451 install : true,
1452 install_dir : rootbindir)
1453public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001454
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001455if conf.get('ENABLE_BACKLIGHT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001456 executable('systemd-backlight',
1457 'src/backlight/backlight.c',
1458 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001459 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001460 install_rpath : rootlibexecdir,
1461 install : true,
1462 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001463endif
1464
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001465if conf.get('ENABLE_RFKILL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001466 executable('systemd-rfkill',
1467 'src/rfkill/rfkill.c',
1468 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001469 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001470 install_rpath : rootlibexecdir,
1471 install : true,
1472 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001473endif
1474
1475executable('systemd-system-update-generator',
1476 'src/system-update-generator/system-update-generator.c',
1477 include_directories : includes,
1478 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001479 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001480 install : true,
1481 install_dir : systemgeneratordir)
1482
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001483if conf.get('HAVE_LIBCRYPTSETUP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001484 executable('systemd-cryptsetup',
1485 'src/cryptsetup/cryptsetup.c',
1486 include_directories : includes,
1487 link_with : [libshared],
1488 dependencies : [libcryptsetup],
1489 install_rpath : rootlibexecdir,
1490 install : true,
1491 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001492
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001493 executable('systemd-cryptsetup-generator',
1494 'src/cryptsetup/cryptsetup-generator.c',
1495 include_directories : includes,
1496 link_with : [libshared],
1497 dependencies : [libcryptsetup],
1498 install_rpath : rootlibexecdir,
1499 install : true,
1500 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001501
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001502 executable('systemd-veritysetup',
1503 'src/veritysetup/veritysetup.c',
1504 include_directories : includes,
1505 link_with : [libshared],
1506 dependencies : [libcryptsetup],
1507 install_rpath : rootlibexecdir,
1508 install : true,
1509 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001510
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001511 executable('systemd-veritysetup-generator',
1512 'src/veritysetup/veritysetup-generator.c',
1513 include_directories : includes,
1514 link_with : [libshared],
1515 dependencies : [libcryptsetup],
1516 install_rpath : rootlibexecdir,
1517 install : true,
1518 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001519endif
1520
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001521if conf.get('HAVE_SYSV_COMPAT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001522 executable('systemd-sysv-generator',
1523 'src/sysv-generator/sysv-generator.c',
1524 include_directories : includes,
1525 link_with : [libshared],
1526 install_rpath : rootlibexecdir,
1527 install : true,
1528 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001529
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001530 executable('systemd-rc-local-generator',
1531 'src/rc-local-generator/rc-local-generator.c',
1532 include_directories : includes,
1533 link_with : [libshared],
1534 install_rpath : rootlibexecdir,
1535 install : true,
1536 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001537endif
1538
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001539if conf.get('ENABLE_HOSTNAMED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001540 executable('systemd-hostnamed',
1541 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001542 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001543 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001544 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001545 install : true,
1546 install_dir : rootlibexecdir)
1547
1548 exe = executable('hostnamectl',
1549 'src/hostname/hostnamectl.c',
1550 include_directories : includes,
1551 link_with : [libshared],
1552 install_rpath : rootlibexecdir,
1553 install : true)
1554 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001555endif
1556
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001557if conf.get('ENABLE_LOCALED', false)
1558 if conf.get('HAVE_XKBCOMMON', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001559 # logind will load libxkbcommon.so dynamically on its own
1560 deps = [libdl]
1561 else
1562 deps = []
1563 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001564
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001565 executable('systemd-localed',
1566 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001567 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001568 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001569 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001570 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001571 install : true,
1572 install_dir : rootlibexecdir)
1573
1574 exe = executable('localectl',
1575 localectl_sources,
1576 include_directories : includes,
1577 link_with : [libshared],
1578 install_rpath : rootlibexecdir,
1579 install : true)
1580 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001581endif
1582
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001583if conf.get('ENABLE_TIMEDATED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001584 executable('systemd-timedated',
1585 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001586 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001587 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001588 install_rpath : rootlibexecdir,
1589 install : true,
1590 install_dir : rootlibexecdir)
1591
1592 exe = executable('timedatectl',
1593 'src/timedate/timedatectl.c',
1594 include_directories : includes,
1595 install_rpath : rootlibexecdir,
1596 link_with : [libshared],
1597 install : true)
1598 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001599endif
1600
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001601if conf.get('ENABLE_TIMESYNCD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001602 executable('systemd-timesyncd',
1603 systemd_timesyncd_sources,
1604 include_directories : includes,
1605 link_with : [libshared],
1606 dependencies : [threads,
1607 libm],
1608 install_rpath : rootlibexecdir,
1609 install : true,
1610 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001611endif
1612
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001613if conf.get('ENABLE_MACHINED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001614 executable('systemd-machined',
1615 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001616 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001617 link_with : [libmachine_core,
1618 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001619 install_rpath : rootlibexecdir,
1620 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001621 install_dir : rootlibexecdir)
1622
1623 exe = executable('machinectl',
1624 'src/machine/machinectl.c',
1625 include_directories : includes,
1626 link_with : [libshared],
1627 dependencies : [threads,
1628 libxz,
1629 liblz4],
1630 install_rpath : rootlibexecdir,
1631 install : true,
1632 install_dir : rootbindir)
1633 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001634endif
1635
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001636if conf.get('ENABLE_IMPORTD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001637 executable('systemd-importd',
1638 systemd_importd_sources,
1639 include_directories : includes,
1640 link_with : [libshared],
1641 dependencies : [threads],
1642 install_rpath : rootlibexecdir,
1643 install : true,
1644 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001645
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001646 systemd_pull = executable('systemd-pull',
1647 systemd_pull_sources,
1648 include_directories : includes,
1649 link_with : [libshared],
1650 dependencies : [libcurl,
1651 libz,
1652 libbzip2,
1653 libxz,
1654 libgcrypt],
1655 install_rpath : rootlibexecdir,
1656 install : true,
1657 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001658
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001659 systemd_import = executable('systemd-import',
1660 systemd_import_sources,
1661 include_directories : includes,
1662 link_with : [libshared],
1663 dependencies : [libcurl,
1664 libz,
1665 libbzip2,
1666 libxz],
1667 install_rpath : rootlibexecdir,
1668 install : true,
1669 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001670
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001671 systemd_export = executable('systemd-export',
1672 systemd_export_sources,
1673 include_directories : includes,
1674 link_with : [libshared],
1675 dependencies : [libcurl,
1676 libz,
1677 libbzip2,
1678 libxz],
1679 install_rpath : rootlibexecdir,
1680 install : true,
1681 install_dir : rootlibexecdir)
1682 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001683endif
1684
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001685if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001686 exe = executable('systemd-journal-upload',
1687 systemd_journal_upload_sources,
1688 include_directories : includes,
1689 link_with : [libshared],
1690 dependencies : [threads,
1691 libcurl,
1692 libgnutls,
1693 libxz,
1694 liblz4],
1695 install_rpath : rootlibexecdir,
1696 install : true,
1697 install_dir : rootlibexecdir)
1698 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001699endif
1700
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001701if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001702 s_j_remote = executable('systemd-journal-remote',
1703 systemd_journal_remote_sources,
1704 include_directories : includes,
1705 link_with : [libshared],
1706 dependencies : [threads,
1707 libmicrohttpd,
1708 libgnutls,
1709 libxz,
1710 liblz4],
1711 install_rpath : rootlibexecdir,
1712 install : true,
1713 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001714
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001715 s_j_gatewayd = executable('systemd-journal-gatewayd',
1716 systemd_journal_gatewayd_sources,
1717 include_directories : includes,
1718 link_with : [libshared],
1719 dependencies : [threads,
1720 libmicrohttpd,
1721 libgnutls,
1722 libxz,
1723 liblz4],
1724 install_rpath : rootlibexecdir,
1725 install : true,
1726 install_dir : rootlibexecdir)
1727 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001728endif
1729
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001730if conf.get('ENABLE_COREDUMP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001731 executable('systemd-coredump',
1732 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001733 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001734 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001735 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001736 libacl,
1737 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001738 libxz,
1739 liblz4],
1740 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001741 install : true,
1742 install_dir : rootlibexecdir)
1743
1744 exe = executable('coredumpctl',
1745 coredumpctl_sources,
1746 include_directories : includes,
1747 link_with : [libshared],
1748 dependencies : [threads,
1749 libxz,
1750 liblz4],
1751 install_rpath : rootlibexecdir,
1752 install : true)
1753 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001754endif
1755
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001756if conf.get('ENABLE_BINFMT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001757 exe = executable('systemd-binfmt',
1758 'src/binfmt/binfmt.c',
1759 include_directories : includes,
1760 link_with : [libshared],
1761 install_rpath : rootlibexecdir,
1762 install : true,
1763 install_dir : rootlibexecdir)
1764 public_programs += [exe]
1765
1766 meson.add_install_script('sh', '-c',
1767 mkdir_p.format(binfmtdir))
1768 meson.add_install_script('sh', '-c',
1769 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1770endif
1771
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001772if conf.get('ENABLE_VCONSOLE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001773 executable('systemd-vconsole-setup',
1774 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001775 include_directories : includes,
1776 link_with : [libshared],
1777 install_rpath : rootlibexecdir,
1778 install : true,
1779 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001780endif
1781
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001782if conf.get('ENABLE_RANDOMSEED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001783 executable('systemd-random-seed',
1784 'src/random-seed/random-seed.c',
1785 include_directories : includes,
1786 link_with : [libshared],
1787 install_rpath : rootlibexecdir,
1788 install : true,
1789 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001790endif
1791
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001792if conf.get('ENABLE_FIRSTBOOT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001793 executable('systemd-firstboot',
1794 'src/firstboot/firstboot.c',
1795 include_directories : includes,
1796 link_with : [libshared],
1797 dependencies : [libcrypt],
1798 install_rpath : rootlibexecdir,
1799 install : true,
1800 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001801endif
1802
1803executable('systemd-remount-fs',
1804 'src/remount-fs/remount-fs.c',
1805 'src/core/mount-setup.c',
1806 'src/core/mount-setup.h',
1807 include_directories : includes,
1808 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001809 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001810 install : true,
1811 install_dir : rootlibexecdir)
1812
1813executable('systemd-machine-id-setup',
1814 'src/machine-id-setup/machine-id-setup-main.c',
1815 'src/core/machine-id-setup.c',
1816 'src/core/machine-id-setup.h',
1817 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001818 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001819 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001820 install : true,
1821 install_dir : rootbindir)
1822
1823executable('systemd-fsck',
1824 'src/fsck/fsck.c',
1825 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001826 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001827 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001828 install : true,
1829 install_dir : rootlibexecdir)
1830
1831executable('systemd-sleep',
1832 'src/sleep/sleep.c',
1833 include_directories : includes,
1834 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001835 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001836 install : true,
1837 install_dir : rootlibexecdir)
1838
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001839exe = executable('systemd-sysctl',
1840 'src/sysctl/sysctl.c',
1841 include_directories : includes,
1842 link_with : [libshared],
1843 install_rpath : rootlibexecdir,
1844 install : true,
1845 install_dir : rootlibexecdir)
1846public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001847
1848executable('systemd-ac-power',
1849 'src/ac-power/ac-power.c',
1850 include_directories : includes,
1851 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001852 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001853 install : true,
1854 install_dir : rootlibexecdir)
1855
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001856exe = executable('systemd-detect-virt',
1857 'src/detect-virt/detect-virt.c',
1858 include_directories : includes,
1859 link_with : [libshared],
1860 install_rpath : rootlibexecdir,
1861 install : true)
1862public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001863
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001864exe = executable('systemd-delta',
1865 'src/delta/delta.c',
1866 include_directories : includes,
1867 link_with : [libshared],
1868 install_rpath : rootlibexecdir,
1869 install : true)
1870public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001871
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001872exe = executable('systemd-escape',
1873 'src/escape/escape.c',
1874 include_directories : includes,
1875 link_with : [libshared],
1876 install_rpath : rootlibexecdir,
1877 install : true,
1878 install_dir : rootbindir)
1879public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001880
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001881exe = executable('systemd-notify',
1882 'src/notify/notify.c',
1883 include_directories : includes,
1884 link_with : [libshared],
1885 install_rpath : rootlibexecdir,
1886 install : true,
1887 install_dir : rootbindir)
1888public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001889
1890executable('systemd-volatile-root',
1891 'src/volatile-root/volatile-root.c',
1892 include_directories : includes,
1893 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001894 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001895 install : true,
1896 install_dir : rootlibexecdir)
1897
1898executable('systemd-cgroups-agent',
1899 'src/cgroups-agent/cgroups-agent.c',
1900 include_directories : includes,
1901 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001902 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001903 install : true,
1904 install_dir : rootlibexecdir)
1905
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001906exe = executable('systemd-path',
1907 'src/path/path.c',
1908 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001909 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001910 install_rpath : rootlibexecdir,
1911 install : true)
1912public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001913
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001914exe = executable('systemd-ask-password',
1915 'src/ask-password/ask-password.c',
1916 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001917 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001918 install_rpath : rootlibexecdir,
1919 install : true,
1920 install_dir : rootbindir)
1921public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001922
1923executable('systemd-reply-password',
1924 'src/reply-password/reply-password.c',
1925 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001926 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001927 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001928 install : true,
1929 install_dir : rootlibexecdir)
1930
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001931exe = executable('systemd-tty-ask-password-agent',
1932 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1933 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001934 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001935 install_rpath : rootlibexecdir,
1936 install : true,
1937 install_dir : rootbindir)
1938public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001939
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001940exe = executable('systemd-cgls',
1941 'src/cgls/cgls.c',
1942 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001943 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001944 install_rpath : rootlibexecdir,
1945 install : true)
1946public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001947
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001948exe = executable('systemd-cgtop',
1949 'src/cgtop/cgtop.c',
1950 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001951 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001952 install_rpath : rootlibexecdir,
1953 install : true)
1954public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001955
1956executable('systemd-initctl',
1957 'src/initctl/initctl.c',
1958 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001959 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001960 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001961 install : true,
1962 install_dir : rootlibexecdir)
1963
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001964exe = executable('systemd-mount',
1965 'src/mount/mount-tool.c',
1966 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001967 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001968 install_rpath : rootlibexecdir,
1969 install : true)
1970public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001971
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001972meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04001973 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001974
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001975exe = executable('systemd-run',
1976 'src/run/run.c',
1977 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001978 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001979 install_rpath : rootlibexecdir,
1980 install : true)
1981public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001982
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001983exe = executable('systemd-stdio-bridge',
1984 'src/stdio-bridge/stdio-bridge.c',
1985 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001986 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001987 install_rpath : rootlibexecdir,
1988 install : true)
1989public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001990
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001991exe = executable('busctl',
1992 'src/busctl/busctl.c',
1993 'src/busctl/busctl-introspect.c',
1994 'src/busctl/busctl-introspect.h',
1995 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001996 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001997 install_rpath : rootlibexecdir,
1998 install : true)
1999public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002000
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002001if conf.get('ENABLE_SYSUSERS', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002002 exe = executable('systemd-sysusers',
2003 'src/sysusers/sysusers.c',
2004 include_directories : includes,
2005 link_with : [libshared],
2006 install_rpath : rootlibexecdir,
2007 install : true,
2008 install_dir : rootbindir)
2009 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002010endif
2011
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002012if conf.get('ENABLE_TMPFILES', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002013 exe = executable('systemd-tmpfiles',
2014 'src/tmpfiles/tmpfiles.c',
2015 include_directories : includes,
2016 link_with : [libshared],
2017 dependencies : [libacl],
2018 install_rpath : rootlibexecdir,
2019 install : true,
2020 install_dir : rootbindir)
2021 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002022endif
2023
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002024if conf.get('ENABLE_HWDB', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002025 exe = executable('systemd-hwdb',
2026 'src/hwdb/hwdb.c',
2027 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2028 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002029 link_with : [libudev_internal],
2030 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002031 install : true,
2032 install_dir : rootbindir)
2033 public_programs += [exe]
2034endif
2035
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002036if conf.get('ENABLE_QUOTACHECK', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002037 executable('systemd-quotacheck',
2038 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002039 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002040 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002041 install_rpath : rootlibexecdir,
2042 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002043 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002044endif
2045
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002046exe = executable('systemd-socket-proxyd',
2047 'src/socket-proxy/socket-proxyd.c',
2048 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002049 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002050 dependencies : [threads],
2051 install_rpath : rootlibexecdir,
2052 install : true,
2053 install_dir : rootlibexecdir)
2054public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002055
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002056exe = executable('systemd-udevd',
2057 systemd_udevd_sources,
2058 include_directories : includes,
2059 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002060 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002061 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002062 dependencies : [threads,
2063 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002064 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002065 libacl,
2066 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002067 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002068 install : true,
2069 install_dir : rootlibexecdir)
2070public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002071
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002072exe = executable('udevadm',
2073 udevadm_sources,
2074 include_directories : includes,
2075 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002076 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002077 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002078 dependencies : [threads,
2079 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002080 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002081 libacl,
2082 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002083 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002084 install : true,
2085 install_dir : rootbindir)
2086public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002087
2088executable('systemd-shutdown',
2089 systemd_shutdown_sources,
2090 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002091 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002092 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002093 install : true,
2094 install_dir : rootlibexecdir)
2095
2096executable('systemd-update-done',
2097 'src/update-done/update-done.c',
2098 include_directories : includes,
2099 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002100 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002101 install : true,
2102 install_dir : rootlibexecdir)
2103
2104executable('systemd-update-utmp',
2105 'src/update-utmp/update-utmp.c',
2106 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002107 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002108 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002109 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002110 install : true,
2111 install_dir : rootlibexecdir)
2112
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002113if conf.get('HAVE_KMOD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002114 executable('systemd-modules-load',
2115 'src/modules-load/modules-load.c',
2116 include_directories : includes,
2117 link_with : [libshared],
2118 dependencies : [libkmod],
2119 install_rpath : rootlibexecdir,
2120 install : true,
2121 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002122
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002123 meson.add_install_script('sh', '-c',
2124 mkdir_p.format(modulesloaddir))
2125 meson.add_install_script('sh', '-c',
2126 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002127endif
2128
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002129exe = executable('systemd-nspawn',
2130 systemd_nspawn_sources,
2131 'src/core/mount-setup.c', # FIXME: use a variable?
2132 'src/core/mount-setup.h',
2133 'src/core/loopback-setup.c',
2134 'src/core/loopback-setup.h',
2135 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002136 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002137 dependencies : [libacl,
2138 libblkid,
2139 libseccomp,
2140 libselinux],
2141 install_rpath : rootlibexecdir,
2142 install : true)
2143public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002144
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002145if conf.get('ENABLE_NETWORKD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002146 executable('systemd-networkd',
2147 systemd_networkd_sources,
2148 include_directories : includes,
2149 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002150 libsystemd_network,
2151 libudev_internal,
2152 libshared],
2153 install_rpath : rootlibexecdir,
2154 install : true,
2155 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002156
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002157 executable('systemd-networkd-wait-online',
2158 systemd_networkd_wait_online_sources,
2159 include_directories : includes,
2160 link_with : [libnetworkd_core,
2161 libshared],
2162 install_rpath : rootlibexecdir,
2163 install : true,
2164 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmekf0bd7cc2017-04-12 12:14:30 -04002165endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002166
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002167exe = executable('networkctl',
2168 networkctl_sources,
2169 include_directories : includes,
2170 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002171 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002172 install_rpath : rootlibexecdir,
2173 install : true,
2174 install_dir : rootbindir)
2175public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002176
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002177############################################################
2178
2179foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002180 sources = tuple[0]
2181 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2182 dependencies = tuple[2]
2183 condition = tuple.length() >= 4 ? tuple[3] : ''
2184 type = tuple.length() >= 5 ? tuple[4] : ''
2185 defs = tuple.length() >= 6 ? tuple[5] : []
2186 incs = tuple.length() >= 7 ? tuple[6] : includes
2187 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002188
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002189 name = sources[0].split('/')[-1].split('.')[0]
2190 if type.startswith('timeout=')
2191 timeout = type.split('=')[1].to_int()
2192 type = ''
2193 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002194
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002195 if condition == '' or conf.get(condition, false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002196 install = install_tests and type == ''
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002197
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002198 exe = executable(
2199 name,
2200 sources,
2201 include_directories : incs,
2202 link_with : link_with,
2203 dependencies : dependencies,
2204 c_args : defs,
2205 install_rpath : rootlibexecdir,
2206 install : install,
2207 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002208
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002209 if type == 'manual'
2210 message('@0@ is a manual test'.format(name))
2211 elif type == 'unsafe' and want_tests != 'unsafe'
2212 message('@0@ is an unsafe test'.format(name))
2213 else
2214 test(name, exe,
2215 env : test_env,
2216 timeout : timeout)
2217 endif
2218 else
2219 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2220 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002221endforeach
2222
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002223test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002224 'test-libsystemd-sym',
2225 test_libsystemd_sym_c,
2226 include_directories : includes,
2227 link_with : [libsystemd],
2228 install : install_tests,
2229 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002230test('test-libsystemd-sym',
2231 test_libsystemd_sym)
2232
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002233test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002234 'test-libudev-sym',
2235 test_libudev_sym_c,
2236 include_directories : includes,
2237 c_args : ['-Wno-deprecated-declarations'],
2238 link_with : [libudev],
2239 install : install_tests,
2240 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002241test('test-libudev-sym',
2242 test_libudev_sym)
2243
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002244############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002245
2246make_directive_index_py = find_program('tools/make-directive-index.py')
2247make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002248xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002249hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002250
2251subdir('units')
2252subdir('sysctl.d')
2253subdir('sysusers.d')
2254subdir('tmpfiles.d')
2255subdir('rules')
2256subdir('hwdb')
2257subdir('network')
2258subdir('man')
2259subdir('shell-completion/bash')
2260subdir('shell-completion/zsh')
2261subdir('docs/sysvinit')
2262subdir('docs/var-log')
2263
2264# FIXME: figure out if the warning is true:
2265# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2266install_subdir('factory/etc',
2267 install_dir : factorydir)
2268
2269
2270install_data('xorg/50-systemd-user.sh',
2271 install_dir : xinitrcdir)
2272install_data('system-preset/90-systemd.preset',
2273 install_dir : systempresetdir)
2274install_data('README',
2275 'NEWS',
2276 'CODING_STYLE',
2277 'DISTRO_PORTING',
2278 'ENVIRONMENT.md',
2279 'LICENSE.GPL2',
2280 'LICENSE.LGPL2.1',
2281 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2282 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002283
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002284meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2285meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2286
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002287############################################################
2288
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002289meson_check_help = find_program('tools/meson-check-help.sh')
2290
2291foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002292 name = exec.full_path().split('/')[-1]
2293 test('check-help-' + name,
2294 meson_check_help,
2295 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002296endforeach
2297
2298############################################################
2299
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002300if git.found() and etags.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002301 all_files = run_command(
2302 git,
2303 ['--git-dir=@0@/.git'.format(meson.source_root()),
2304 'ls-files',
2305 ':/*.[ch]'])
2306 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002307
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002308 custom_target(
2309 'TAGS',
2310 output : 'TAGS',
2311 input : all_files,
2312 command : [etags, '-o', '@OUTPUT@'] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002313endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002314
2315if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002316 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002317 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002318 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002319 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002320endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002321
2322if git.found()
2323 git_head = run_command(
2324 git,
2325 ['--git-dir=@0@/.git'.format(meson.source_root()),
2326 'rev-parse', 'HEAD']).stdout().strip()
2327 git_head_short = run_command(
2328 git,
2329 ['--git-dir=@0@/.git'.format(meson.source_root()),
2330 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2331
2332 run_target(
2333 'git-snapshot',
2334 command : ['git', 'archive',
2335 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2336 git_head_short),
2337 '--prefix', 'systemd-@0@/'.format(git_head),
2338 'HEAD'])
2339endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002340
2341############################################################
2342
2343status = [
2344 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2345
2346 'prefix: @0@'.format(prefixdir),
2347 'rootprefix: @0@'.format(rootprefixdir),
2348 'sysconf dir: @0@'.format(sysconfdir),
2349 'includedir: @0@'.format(includedir),
2350 'lib dir: @0@'.format(libdir),
2351 'rootlib dir: @0@'.format(rootlibdir),
2352 'SysV init scripts: @0@'.format(sysvinit_path),
2353 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2354 'PAM modules dir: @0@'.format(pamlibdir),
2355 'PAM configuration dir: @0@'.format(pamconfdir),
2356 'RPM macros dir: @0@'.format(rpmmacrosdir),
2357 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2358 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2359 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2360 'bash completions dir: @0@'.format(bashcompletiondir),
2361 'zsh completions dir: @0@'.format(zshcompletiondir),
2362 'extra start script: @0@'.format(get_option('rc-local')),
2363 'extra stop script: @0@'.format(get_option('halt-local')),
2364 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2365 get_option('debug-tty')),
2366 'TTY GID: @0@'.format(tty_gid),
2367 'maximum system UID: @0@'.format(system_uid_max),
2368 'maximum system GID: @0@'.format(system_gid_max),
2369 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2370 'certificate root: @0@'.format(get_option('certificate-root')),
2371 'support URL: @0@'.format(support_url),
2372 'nobody user name: @0@'.format(get_option('nobody-user')),
2373 'nobody group name: @0@'.format(get_option('nobody-group')),
2374 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2375
2376 'default DNSSEC mode: @0@'.format(default_dnssec),
2377 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2378 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2379
2380alt_dns_servers = '\n '.join(dns_servers.split(' '))
2381alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2382status += [
2383 'default DNS servers: @0@'.format(alt_dns_servers),
2384 'default NTP servers: @0@'.format(alt_ntp_servers)]
2385
2386alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2387 '@@0@'.format(time_epoch)).stdout().strip()
2388status += [
2389 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2390
2391# TODO:
2392# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2393# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2394# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2395
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002396if conf.get('ENABLE_EFI', false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002397 status += [
2398 'efi arch: @0@'.format(efi_arch)]
2399
2400 if have_gnu_efi
2401 status += [
2402 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2403 'EFI CC @0@'.format(efi_cc),
2404 'EFI libdir: @0@'.format(efi_libdir),
2405 'EFI ldsdir: @0@'.format(efi_ldsdir),
2406 'EFI includedir: @0@'.format(efi_incdir)]
2407 endif
2408endif
2409
2410found = []
2411missing = []
2412
2413foreach tuple : [
2414 ['libcryptsetup'],
2415 ['PAM'],
2416 ['AUDIT'],
2417 ['IMA'],
2418 ['AppArmor'],
2419 ['SELinux'],
2420 ['SECCOMP'],
2421 ['SMACK'],
2422 ['zlib'],
2423 ['xz'],
2424 ['lz4'],
2425 ['bzip2'],
2426 ['ACL'],
2427 ['gcrypt'],
2428 ['qrencode'],
2429 ['microhttpd'],
2430 ['gnutls'],
2431 ['libcurl'],
2432 ['libidn'],
2433 ['libiptc'],
2434 ['elfutils'],
2435 ['binfmt'],
2436 ['vconsole'],
2437 ['quotacheck'],
2438 ['tmpfiles'],
2439 ['environment.d'],
2440 ['sysusers'],
2441 ['firstboot'],
2442 ['randomseed'],
2443 ['backlight'],
2444 ['rfkill'],
2445 ['logind'],
2446 ['machined'],
2447 ['importd'],
2448 ['hostnamed'],
2449 ['timedated'],
2450 ['timesyncd'],
2451 ['localed'],
2452 ['networkd'],
2453 ['resolved'],
2454 ['coredump'],
2455 ['polkit'],
2456 ['legacy pkla', install_polkit_pkla],
2457 ['efi'],
2458 ['gnu-efi', have_gnu_efi],
2459 ['kmod'],
2460 ['xkbcommon'],
2461 ['blkid'],
2462 ['dbus'],
2463 ['glib'],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002464 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002465 ['hwdb'],
2466 ['tpm'],
2467 ['man pages', want_man],
2468 ['html pages', want_html],
2469 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002470 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002471 ['SysV compat'],
2472 ['utmp'],
2473 ['ldconfig'],
2474 ['hibernate'],
2475 ['adm group', get_option('adm-group')],
2476 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002477 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002478 ['debug hashmap'],
2479 ['debug mmap cache'],
2480]
2481
2482 cond = tuple.get(1, '')
2483 if cond == ''
2484 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2485 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002486 cond = conf.get(ident1, false) or conf.get(ident2, false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002487 endif
2488 if cond
2489 found += [tuple[0]]
2490 else
2491 missing += [tuple[0]]
2492 endif
2493endforeach
2494
2495status += [
2496 'enabled features: @0@'.format(', '.join(found)),
2497 'disabled features: @0@'.format(', '.join(missing))]
2498message('\n '.join(status))