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