]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/meson.build
d36be869ce7ecfd2d0ca35ad2baff788992b9c72
[thirdparty/systemd.git] / src / core / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 libcore_sources = '''
4 apparmor-setup.c
5 apparmor-setup.h
6 audit-fd.c
7 audit-fd.h
8 automount.c
9 automount.h
10 bpf-devices.c
11 bpf-devices.h
12 bpf-firewall.c
13 bpf-firewall.h
14 bpf-foreign.c
15 bpf-foreign.h
16 bpf-socket-bind.c
17 bpf-socket-bind.h
18 cgroup.c
19 cgroup.h
20 core-varlink.c
21 core-varlink.h
22 dbus-automount.c
23 dbus-automount.h
24 dbus-cgroup.c
25 dbus-cgroup.h
26 dbus-device.c
27 dbus-device.h
28 dbus-execute.c
29 dbus-execute.h
30 dbus-job.c
31 dbus-job.h
32 dbus-kill.c
33 dbus-kill.h
34 dbus-manager.c
35 dbus-manager.h
36 dbus-mount.c
37 dbus-mount.h
38 dbus-path.c
39 dbus-path.h
40 dbus-scope.c
41 dbus-scope.h
42 dbus-service.c
43 dbus-service.h
44 dbus-slice.c
45 dbus-slice.h
46 dbus-socket.c
47 dbus-socket.h
48 dbus-swap.c
49 dbus-swap.h
50 dbus-target.c
51 dbus-target.h
52 dbus-timer.c
53 dbus-timer.h
54 dbus-unit.c
55 dbus-unit.h
56 dbus-util.c
57 dbus-util.h
58 dbus.c
59 dbus.h
60 device.c
61 device.h
62 dynamic-user.c
63 dynamic-user.h
64 efi-random.c
65 efi-random.h
66 emergency-action.c
67 emergency-action.h
68 execute.c
69 execute.h
70 generator-setup.c
71 generator-setup.h
72 ima-setup.c
73 ima-setup.h
74 job.c
75 job.h
76 kill.c
77 kill.h
78 kmod-setup.c
79 kmod-setup.h
80 load-dropin.c
81 load-dropin.h
82 load-fragment.c
83 load-fragment.h
84 locale-setup.c
85 locale-setup.h
86 manager-dump.c
87 manager-dump.h
88 manager-serialize.c
89 manager-serialize.h
90 manager.c
91 manager.h
92 mount.c
93 mount.h
94 namespace.c
95 namespace.h
96 path.c
97 path.h
98 restrict-ifaces.c
99 restrict-ifaces.h
100 scope.c
101 scope.h
102 selinux-access.c
103 selinux-access.h
104 selinux-setup.c
105 selinux-setup.h
106 service.c
107 service.h
108 show-status.c
109 show-status.h
110 slice.c
111 slice.h
112 smack-setup.c
113 smack-setup.h
114 socket.c
115 socket.h
116 swap.c
117 swap.h
118 target.c
119 target.h
120 timer.c
121 timer.h
122 transaction.c
123 transaction.h
124 unit-dependency-atom.c
125 unit-dependency-atom.h
126 unit-printf.c
127 unit-printf.h
128 unit-serialize.c
129 unit-serialize.h
130 unit.c
131 unit.h
132 '''.split()
133
134 subdir('bpf/socket_bind')
135 if conf.get('BPF_FRAMEWORK') == 1
136 libcore_sources += [socket_bind_skel_h]
137 endif
138
139 subdir('bpf/restrict_ifaces')
140 if conf.get('BPF_FRAMEWORK') == 1
141 libcore_sources += [restrict_ifaces_skel_h]
142 endif
143
144 load_fragment_gperf_gperf = custom_target(
145 'load-fragment-gperf.gperf',
146 input : 'load-fragment-gperf.gperf.in',
147 output: 'load-fragment-gperf.gperf',
148 command : [meson_render_jinja2, config_h, '@INPUT@'],
149 capture : true)
150
151 load_fragment_gperf_c = custom_target(
152 'load-fragment-gperf.c',
153 input : load_fragment_gperf_gperf,
154 output : 'load-fragment-gperf.c',
155 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
156
157 awkscript = 'load-fragment-gperf-nulstr.awk'
158 load_fragment_gperf_nulstr_c = custom_target(
159 'load-fragment-gperf-nulstr.c',
160 input : [awkscript, load_fragment_gperf_gperf],
161 output : 'load-fragment-gperf-nulstr.c',
162 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
163 capture : true)
164
165 libcore = static_library(
166 'core',
167 libcore_sources,
168 load_fragment_gperf_c,
169 load_fragment_gperf_nulstr_c,
170 include_directories : includes,
171 dependencies : [versiondep,
172 threads,
173 libdl,
174 librt,
175 libseccomp,
176 libpam,
177 libaudit,
178 libkmod,
179 libapparmor,
180 libselinux,
181 libmount,
182 libacl])
183
184 core_includes = [includes, include_directories('.')]
185
186 systemd_sources = files('main.c')
187
188 in_files = [['system.conf', pkgsysconfdir],
189 ['user.conf', pkgsysconfdir],
190 ['systemd.pc', pkgconfigdatadir],
191 ['org.freedesktop.systemd1.policy', polkitpolicydir]]
192
193 foreach item : in_files
194 file = item[0]
195 dir = item[1]
196
197 custom_target(
198 file,
199 input : file + '.in',
200 output: file,
201 command : [meson_render_jinja2, config_h, '@INPUT@'],
202 capture : true,
203 install : (dir == pkgsysconfdir and install_sysconfdir_samples) or (dir != pkgsysconfdir and dir != 'no'),
204 install_dir : dir)
205 endforeach
206
207 install_data('org.freedesktop.systemd1.conf',
208 install_dir : dbuspolicydir)
209 install_data('org.freedesktop.systemd1.service',
210 install_dir : dbussystemservicedir)
211
212 meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))
213 meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir))
214 meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))
215 meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir))
216
217 if install_sysconfdir
218 meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'system'))
219 meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'user'))
220 meson.add_install_script('sh', '-c', mkdir_p.format(sysconfdir / 'xdg/systemd'))
221 endif
222
223 ############################################################
224
225 fuzzers += [
226 [['src/core/fuzz-unit-file.c'],
227 [libcore,
228 libshared],
229 [libmount]],
230 ]