blob: 133ae57cf819523015c5c42a3d346dc1bb8caf7d [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-Szmek37efbbd2017-04-17 19:25:00 -040031 conf.set('HAVE_SPLIT_USR', 1)
32 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-Szmek37efbbd2017-04-17 19:25:00 -040040 conf.set('HAVE_SYSV_COMPAT', 1,
41 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
346conf.set('_GNU_SOURCE', 1)
347conf.set('__SANE_USERSPACE_TYPES__', 1)
348
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-Szmek37efbbd2017-04-17 19:25:00 -0400368 if cc.sizeof(decl, prefix : decl_headers) > 0
369 # We get -1 if the size cannot be determined
370 conf.set('HAVE_' + decl.underscorify().to_upper(), 1)
371 endif
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)
405 conf.set('HAVE_' + ident.to_upper(), 1)
406 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>''')
434 conf.set('USE_SYS_RANDOM_H', 1)
435 conf.set10('HAVE_DECL_GETRANDOM', 1)
436else
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-Szmek37efbbd2017-04-17 19:25:00 -0400527 if cc.has_header(header)
528 conf.set('HAVE_' + header.underscorify().to_upper(), 1)
529 endif
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
605conf.set_quoted('DNS_SERVERS', get_option('dns-servers'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400606substs.set('DNS_SERVERS', get_option('dns-servers'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400607
608conf.set_quoted('NTP_SERVERS', get_option('ntp-servers'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400609substs.set('NTP_SERVERS', get_option('ntp-servers'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400610
611conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
612
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400613substs.set('SUSHELL', get_option('debug-shell'))
614substs.set('DEBUGTTY', get_option('debug-tty'))
615
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400616debug = get_option('debug')
617if debug != ''
618 foreach name : debug.split(',')
619 if name == 'hashmap'
620 conf.set('ENABLE_DEBUG_HASHMAP', 1)
621 elif name == 'mmap-cache'
622 conf.set('ENABLE_DEBUG_MMAP_CACHE', 1)
623 else
624 message('unknown debug option "@0@", ignoring'.format(name))
625 endif
626 endforeach
627endif
628
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400629#####################################################################
630
631threads = dependency('threads')
632librt = cc.find_library('rt')
633libm = cc.find_library('m')
634libdl = cc.find_library('dl')
635libcrypt = cc.find_library('crypt')
636
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400637libcap = dependency('libcap', required : false)
638if not libcap.found()
639 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
640 libcap = cc.find_library('cap')
641endif
642
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400643libmount = dependency('mount',
644 version : '>= 2.27')
645
646want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400647if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400648 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400649 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400650 required : want_seccomp == 'true')
651 if libseccomp.found()
652 conf.set('HAVE_SECCOMP', 1)
653 m4_defines += ['-DHAVE_SECCOMP']
654 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400655else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400656 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400657endif
658
659want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400660if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400661 libselinux = dependency('libselinux',
662 version : '>= 2.1.9',
663 required : want_selinux == 'true')
664 if libselinux.found()
665 conf.set('HAVE_SELINUX', 1)
666 m4_defines += ['-DHAVE_SELINUX']
667 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400668else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400669 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400670endif
671
672want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400673if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400674 libapparmor = dependency('libapparmor',
675 required : want_apparmor == 'true')
676 if libapparmor.found()
677 conf.set('HAVE_APPARMOR', 1)
678 m4_defines += ['-DHAVE_APPARMOR']
679 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400680else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400681 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400682endif
683
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400684smack_run_label = get_option('smack-run-label')
685if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400686 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
687 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400688endif
689
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400690want_polkit = get_option('polkit')
691install_polkit = false
692install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400693if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400694 conf.set('ENABLE_POLKIT', 1)
695 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400696
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400697 libpolkit = dependency('polkit-gobject-1',
698 required : false)
699 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
700 message('Old polkit detected, will install pkla files')
701 install_polkit_pkla = true
702 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400703endif
704
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400705want_acl = get_option('acl')
706if want_acl != 'false'
707 libacl = cc.find_library('acl', required : want_acl == 'true')
708 if libacl.found()
709 conf.set('HAVE_ACL', 1)
710 m4_defines += ['-DHAVE_ACL']
711 endif
712else
713 libacl = []
714endif
715
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400716want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400717if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400718 libaudit = dependency('audit', required : want_audit == 'true')
719 if libaudit.found()
720 conf.set('HAVE_AUDIT', 1)
721 endif
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')
729 if libblkid.found()
730 conf.set('HAVE_BLKID', 1)
731 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400732else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400733 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400734endif
735
736want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400737if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400738 libkmod = dependency('libkmod',
739 version : '>= 15',
740 required : want_kmod == 'true')
741 if libkmod.found()
742 conf.set('HAVE_KMOD', 1)
743 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400744else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400745 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400746endif
747
748want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400749if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400750 libpam = cc.find_library('pam', required : want_pam == 'true')
751 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
752 if libpam.found() and libpam_misc.found()
753 conf.set('HAVE_PAM', 1)
754 m4_defines += ['-DHAVE_PAM']
755 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400756else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400757 libpam = []
758 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400759endif
760
761want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400762if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400763 libmicrohttpd = dependency('libmicrohttpd',
764 version : '>= 0.9.33',
765 required : want_microhttpd == 'true')
766 if libmicrohttpd.found()
767 conf.set('HAVE_MICROHTTPD', 1)
768 m4_defines += ['-DHAVE_MICROHTTPD']
769 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400770else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400771 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400772endif
773
774want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400775if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400776 libcryptsetup = dependency('libcryptsetup',
777 version : '>= 1.6.0',
778 required : want_libcryptsetup == 'true')
779 if libcryptsetup.found()
780 conf.set('HAVE_LIBCRYPTSETUP', 1)
781 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400782else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400783 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400784endif
785
786want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400787if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400788 libcurl = dependency('libcurl',
789 version : '>= 7.32.0',
790 required : want_libcurl == 'true')
791 if libcurl.found()
792 conf.set('HAVE_LIBCURL', 1)
793 m4_defines += ['-DHAVE_LIBCURL']
794 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400795else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400796 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400797endif
798
799want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400800if want_libidn != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400801 libidn = dependency('libidn',
802 required : want_libidn == 'true')
803 if libidn.found()
804 conf.set('HAVE_LIBIDN', 1)
805 m4_defines += ['-DHAVE_LIBIDN']
806 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400807else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400808 libidn = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400809endif
810
811want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400812if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400813 libiptc = dependency('libiptc',
814 required : want_libiptc == 'true')
815 if libiptc.found()
816 conf.set('HAVE_LIBIPTC', 1)
817 m4_defines += ['-DHAVE_LIBIPTC']
818 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400819else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400820 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400821endif
822
823want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400824if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400825 libqrencode = dependency('libqrencode',
826 required : want_qrencode == 'true')
827 if libqrencode.found()
828 conf.set('HAVE_QRENCODE', 1)
829 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400830else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400831 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400832endif
833
834want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400835if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400836 libgnutls = dependency('gnutls',
837 version : '>= 3.1.4',
838 required : want_gnutls == 'true')
839 if libgnutls.found()
840 conf.set('HAVE_GNUTLS', 1)
841 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400842else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400843 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400844endif
845
846want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400847if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400848 libdw = dependency('libdw',
849 required : want_elfutils == 'true')
850 if libdw.found()
851 conf.set('HAVE_ELFUTILS', 1)
852 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400853else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400854 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400855endif
856
857want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400858if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400859 libz = dependency('zlib',
860 required : want_zlib == 'true')
861 if libz.found()
862 conf.set('HAVE_ZLIB', 1)
863 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400864else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400865 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400866endif
867
868want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400869if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400870 libbzip2 = cc.find_library('bz2',
871 required : want_bzip2 == 'true')
872 if libbzip2.found()
873 conf.set('HAVE_BZIP2', 1)
874 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400875else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400876 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400877endif
878
879want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400880if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400881 libxz = dependency('liblzma',
882 required : want_xz == 'true')
883 if libxz.found()
884 conf.set('HAVE_XZ', 1)
885 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400886else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400887 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400888endif
889
890want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400891if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400892 liblz4 = dependency('liblz4',
893 required : want_lz4 == 'true')
894 if liblz4.found()
895 conf.set('HAVE_LZ4', 1)
896 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400897else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400898 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400899endif
900
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400901want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400902if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400903 libglib = dependency('glib-2.0',
904 version : '>= 2.22.0',
905 required : want_glib == 'true')
906 libgobject = dependency('gobject-2.0',
907 version : '>= 2.22.0',
908 required : want_glib == 'true')
909 libgio = dependency('gio-2.0',
910 required : want_glib == 'true')
911 if libglib.found() and libgobject.found() and libgio.found()
912 conf.set('HAVE_GLIB', 1)
913 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400914else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400915 libglib = []
916 libgobject = []
917 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400918endif
919
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400920want_xkbcommon = get_option('xkbcommon')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400921if want_xkbcommon != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400922 libxkbcommon = dependency('xkbcommon',
923 version : '>= 0.3.0',
924 required : want_xkbcommon == 'true')
925 if libxkbcommon.found()
926 conf.set('HAVE_XKBCOMMON', 1)
927 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400928else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400929 libxkbcommon = []
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400930endif
931
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400932want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400933if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400934 libdbus = dependency('dbus-1',
935 version : '>= 1.3.2',
936 required : want_dbus == 'true')
937 if libdbus.found()
938 conf.set('HAVE_DBUS', 1)
939 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400940else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400941 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400942endif
943
Michael Biebl76c87412017-04-21 23:45:54 +0200944want_gcrypt = get_option('gcrypt')
945if want_gcrypt != 'false'
946 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
947 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
948
949 if libgcrypt.found() and libgpg_error.found()
950 conf.set('HAVE_GCRYPT', 1)
951 else
952 # link to neither of the libs if one is not found
953 libgcrypt = []
954 libgpg_error = []
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400955 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400956else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400957 libgcrypt = []
Michael Biebl76c87412017-04-21 23:45:54 +0200958 libgpg_error = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400959endif
960
961want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400962if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400963 have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and
964 conf.get('HAVE_ZLIB', 0) == 1 and
965 conf.get('HAVE_BZIP2', 0) == 1 and
966 conf.get('HAVE_XZ', 0) == 1 and
Michael Biebl76c87412017-04-21 23:45:54 +0200967 conf.get('HAVE_GCRYPT', 0) == 1)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400968 if have_deps
969 conf.set('ENABLE_IMPORTD', 1)
970 elif want_importd == 'true'
971 error('importd support was requested, but dependencies are not available')
972 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400973endif
974
975want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400976if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400977 have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1,
978 conf.get('HAVE_LIBCURL', 0) == 1]
979 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
980 # it's possible to build one without the other. Complain only if
981 # support was explictly requested. The auxiliary files like sysusers
982 # config should be installed when any of the programs are built.
983 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
984 error('remote support was requested, but dependencies are not available')
985 endif
986 if have_deps[0] or have_deps[1]
987 conf.set('ENABLE_REMOTE', 1)
988 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400989endif
990
991foreach pair : [['utmp', 'HAVE_UTMP'],
992 ['hibernate', 'ENABLE_HIBERNATE'],
993 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
994 ['binfmt', 'ENABLE_BINFMT'],
995 ['coredump', 'ENABLE_COREDUMP'],
996 ['resolve', 'ENABLE_RESOLVED'],
997 ['logind', 'ENABLE_LOGIND'],
998 ['hostnamed', 'ENABLE_HOSTNAMED'],
999 ['localed', 'ENABLE_LOCALED'],
1000 ['machined', 'ENABLE_MACHINED'],
1001 ['networkd', 'ENABLE_NETWORKD'],
1002 ['timedated', 'ENABLE_TIMEDATED'],
1003 ['timesyncd', 'ENABLE_TIMESYNCD'],
1004 ['myhostname', 'HAVE_MYHOSTNAME'],
1005 ['firstboot', 'ENABLE_FIRSTBOOT'],
1006 ['randomseed', 'ENABLE_RANDOMSEED'],
1007 ['backlight', 'ENABLE_BACKLIGHT'],
1008 ['vconsole', 'ENABLE_VCONSOLE'],
1009 ['quotacheck', 'ENABLE_QUOTACHECK'],
1010 ['sysusers', 'ENABLE_SYSUSERS'],
1011 ['tmpfiles', 'ENABLE_TMPFILES'],
1012 ['hwdb', 'ENABLE_HWDB'],
1013 ['rfkill', 'ENABLE_RFKILL'],
1014 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001015 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001016 ['tpm', 'SD_BOOT_LOG_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -04001017 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -04001018 ['smack', 'HAVE_SMACK'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001019 ]
1020
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001021 if get_option(pair[0])
1022 conf.set(pair[1], 1)
1023 m4_defines += ['-D' + pair[1]]
1024 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001025endforeach
1026
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001027want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001028install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001029tests = []
1030
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001031#####################################################################
1032
1033if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001034 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001035
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001036 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001037 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001038 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001039 elif efi_arch == 'x86_64'
1040 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001041 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001042 elif efi_arch == 'arm'
1043 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001044 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001045 elif efi_arch == 'aarch64'
1046 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001047 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001048 else
1049 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001050 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001051 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001052
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001053 conf.set('ENABLE_EFI', 1)
1054 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001055
1056 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001057endif
1058
1059#####################################################################
1060
1061config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001062 output : 'config.h',
1063 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001064
1065includes = include_directories('src/basic',
1066 'src/shared',
1067 'src/systemd',
1068 'src/journal',
1069 'src/resolve',
1070 'src/timesync',
1071 'src/login',
1072 'src/udev',
1073 'src/libudev',
1074 'src/core',
1075 'src/libsystemd/sd-bus',
1076 'src/libsystemd/sd-device',
1077 'src/libsystemd/sd-hwdb',
1078 'src/libsystemd/sd-id128',
1079 'src/libsystemd/sd-netlink',
1080 'src/libsystemd/sd-network',
1081 'src/libsystemd-network',
1082 )
1083
1084add_project_arguments('-include', 'config.h', language : 'c')
1085
1086gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1087 'src/shared/gcrypt-util.c')
1088
1089subdir('po')
1090subdir('catalog')
1091subdir('src/systemd')
1092subdir('src/basic')
1093subdir('src/libsystemd')
1094subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001095subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001096subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001097
1098libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001099 'journal-core',
1100 libjournal_core_sources,
1101 journald_gperf_c,
1102 include_directories : includes,
1103 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001104
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001105libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001106libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001107 'systemd',
1108 libsystemd_internal_sources,
1109 journal_internal_sources,
1110 version : '0.18.0',
1111 include_directories : includes,
1112 link_args : ['-shared',
1113 '-Wl,--version-script=' + libsystemd_sym_path],
1114 link_with : [libbasic],
1115 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001116 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001117 librt,
1118 libxz,
1119 liblz4],
1120 link_depends : libsystemd_sym,
1121 install : true,
1122 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001123
1124############################################################
1125
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001126# binaries that have --help and are intended for use by humans,
1127# usually, but not always, installed in /bin.
1128public_programs = []
1129
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001130subdir('src/libudev')
1131subdir('src/shared')
1132subdir('src/core')
1133subdir('src/udev')
1134subdir('src/network')
1135
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001136subdir('src/analyze')
1137subdir('src/journal-remote')
1138subdir('src/coredump')
1139subdir('src/hostname')
1140subdir('src/import')
1141subdir('src/kernel-install')
1142subdir('src/locale')
1143subdir('src/machine')
1144subdir('src/nspawn')
1145subdir('src/resolve')
1146subdir('src/timedate')
1147subdir('src/timesync')
1148subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001149subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001150subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001151
1152subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001153subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001154
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001155############################################################
1156
1157# only static linking apart from libdl, to make sure that the
1158# module is linked to all libraries that it uses.
1159test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001160 'test-dlopen',
1161 test_dlopen_c,
1162 include_directories : includes,
1163 link_with : [libbasic],
1164 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001165
1166foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
1167 ['systemd', '', []],
1168 ['mymachines', 'ENABLE_MACHINED', []],
1169 ['resolve', 'ENABLE_RESOLVED', [libdl]]]
1170
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001171 condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1
1172 if condition
1173 module = tuple[0]
1174 extra_deps = tuple[2]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001175
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001176 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1177 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001178
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001179 nss = shared_library(
1180 'nss_' + module,
1181 'src/nss-@0@/nss-@0@.c'.format(module),
1182 version : '2',
1183 include_directories : includes,
1184 link_args : ['-shared',
1185 '-Wl,--version-script=' + version_script_arg,
1186 '-Wl,--undefined'],
1187 link_with : [libsystemd_internal,
1188 libbasic],
1189 dependencies : [threads,
1190 librt] + extra_deps,
1191 link_depends : sym,
1192 install : true,
1193 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001194
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001195 # We cannot use shared_module because it does not support version suffix.
1196 # Unfortunately shared_library insists on creating the symlink…
1197 meson.add_install_script('sh', '-c',
1198 'rm $DESTDIR@0@/libnss_@1@.so'
1199 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001200
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001201 test('dlopen-nss_' + module,
1202 test_dlopen,
1203 args : [nss.full_path()]) # path to dlopen must include a slash
1204 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001205endforeach
1206
1207############################################################
1208
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001209executable('systemd',
1210 systemd_sources,
1211 include_directories : includes,
1212 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001213 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001214 dependencies : [threads,
1215 librt,
1216 libseccomp,
1217 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001218 libmount,
1219 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001220 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001221 install : true,
1222 install_dir : rootlibexecdir)
1223
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001224exe = executable('systemd-analyze',
1225 systemd_analyze_sources,
1226 include_directories : includes,
1227 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001228 libshared],
1229 dependencies : [threads,
1230 librt,
1231 libseccomp,
1232 libselinux,
1233 libmount,
1234 libblkid],
1235 install_rpath : rootlibexecdir,
1236 install : true)
1237public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001238
1239executable('systemd-journald',
1240 systemd_journald_sources,
1241 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001242 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001243 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001244 dependencies : [threads,
1245 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001246 liblz4,
1247 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001248 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001249 install : true,
1250 install_dir : rootlibexecdir)
1251
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001252exe = executable('systemd-cat',
1253 systemd_cat_sources,
1254 include_directories : includes,
1255 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001256 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001257 dependencies : [threads],
1258 install_rpath : rootlibexecdir,
1259 install : true)
1260public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001261
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001262exe = executable('journalctl',
1263 journalctl_sources,
1264 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001265 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001266 dependencies : [threads,
1267 libqrencode,
1268 libxz,
1269 liblz4],
1270 install_rpath : rootlibexecdir,
1271 install : true,
1272 install_dir : rootbindir)
1273public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001274
1275executable('systemd-getty-generator',
1276 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001277 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001278 link_with : [libshared],
1279 install_rpath : rootlibexecdir,
1280 install : true,
1281 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001282
1283executable('systemd-debug-generator',
1284 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001285 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001286 link_with : [libshared],
1287 install_rpath : rootlibexecdir,
1288 install : true,
1289 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001290
1291executable('systemd-fstab-generator',
1292 'src/fstab-generator/fstab-generator.c',
1293 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001294 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001295 link_with : [libshared],
1296 install_rpath : rootlibexecdir,
1297 install : true,
1298 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001299
1300if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001301 executable('30-systemd-environment-d-generator',
1302 'src/environment-d-generator/environment-d-generator.c',
1303 include_directories : includes,
1304 link_with : [libshared],
1305 install_rpath : rootlibexecdir,
1306 install : true,
1307 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001308
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001309 meson.add_install_script(meson_make_symlink,
1310 join_paths(sysconfdir, 'environment'),
1311 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001312endif
1313
1314if conf.get('ENABLE_HIBERNATE', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001315 executable('systemd-hibernate-resume-generator',
1316 'src/hibernate-resume/hibernate-resume-generator.c',
1317 include_directories : includes,
1318 link_with : [libshared],
1319 install_rpath : rootlibexecdir,
1320 install : true,
1321 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001322
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001323 executable('systemd-hibernate-resume',
1324 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001325 include_directories : includes,
1326 link_with : [libshared],
1327 install_rpath : rootlibexecdir,
1328 install : true,
1329 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001330endif
1331
1332if conf.get('HAVE_BLKID', 0) == 1
1333 executable('systemd-gpt-auto-generator',
1334 'src/gpt-auto-generator/gpt-auto-generator.c',
1335 'src/basic/blkid-util.h',
1336 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001337 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001338 dependencies : libblkid,
1339 install_rpath : rootlibexecdir,
1340 install : true,
1341 install_dir : systemgeneratordir)
1342
1343 exe = executable('systemd-dissect',
1344 'src/dissect/dissect.c',
1345 include_directories : includes,
1346 link_with : [libshared],
1347 install_rpath : rootlibexecdir,
1348 install : true,
1349 install_dir : rootlibexecdir)
1350 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001351endif
1352
1353if conf.get('ENABLE_RESOLVED', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001354 executable('systemd-resolved',
1355 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001356 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001357 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001358 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001359 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001360 libgcrypt,
1361 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001362 libm,
1363 libidn],
1364 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001365 install : true,
1366 install_dir : rootlibexecdir)
1367
1368 exe = executable('systemd-resolve',
1369 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001370 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001371 include_directories : includes,
1372 link_with : [libshared],
1373 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001374 libgcrypt,
1375 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001376 libm,
1377 libidn],
1378 install_rpath : rootlibexecdir,
1379 install : true)
1380 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001381endif
1382
1383if conf.get('ENABLE_LOGIND', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001384 executable('systemd-logind',
1385 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001386 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001387 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001388 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001389 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001390 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001391 install_rpath : rootlibexecdir,
1392 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001393 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001394
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001395 exe = executable('loginctl',
1396 loginctl_sources,
1397 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001398 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001399 dependencies : [threads,
1400 liblz4,
1401 libxz],
1402 install_rpath : rootlibexecdir,
1403 install : true,
1404 install_dir : rootbindir)
1405 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001406
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001407 exe = executable('systemd-inhibit',
1408 'src/login/inhibit.c',
1409 include_directories : includes,
1410 link_with : [libshared],
1411 install_rpath : rootlibexecdir,
1412 install : true,
1413 install_dir : rootbindir)
1414 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001415
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001416 if conf.get('HAVE_PAM', 0) == 1
1417 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1418 pam_systemd = shared_library(
1419 'pam_systemd',
1420 pam_systemd_c,
1421 name_prefix : '',
1422 include_directories : includes,
1423 link_args : ['-shared',
1424 '-Wl,--version-script=' + version_script_arg],
1425 link_with : [libsystemd_internal,
1426 libshared_static],
1427 dependencies : [threads,
1428 libpam,
1429 libpam_misc],
1430 link_depends : pam_systemd_sym,
1431 install : true,
1432 install_dir : pamlibdir)
1433
1434 test('dlopen-pam_systemd',
1435 test_dlopen,
1436 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1437 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001438endif
1439
1440if conf.get('HAVE_PAM', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001441 executable('systemd-user-sessions',
1442 'src/user-sessions/user-sessions.c',
1443 include_directories : includes,
1444 link_with : [libshared],
1445 install_rpath : rootlibexecdir,
1446 install : true,
1447 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001448endif
1449
Zbigniew Jędrzejewski-Szmek8191c592017-04-12 12:36:20 -04001450if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001451 exe = executable('bootctl',
1452 'src/boot/bootctl.c',
1453 include_directories : includes,
1454 link_with : [libshared],
1455 dependencies : [libblkid],
1456 install_rpath : rootlibexecdir,
1457 install : true)
1458 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001459endif
1460
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001461exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1462 include_directories : includes,
1463 link_with : [libshared],
1464 dependencies : [threads],
1465 install_rpath : rootlibexecdir,
1466 install : true)
1467public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001468
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001469exe = executable('systemctl', 'src/systemctl/systemctl.c',
1470 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001471 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001472 dependencies : [threads,
1473 libcap,
1474 libselinux,
1475 libxz,
1476 liblz4],
1477 install_rpath : rootlibexecdir,
1478 install : true,
1479 install_dir : rootbindir)
1480public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001481
1482if conf.get('ENABLE_BACKLIGHT', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001483 executable('systemd-backlight',
1484 'src/backlight/backlight.c',
1485 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001486 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001487 install_rpath : rootlibexecdir,
1488 install : true,
1489 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001490endif
1491
1492if conf.get('ENABLE_RFKILL', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001493 executable('systemd-rfkill',
1494 'src/rfkill/rfkill.c',
1495 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001496 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001497 install_rpath : rootlibexecdir,
1498 install : true,
1499 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001500endif
1501
1502executable('systemd-system-update-generator',
1503 'src/system-update-generator/system-update-generator.c',
1504 include_directories : includes,
1505 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001506 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001507 install : true,
1508 install_dir : systemgeneratordir)
1509
1510if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001511 executable('systemd-cryptsetup',
1512 'src/cryptsetup/cryptsetup.c',
1513 include_directories : includes,
1514 link_with : [libshared],
1515 dependencies : [libcryptsetup],
1516 install_rpath : rootlibexecdir,
1517 install : true,
1518 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001519
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001520 executable('systemd-cryptsetup-generator',
1521 'src/cryptsetup/cryptsetup-generator.c',
1522 include_directories : includes,
1523 link_with : [libshared],
1524 dependencies : [libcryptsetup],
1525 install_rpath : rootlibexecdir,
1526 install : true,
1527 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001528
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001529 executable('systemd-veritysetup',
1530 'src/veritysetup/veritysetup.c',
1531 include_directories : includes,
1532 link_with : [libshared],
1533 dependencies : [libcryptsetup],
1534 install_rpath : rootlibexecdir,
1535 install : true,
1536 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001537
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001538 executable('systemd-veritysetup-generator',
1539 'src/veritysetup/veritysetup-generator.c',
1540 include_directories : includes,
1541 link_with : [libshared],
1542 dependencies : [libcryptsetup],
1543 install_rpath : rootlibexecdir,
1544 install : true,
1545 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001546endif
1547
1548if conf.get('HAVE_SYSV_COMPAT', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001549 executable('systemd-sysv-generator',
1550 'src/sysv-generator/sysv-generator.c',
1551 include_directories : includes,
1552 link_with : [libshared],
1553 install_rpath : rootlibexecdir,
1554 install : true,
1555 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001556
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001557 executable('systemd-rc-local-generator',
1558 'src/rc-local-generator/rc-local-generator.c',
1559 include_directories : includes,
1560 link_with : [libshared],
1561 install_rpath : rootlibexecdir,
1562 install : true,
1563 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001564endif
1565
1566if conf.get('ENABLE_HOSTNAMED', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001567 executable('systemd-hostnamed',
1568 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001569 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001570 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001571 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001572 install : true,
1573 install_dir : rootlibexecdir)
1574
1575 exe = executable('hostnamectl',
1576 'src/hostname/hostnamectl.c',
1577 include_directories : includes,
1578 link_with : [libshared],
1579 install_rpath : rootlibexecdir,
1580 install : true)
1581 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001582endif
1583
1584if conf.get('ENABLE_LOCALED', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001585 if conf.get('HAVE_XKBCOMMON', 0) == 1
1586 # logind will load libxkbcommon.so dynamically on its own
1587 deps = [libdl]
1588 else
1589 deps = []
1590 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001591
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001592 executable('systemd-localed',
1593 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001594 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001595 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001596 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001597 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001598 install : true,
1599 install_dir : rootlibexecdir)
1600
1601 exe = executable('localectl',
1602 localectl_sources,
1603 include_directories : includes,
1604 link_with : [libshared],
1605 install_rpath : rootlibexecdir,
1606 install : true)
1607 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001608endif
1609
1610if conf.get('ENABLE_TIMEDATED', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001611 executable('systemd-timedated',
1612 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001613 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001614 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001615 install_rpath : rootlibexecdir,
1616 install : true,
1617 install_dir : rootlibexecdir)
1618
1619 exe = executable('timedatectl',
1620 'src/timedate/timedatectl.c',
1621 include_directories : includes,
1622 install_rpath : rootlibexecdir,
1623 link_with : [libshared],
1624 install : true)
1625 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001626endif
1627
1628if conf.get('ENABLE_TIMESYNCD', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001629 executable('systemd-timesyncd',
1630 systemd_timesyncd_sources,
1631 include_directories : includes,
1632 link_with : [libshared],
1633 dependencies : [threads,
1634 libm],
1635 install_rpath : rootlibexecdir,
1636 install : true,
1637 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001638endif
1639
1640if conf.get('ENABLE_MACHINED', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001641 executable('systemd-machined',
1642 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001643 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001644 link_with : [libmachine_core,
1645 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001646 install_rpath : rootlibexecdir,
1647 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001648 install_dir : rootlibexecdir)
1649
1650 exe = executable('machinectl',
1651 'src/machine/machinectl.c',
1652 include_directories : includes,
1653 link_with : [libshared],
1654 dependencies : [threads,
1655 libxz,
1656 liblz4],
1657 install_rpath : rootlibexecdir,
1658 install : true,
1659 install_dir : rootbindir)
1660 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001661endif
1662
1663if conf.get('ENABLE_IMPORTD', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001664 executable('systemd-importd',
1665 systemd_importd_sources,
1666 include_directories : includes,
1667 link_with : [libshared],
1668 dependencies : [threads],
1669 install_rpath : rootlibexecdir,
1670 install : true,
1671 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001672
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001673 systemd_pull = executable('systemd-pull',
1674 systemd_pull_sources,
1675 include_directories : includes,
1676 link_with : [libshared],
1677 dependencies : [libcurl,
1678 libz,
1679 libbzip2,
1680 libxz,
1681 libgcrypt],
1682 install_rpath : rootlibexecdir,
1683 install : true,
1684 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001685
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001686 systemd_import = executable('systemd-import',
1687 systemd_import_sources,
1688 include_directories : includes,
1689 link_with : [libshared],
1690 dependencies : [libcurl,
1691 libz,
1692 libbzip2,
1693 libxz],
1694 install_rpath : rootlibexecdir,
1695 install : true,
1696 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001697
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001698 systemd_export = executable('systemd-export',
1699 systemd_export_sources,
1700 include_directories : includes,
1701 link_with : [libshared],
1702 dependencies : [libcurl,
1703 libz,
1704 libbzip2,
1705 libxz],
1706 install_rpath : rootlibexecdir,
1707 install : true,
1708 install_dir : rootlibexecdir)
1709 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001710endif
1711
1712if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001713 exe = executable('systemd-journal-upload',
1714 systemd_journal_upload_sources,
1715 include_directories : includes,
1716 link_with : [libshared],
1717 dependencies : [threads,
1718 libcurl,
1719 libgnutls,
1720 libxz,
1721 liblz4],
1722 install_rpath : rootlibexecdir,
1723 install : true,
1724 install_dir : rootlibexecdir)
1725 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001726endif
1727
1728if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001729 s_j_remote = executable('systemd-journal-remote',
1730 systemd_journal_remote_sources,
1731 include_directories : includes,
1732 link_with : [libshared],
1733 dependencies : [threads,
1734 libmicrohttpd,
1735 libgnutls,
1736 libxz,
1737 liblz4],
1738 install_rpath : rootlibexecdir,
1739 install : true,
1740 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001741
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001742 s_j_gatewayd = executable('systemd-journal-gatewayd',
1743 systemd_journal_gatewayd_sources,
1744 include_directories : includes,
1745 link_with : [libshared],
1746 dependencies : [threads,
1747 libmicrohttpd,
1748 libgnutls,
1749 libxz,
1750 liblz4],
1751 install_rpath : rootlibexecdir,
1752 install : true,
1753 install_dir : rootlibexecdir)
1754 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001755endif
1756
1757if conf.get('ENABLE_COREDUMP', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001758 executable('systemd-coredump',
1759 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001760 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001761 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001762 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001763 libacl,
1764 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001765 libxz,
1766 liblz4],
1767 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001768 install : true,
1769 install_dir : rootlibexecdir)
1770
1771 exe = executable('coredumpctl',
1772 coredumpctl_sources,
1773 include_directories : includes,
1774 link_with : [libshared],
1775 dependencies : [threads,
1776 libxz,
1777 liblz4],
1778 install_rpath : rootlibexecdir,
1779 install : true)
1780 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001781endif
1782
1783if conf.get('ENABLE_BINFMT', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001784 exe = executable('systemd-binfmt',
1785 'src/binfmt/binfmt.c',
1786 include_directories : includes,
1787 link_with : [libshared],
1788 install_rpath : rootlibexecdir,
1789 install : true,
1790 install_dir : rootlibexecdir)
1791 public_programs += [exe]
1792
1793 meson.add_install_script('sh', '-c',
1794 mkdir_p.format(binfmtdir))
1795 meson.add_install_script('sh', '-c',
1796 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1797endif
1798
1799if conf.get('ENABLE_VCONSOLE', 0) == 1
1800 executable('systemd-vconsole-setup',
1801 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001802 include_directories : includes,
1803 link_with : [libshared],
1804 install_rpath : rootlibexecdir,
1805 install : true,
1806 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001807endif
1808
1809if conf.get('ENABLE_RANDOMSEED', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001810 executable('systemd-random-seed',
1811 'src/random-seed/random-seed.c',
1812 include_directories : includes,
1813 link_with : [libshared],
1814 install_rpath : rootlibexecdir,
1815 install : true,
1816 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001817endif
1818
1819if conf.get('ENABLE_FIRSTBOOT', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001820 executable('systemd-firstboot',
1821 'src/firstboot/firstboot.c',
1822 include_directories : includes,
1823 link_with : [libshared],
1824 dependencies : [libcrypt],
1825 install_rpath : rootlibexecdir,
1826 install : true,
1827 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001828endif
1829
1830executable('systemd-remount-fs',
1831 'src/remount-fs/remount-fs.c',
1832 'src/core/mount-setup.c',
1833 'src/core/mount-setup.h',
1834 include_directories : includes,
1835 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001836 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001837 install : true,
1838 install_dir : rootlibexecdir)
1839
1840executable('systemd-machine-id-setup',
1841 'src/machine-id-setup/machine-id-setup-main.c',
1842 'src/core/machine-id-setup.c',
1843 'src/core/machine-id-setup.h',
1844 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001845 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001846 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001847 install : true,
1848 install_dir : rootbindir)
1849
1850executable('systemd-fsck',
1851 'src/fsck/fsck.c',
1852 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001853 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001854 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001855 install : true,
1856 install_dir : rootlibexecdir)
1857
1858executable('systemd-sleep',
1859 'src/sleep/sleep.c',
1860 include_directories : includes,
1861 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001862 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001863 install : true,
1864 install_dir : rootlibexecdir)
1865
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001866exe = executable('systemd-sysctl',
1867 'src/sysctl/sysctl.c',
1868 include_directories : includes,
1869 link_with : [libshared],
1870 install_rpath : rootlibexecdir,
1871 install : true,
1872 install_dir : rootlibexecdir)
1873public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001874
1875executable('systemd-ac-power',
1876 'src/ac-power/ac-power.c',
1877 include_directories : includes,
1878 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001879 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001880 install : true,
1881 install_dir : rootlibexecdir)
1882
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001883exe = executable('systemd-detect-virt',
1884 'src/detect-virt/detect-virt.c',
1885 include_directories : includes,
1886 link_with : [libshared],
1887 install_rpath : rootlibexecdir,
1888 install : true)
1889public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001890
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001891exe = executable('systemd-delta',
1892 'src/delta/delta.c',
1893 include_directories : includes,
1894 link_with : [libshared],
1895 install_rpath : rootlibexecdir,
1896 install : true)
1897public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001898
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001899exe = executable('systemd-escape',
1900 'src/escape/escape.c',
1901 include_directories : includes,
1902 link_with : [libshared],
1903 install_rpath : rootlibexecdir,
1904 install : true,
1905 install_dir : rootbindir)
1906public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001907
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001908exe = executable('systemd-notify',
1909 'src/notify/notify.c',
1910 include_directories : includes,
1911 link_with : [libshared],
1912 install_rpath : rootlibexecdir,
1913 install : true,
1914 install_dir : rootbindir)
1915public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001916
1917executable('systemd-volatile-root',
1918 'src/volatile-root/volatile-root.c',
1919 include_directories : includes,
1920 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001921 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001922 install : true,
1923 install_dir : rootlibexecdir)
1924
1925executable('systemd-cgroups-agent',
1926 'src/cgroups-agent/cgroups-agent.c',
1927 include_directories : includes,
1928 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001929 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001930 install : true,
1931 install_dir : rootlibexecdir)
1932
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001933exe = executable('systemd-path',
1934 'src/path/path.c',
1935 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001936 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001937 install_rpath : rootlibexecdir,
1938 install : true)
1939public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001940
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001941exe = executable('systemd-ask-password',
1942 'src/ask-password/ask-password.c',
1943 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001944 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001945 install_rpath : rootlibexecdir,
1946 install : true,
1947 install_dir : rootbindir)
1948public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001949
1950executable('systemd-reply-password',
1951 'src/reply-password/reply-password.c',
1952 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001953 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001954 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001955 install : true,
1956 install_dir : rootlibexecdir)
1957
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001958exe = executable('systemd-tty-ask-password-agent',
1959 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1960 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001961 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001962 install_rpath : rootlibexecdir,
1963 install : true,
1964 install_dir : rootbindir)
1965public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001966
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001967exe = executable('systemd-cgls',
1968 'src/cgls/cgls.c',
1969 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001970 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001971 install_rpath : rootlibexecdir,
1972 install : true)
1973public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001974
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001975exe = executable('systemd-cgtop',
1976 'src/cgtop/cgtop.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
1983executable('systemd-initctl',
1984 'src/initctl/initctl.c',
1985 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001986 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001987 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001988 install : true,
1989 install_dir : rootlibexecdir)
1990
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001991exe = executable('systemd-mount',
1992 'src/mount/mount-tool.c',
1993 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001994 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001995 install_rpath : rootlibexecdir,
1996 install : true)
1997public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001998
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001999meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002000 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002001
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002002exe = executable('systemd-run',
2003 'src/run/run.c',
2004 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002005 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002006 install_rpath : rootlibexecdir,
2007 install : true)
2008public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002009
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002010exe = executable('systemd-stdio-bridge',
2011 'src/stdio-bridge/stdio-bridge.c',
2012 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002013 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002014 install_rpath : rootlibexecdir,
2015 install : true)
2016public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002017
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002018exe = executable('busctl',
2019 'src/busctl/busctl.c',
2020 'src/busctl/busctl-introspect.c',
2021 'src/busctl/busctl-introspect.h',
2022 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002023 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002024 install_rpath : rootlibexecdir,
2025 install : true)
2026public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002027
2028if conf.get('ENABLE_SYSUSERS', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002029 exe = executable('systemd-sysusers',
2030 'src/sysusers/sysusers.c',
2031 include_directories : includes,
2032 link_with : [libshared],
2033 install_rpath : rootlibexecdir,
2034 install : true,
2035 install_dir : rootbindir)
2036 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002037endif
2038
2039if conf.get('ENABLE_TMPFILES', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002040 exe = executable('systemd-tmpfiles',
2041 'src/tmpfiles/tmpfiles.c',
2042 include_directories : includes,
2043 link_with : [libshared],
2044 dependencies : [libacl],
2045 install_rpath : rootlibexecdir,
2046 install : true,
2047 install_dir : rootbindir)
2048 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002049endif
2050
2051if conf.get('ENABLE_HWDB', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002052 exe = executable('systemd-hwdb',
2053 'src/hwdb/hwdb.c',
2054 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2055 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002056 link_with : [libudev_internal],
2057 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002058 install : true,
2059 install_dir : rootbindir)
2060 public_programs += [exe]
2061endif
2062
2063if conf.get('ENABLE_QUOTACHECK', 0) == 1
2064 executable('systemd-quotacheck',
2065 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002066 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002067 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002068 install_rpath : rootlibexecdir,
2069 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002070 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002071endif
2072
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002073exe = executable('systemd-socket-proxyd',
2074 'src/socket-proxy/socket-proxyd.c',
2075 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002076 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002077 dependencies : [threads],
2078 install_rpath : rootlibexecdir,
2079 install : true,
2080 install_dir : rootlibexecdir)
2081public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002082
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002083exe = executable('systemd-udevd',
2084 systemd_udevd_sources,
2085 include_directories : includes,
2086 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002087 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002088 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002089 dependencies : [threads,
2090 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002091 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002092 libacl,
2093 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002094 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002095 install : true,
2096 install_dir : rootlibexecdir)
2097public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002098
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002099exe = executable('udevadm',
2100 udevadm_sources,
2101 include_directories : includes,
2102 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002103 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002104 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002105 dependencies : [threads,
2106 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002107 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002108 libacl,
2109 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002110 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002111 install : true,
2112 install_dir : rootbindir)
2113public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002114
2115executable('systemd-shutdown',
2116 systemd_shutdown_sources,
2117 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002118 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002119 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002120 install : true,
2121 install_dir : rootlibexecdir)
2122
2123executable('systemd-update-done',
2124 'src/update-done/update-done.c',
2125 include_directories : includes,
2126 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002127 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002128 install : true,
2129 install_dir : rootlibexecdir)
2130
2131executable('systemd-update-utmp',
2132 'src/update-utmp/update-utmp.c',
2133 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002134 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002135 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002136 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002137 install : true,
2138 install_dir : rootlibexecdir)
2139
2140if conf.get('HAVE_KMOD', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002141 executable('systemd-modules-load',
2142 'src/modules-load/modules-load.c',
2143 include_directories : includes,
2144 link_with : [libshared],
2145 dependencies : [libkmod],
2146 install_rpath : rootlibexecdir,
2147 install : true,
2148 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002149
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002150 meson.add_install_script('sh', '-c',
2151 mkdir_p.format(modulesloaddir))
2152 meson.add_install_script('sh', '-c',
2153 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002154endif
2155
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002156exe = executable('systemd-nspawn',
2157 systemd_nspawn_sources,
2158 'src/core/mount-setup.c', # FIXME: use a variable?
2159 'src/core/mount-setup.h',
2160 'src/core/loopback-setup.c',
2161 'src/core/loopback-setup.h',
2162 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002163 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002164 dependencies : [libacl,
2165 libblkid,
2166 libseccomp,
2167 libselinux],
2168 install_rpath : rootlibexecdir,
2169 install : true)
2170public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002171
Zbigniew Jędrzejewski-Szmekf0bd7cc2017-04-12 12:14:30 -04002172if conf.get('ENABLE_NETWORKD', 0) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002173 executable('systemd-networkd',
2174 systemd_networkd_sources,
2175 include_directories : includes,
2176 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002177 libsystemd_network,
2178 libudev_internal,
2179 libshared],
2180 install_rpath : rootlibexecdir,
2181 install : true,
2182 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002183
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002184 executable('systemd-networkd-wait-online',
2185 systemd_networkd_wait_online_sources,
2186 include_directories : includes,
2187 link_with : [libnetworkd_core,
2188 libshared],
2189 install_rpath : rootlibexecdir,
2190 install : true,
2191 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmekf0bd7cc2017-04-12 12:14:30 -04002192endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002193
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002194exe = executable('networkctl',
2195 networkctl_sources,
2196 include_directories : includes,
2197 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002198 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002199 install_rpath : rootlibexecdir,
2200 install : true,
2201 install_dir : rootbindir)
2202public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002203
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002204############################################################
2205
2206foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002207 sources = tuple[0]
2208 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2209 dependencies = tuple[2]
2210 condition = tuple.length() >= 4 ? tuple[3] : ''
2211 type = tuple.length() >= 5 ? tuple[4] : ''
2212 defs = tuple.length() >= 6 ? tuple[5] : []
2213 incs = tuple.length() >= 7 ? tuple[6] : includes
2214 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002215
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002216 name = sources[0].split('/')[-1].split('.')[0]
2217 if type.startswith('timeout=')
2218 timeout = type.split('=')[1].to_int()
2219 type = ''
2220 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002221
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002222 if condition == '' or conf.get(condition, 0) == 1
2223 install = install_tests and type == ''
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002224
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002225 exe = executable(
2226 name,
2227 sources,
2228 include_directories : incs,
2229 link_with : link_with,
2230 dependencies : dependencies,
2231 c_args : defs,
2232 install_rpath : rootlibexecdir,
2233 install : install,
2234 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002235
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002236 if type == 'manual'
2237 message('@0@ is a manual test'.format(name))
2238 elif type == 'unsafe' and want_tests != 'unsafe'
2239 message('@0@ is an unsafe test'.format(name))
2240 else
2241 test(name, exe,
2242 env : test_env,
2243 timeout : timeout)
2244 endif
2245 else
2246 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2247 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002248endforeach
2249
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002250test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002251 'test-libsystemd-sym',
2252 test_libsystemd_sym_c,
2253 include_directories : includes,
2254 link_with : [libsystemd],
2255 install : install_tests,
2256 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002257test('test-libsystemd-sym',
2258 test_libsystemd_sym)
2259
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002260test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002261 'test-libudev-sym',
2262 test_libudev_sym_c,
2263 include_directories : includes,
2264 c_args : ['-Wno-deprecated-declarations'],
2265 link_with : [libudev],
2266 install : install_tests,
2267 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002268test('test-libudev-sym',
2269 test_libudev_sym)
2270
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002271############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002272
2273make_directive_index_py = find_program('tools/make-directive-index.py')
2274make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002275xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002276hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002277
2278subdir('units')
2279subdir('sysctl.d')
2280subdir('sysusers.d')
2281subdir('tmpfiles.d')
2282subdir('rules')
2283subdir('hwdb')
2284subdir('network')
2285subdir('man')
2286subdir('shell-completion/bash')
2287subdir('shell-completion/zsh')
2288subdir('docs/sysvinit')
2289subdir('docs/var-log')
2290
2291# FIXME: figure out if the warning is true:
2292# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2293install_subdir('factory/etc',
2294 install_dir : factorydir)
2295
2296
2297install_data('xorg/50-systemd-user.sh',
2298 install_dir : xinitrcdir)
2299install_data('system-preset/90-systemd.preset',
2300 install_dir : systempresetdir)
2301install_data('README',
2302 'NEWS',
2303 'CODING_STYLE',
2304 'DISTRO_PORTING',
2305 'ENVIRONMENT.md',
2306 'LICENSE.GPL2',
2307 'LICENSE.LGPL2.1',
2308 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2309 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002310
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002311meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2312meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2313
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002314############################################################
2315
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002316meson_check_help = find_program('tools/meson-check-help.sh')
2317
2318foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002319 name = exec.full_path().split('/')[-1]
2320 test('check-help-' + name,
2321 meson_check_help,
2322 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002323endforeach
2324
2325############################################################
2326
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002327if git.found() and etags.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002328 all_files = run_command(
2329 git,
2330 ['--git-dir=@0@/.git'.format(meson.source_root()),
2331 'ls-files',
2332 ':/*.[ch]'])
2333 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002334
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002335 custom_target(
2336 'TAGS',
2337 output : 'TAGS',
2338 input : all_files,
2339 command : [etags, '-o', '@OUTPUT@'] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002340endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002341
2342if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002343 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002344 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002345 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002346 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002347endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002348
2349if git.found()
2350 git_head = run_command(
2351 git,
2352 ['--git-dir=@0@/.git'.format(meson.source_root()),
2353 'rev-parse', 'HEAD']).stdout().strip()
2354 git_head_short = run_command(
2355 git,
2356 ['--git-dir=@0@/.git'.format(meson.source_root()),
2357 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2358
2359 run_target(
2360 'git-snapshot',
2361 command : ['git', 'archive',
2362 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2363 git_head_short),
2364 '--prefix', 'systemd-@0@/'.format(git_head),
2365 'HEAD'])
2366endif