]> git.ipfire.org Git - thirdparty/systemd.git/blob - tmpfiles.d/meson.build
build-sys: use #if Y instead of #ifdef Y everywhere
[thirdparty/systemd.git] / tmpfiles.d / meson.build
1 enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1
2
3 tmpfiles = [['home.conf', ''],
4 ['journal-nocow.conf', ''],
5 ['systemd-nologin.conf', ''],
6 ['systemd-nspawn.conf', ''],
7 ['tmp.conf', ''],
8 ['x11.conf', ''],
9 ['legacy.conf', 'HAVE_SYSV_COMPAT'],
10 ]
11
12 foreach pair : tmpfiles
13 if not enable_tmpfiles
14 # do nothing
15 elif pair[1] == '' or conf.get(pair[1]) == 1
16 install_data(pair[0], install_dir : tmpfilesdir)
17 else
18 message('Not installing tmpfiles.d/@0@ because @1@ is @2@'
19 .format(pair[0], pair[1], conf.get(pair[1], 0)))
20 endif
21 endforeach
22
23 m4_files = [['etc.conf', ''],
24 ['systemd.conf', ''],
25 ['var.conf', ''],
26 ]
27
28 foreach pair : m4_files
29 if not enable_tmpfiles
30 # do nothing
31 elif pair[1] == '' or conf.get(pair[1]) == 1
32 custom_target(
33 'tmpfiles.d_' + pair[0],
34 input : pair[0] + '.m4',
35 output: pair[0],
36 command : [m4, '-P'] + m4_defines + ['@INPUT@'],
37 capture : true,
38 install : true,
39 install_dir : tmpfilesdir)
40 else
41 message('Not installing tmpfiles.d/@0@.m4 because @1@ is @2@'
42 .format(pair[0], pair[1], conf.get(pair[1], 0)))
43 endif
44 endforeach
45
46 if enable_tmpfiles
47 meson.add_install_script(
48 'sh', '-c',
49 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
50 endif