]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
coredump: add zstandard support for coredumps
[thirdparty/systemd.git] / src / shared / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2
3 shared_sources = files('''
4 acl-util.h
5 acpi-fpdt.c
6 acpi-fpdt.h
7 apparmor-util.c
8 apparmor-util.h
9 ask-password-api.c
10 ask-password-api.h
11 barrier.c
12 barrier.h
13 base-filesystem.c
14 base-filesystem.h
15 binfmt-util.c
16 binfmt-util.h
17 bitmap.c
18 bitmap.h
19 blkid-util.h
20 boot-timestamps.c
21 boot-timestamps.h
22 bootspec.c
23 bootspec.h
24 bpf-program.c
25 bpf-program.h
26 bridge-util.c
27 bridge-util.h
28 bus-log-control-api.c
29 bus-log-control-api.h
30 bus-polkit.c
31 bus-polkit.h
32 bus-unit-procs.c
33 bus-unit-procs.h
34 bus-unit-util.c
35 bus-unit-util.h
36 bus-util.c
37 bus-util.h
38 bus-wait-for-jobs.c
39 bus-wait-for-jobs.h
40 bus-wait-for-units.c
41 bus-wait-for-units.h
42 calendarspec.c
43 calendarspec.h
44 cgroup-setup.c
45 cgroup-setup.h
46 cgroup-show.c
47 cgroup-show.h
48 chown-recursive.c
49 chown-recursive.h
50 clean-ipc.c
51 clean-ipc.h
52 clock-util.c
53 clock-util.h
54 condition.c
55 condition.h
56 conf-parser.c
57 conf-parser.h
58 coredump-util.c
59 coredump-util.h
60 cpu-set-util.c
61 cpu-set-util.h
62 crypt-util.c
63 crypt-util.h
64 daemon-util.h
65 dev-setup.c
66 dev-setup.h
67 dissect-image.c
68 dissect-image.h
69 dm-util.c
70 dm-util.h
71 dns-domain.c
72 dns-domain.h
73 dropin.c
74 dropin.h
75 efi-loader.c
76 efi-loader.h
77 enable-mempool.c
78 env-file-label.c
79 env-file-label.h
80 ethtool-util.c
81 ethtool-util.h
82 exec-util.c
83 exec-util.h
84 exit-status.c
85 exit-status.h
86 fdset.c
87 fdset.h
88 fileio-label.c
89 fileio-label.h
90 firewall-util.h
91 format-table.c
92 format-table.h
93 fsck-util.h
94 fstab-util.c
95 fstab-util.h
96 generator.c
97 generator.h
98 geneve-util.c
99 geneve-util.h
100 gpt.c
101 gpt.h
102 group-record-nss.c
103 group-record-nss.h
104 group-record-show.c
105 group-record-show.h
106 group-record.c
107 group-record.h
108 id128-print.c
109 id128-print.h
110 ima-util.c
111 ima-util.h
112 import-util.c
113 import-util.h
114 initreq.h
115 install-printf.c
116 install-printf.h
117 install.c
118 install.h
119 ip-protocol-list.c
120 ip-protocol-list.h
121 journal-importer.c
122 journal-importer.h
123 journal-util.c
124 journal-util.h
125 json-internal.h
126 json.c
127 json.h
128 libcrypt-util.c
129 libcrypt-util.h
130 libmount-util.h
131 linux/auto_dev-ioctl.h
132 linux/bpf.h
133 linux/bpf_common.h
134 linux/bpf_insn.h
135 linux/dm-ioctl.h
136 linux/ethtool.h
137 local-addresses.c
138 local-addresses.h
139 lockfile-util.c
140 lockfile-util.h
141 log-link.h
142 logs-show.c
143 logs-show.h
144 loop-util.c
145 loop-util.h
146 machine-image.c
147 machine-image.h
148 machine-pool.c
149 machine-pool.h
150 main-func.h
151 module-util.h
152 mount-util.c
153 mount-util.h
154 netif-naming-scheme.c
155 netif-naming-scheme.h
156 nscd-flush.c
157 nscd-flush.h
158 nsflags.c
159 nsflags.h
160 numa-util.c
161 numa-util.h
162 openssl-util.h
163 os-util.c
164 os-util.h
165 output-mode.c
166 output-mode.h
167 pager.c
168 pager.h
169 pe-header.h
170 pkcs11-util.c
171 pkcs11-util.h
172 pretty-print.c
173 pretty-print.h
174 ptyfwd.c
175 ptyfwd.h
176 reboot-util.c
177 reboot-util.h
178 resize-fs.c
179 resize-fs.h
180 resolve-util.c
181 resolve-util.h
182 seccomp-util.h
183 securebits-util.c
184 securebits-util.h
185 serialize.c
186 serialize.h
187 sleep-config.c
188 sleep-config.h
189 socket-netlink.c
190 socket-netlink.h
191 spawn-ask-password-agent.c
192 spawn-ask-password-agent.h
193 spawn-polkit-agent.c
194 spawn-polkit-agent.h
195 specifier.c
196 specifier.h
197 switch-root.c
198 switch-root.h
199 sysctl-util.c
200 sysctl-util.h
201 tmpfile-util-label.c
202 tmpfile-util-label.h
203 tomoyo-util.c
204 tomoyo-util.h
205 udev-util.c
206 udev-util.h
207 uid-range.c
208 uid-range.h
209 unit-file.c
210 unit-file.h
211 user-record-nss.c
212 user-record-nss.h
213 user-record-show.c
214 user-record-show.h
215 user-record.c
216 user-record.h
217 userdb.c
218 userdb.h
219 utmp-wtmp.h
220 varlink.c
221 varlink.h
222 verbs.c
223 verbs.h
224 vlan-util.c
225 vlan-util.h
226 volatile-util.c
227 volatile-util.h
228 watchdog.c
229 watchdog.h
230 web-util.c
231 web-util.h
232 wifi-util.c
233 wifi-util.h
234 xml.c
235 xml.h
236 '''.split())
237
238 if get_option('tests') != 'false'
239 shared_sources += files('tests.c', 'tests.h')
240 endif
241
242 test_tables_h = files('test-tables.h')
243 shared_sources += test_tables_h
244
245 if conf.get('HAVE_ACL') == 1
246 shared_sources += files('acl-util.c')
247 endif
248
249 if conf.get('ENABLE_UTMP') == 1
250 shared_sources += files('utmp-wtmp.c')
251 endif
252
253 if conf.get('HAVE_SECCOMP') == 1
254 shared_sources += files('seccomp-util.c')
255 endif
256
257 if conf.get('HAVE_LIBIPTC') == 1
258 shared_sources += files('firewall-util.c')
259 endif
260
261 if conf.get('HAVE_KMOD') == 1
262 shared_sources += files('module-util.c')
263 endif
264
265 if conf.get('HAVE_PAM') == 1
266 shared_sources += files('''
267 pam-util.c
268 pam-util.h
269 '''.split())
270 endif
271
272 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
273 ip_protocol_list_txt = custom_target(
274 'ip-protocol-list.txt',
275 output : 'ip-protocol-list.txt',
276 command : [generate_ip_protocol_list, cpp],
277 capture : true)
278
279 fname = 'ip-protocol-from-name.gperf'
280 gperf_file = custom_target(
281 fname,
282 input : ip_protocol_list_txt,
283 output : fname,
284 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
285 capture : true)
286
287 fname = 'ip-protocol-from-name.h'
288 target1 = custom_target(
289 fname,
290 input : gperf_file,
291 output : fname,
292 command : [gperf,
293 '-L', 'ANSI-C', '-t', '--ignore-case',
294 '-N', 'lookup_ip_protocol',
295 '-H', 'hash_ip_protocol_name',
296 '-p', '-C',
297 '@INPUT@'],
298 capture : true)
299
300 fname = 'ip-protocol-to-name.h'
301 awkscript = 'ip-protocol-to-name.awk'
302 target2 = custom_target(
303 fname,
304 input : [awkscript, ip_protocol_list_txt],
305 output : fname,
306 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
307 capture : true)
308
309 shared_generated_gperf_headers = [target1, target2]
310 shared_sources += shared_generated_gperf_headers
311
312 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
313
314 libshared_deps = [threads,
315 libacl,
316 libblkid,
317 libcap,
318 libcrypt,
319 libcryptsetup,
320 libgcrypt,
321 libidn,
322 libiptc,
323 libkmod,
324 liblz4,
325 libmount,
326 libopenssl,
327 libp11kit,
328 libpam,
329 librt,
330 libseccomp,
331 libselinux,
332 libzstd,
333 libxz]
334
335 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
336
337 libshared_static = static_library(
338 libshared_name,
339 shared_sources,
340 include_directories : includes,
341 dependencies : libshared_deps,
342 c_args : ['-fvisibility=default'])
343
344 libshared = shared_library(
345 libshared_name,
346 libudev_sources,
347 include_directories : includes,
348 link_args : ['-shared',
349 '-Wl,--version-script=' + libshared_sym_path],
350 link_whole : [libshared_static,
351 libbasic,
352 libbasic_gcrypt,
353 libsystemd_static,
354 libjournal_client],
355 c_args : ['-fvisibility=default'],
356 dependencies : libshared_deps,
357 install : true,
358 install_dir : rootlibexecdir)