]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
networkctl: use and print full hardware address
[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 reboot-util.c
199 reboot-util.h
200 resize-fs.c
201 resize-fs.h
202 resolve-util.c
203 resolve-util.h
204 seccomp-util.h
205 securebits-util.c
206 securebits-util.h
207 serialize.c
208 serialize.h
209 service-util.c
210 service-util.h
211 sleep-config.c
212 sleep-config.h
213 socket-netlink.c
214 socket-netlink.h
215 spawn-ask-password-agent.c
216 spawn-ask-password-agent.h
217 spawn-polkit-agent.c
218 spawn-polkit-agent.h
219 specifier.c
220 specifier.h
221 switch-root.c
222 switch-root.h
223 sysctl-util.c
224 sysctl-util.h
225 tmpfile-util-label.c
226 tmpfile-util-label.h
227 tomoyo-util.c
228 tomoyo-util.h
229 udev-util.c
230 udev-util.h
231 uid-range.c
232 uid-range.h
233 unit-file.c
234 unit-file.h
235 user-record-nss.c
236 user-record-nss.h
237 user-record-show.c
238 user-record-show.h
239 user-record.c
240 user-record.h
241 userdb.c
242 userdb.h
243 utmp-wtmp.h
244 varlink.c
245 varlink.h
246 verbs.c
247 verbs.h
248 vlan-util.c
249 vlan-util.h
250 volatile-util.c
251 volatile-util.h
252 watchdog.c
253 watchdog.h
254 web-util.c
255 web-util.h
256 wifi-util.c
257 wifi-util.h
258 xml.c
259 xml.h
260 '''.split())
261
262 if get_option('tests') != 'false'
263 shared_sources += files('tests.c', 'tests.h')
264 endif
265
266 test_tables_h = files('test-tables.h')
267 shared_sources += test_tables_h
268
269 generate_syscall_list = find_program('generate-syscall-list.py')
270 fname = 'syscall-list.h'
271 syscall_list_h = custom_target(
272 fname,
273 input : 'syscall-names.text',
274 output : fname,
275 command : [generate_syscall_list,
276 '@INPUT@'],
277 capture : true)
278
279 if conf.get('HAVE_ACL') == 1
280 shared_sources += files('acl-util.c')
281 endif
282
283 if conf.get('ENABLE_UTMP') == 1
284 shared_sources += files('utmp-wtmp.c')
285 endif
286
287 if conf.get('HAVE_SECCOMP') == 1
288 shared_sources += files('seccomp-util.c')
289 shared_sources += syscall_list_h
290 endif
291
292 if conf.get('HAVE_LIBIPTC') == 1
293 shared_sources += files('firewall-util.c')
294 endif
295
296 if conf.get('HAVE_KMOD') == 1
297 shared_sources += files('module-util.c')
298 endif
299
300 if conf.get('HAVE_PAM') == 1
301 shared_sources += files('''
302 pam-util.c
303 pam-util.h
304 '''.split())
305 endif
306
307 if conf.get('HAVE_QRENCODE') == 1
308 shared_sources += files('''
309 qrcode-util.c
310 qrcode-util.h
311 '''.split())
312 endif
313
314 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
315 ip_protocol_list_txt = custom_target(
316 'ip-protocol-list.txt',
317 output : 'ip-protocol-list.txt',
318 command : [generate_ip_protocol_list, cpp],
319 capture : true)
320
321 fname = 'ip-protocol-from-name.gperf'
322 gperf_file = custom_target(
323 fname,
324 input : ip_protocol_list_txt,
325 output : fname,
326 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
327 capture : true)
328
329 fname = 'ip-protocol-from-name.h'
330 target1 = custom_target(
331 fname,
332 input : gperf_file,
333 output : fname,
334 command : [gperf,
335 '-L', 'ANSI-C', '-t', '--ignore-case',
336 '-N', 'lookup_ip_protocol',
337 '-H', 'hash_ip_protocol_name',
338 '-p', '-C',
339 '@INPUT@'],
340 capture : true)
341
342 fname = 'ip-protocol-to-name.h'
343 awkscript = 'ip-protocol-to-name.awk'
344 target2 = custom_target(
345 fname,
346 input : [awkscript, ip_protocol_list_txt],
347 output : fname,
348 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
349 capture : true)
350
351 shared_generated_gperf_headers = [target1, target2]
352 shared_sources += shared_generated_gperf_headers
353
354 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
355
356 libshared_deps = [threads,
357 libacl,
358 libblkid,
359 libcap,
360 libcrypt,
361 libgcrypt,
362 libiptc,
363 libkmod,
364 liblz4,
365 libmount,
366 libopenssl,
367 libp11kit,
368 libpam,
369 librt,
370 libseccomp,
371 libselinux,
372 libzstd,
373 libxz]
374
375 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
376
377 libshared_static = static_library(
378 libshared_name,
379 shared_sources,
380 include_directories : includes,
381 dependencies : libshared_deps,
382 c_args : ['-fvisibility=default'])
383
384 libshared = shared_library(
385 libshared_name,
386 libudev_sources,
387 include_directories : includes,
388 link_args : ['-shared',
389 '-Wl,--version-script=' + libshared_sym_path],
390 link_whole : [libshared_static,
391 libbasic,
392 libbasic_gcrypt,
393 libsystemd_static,
394 libjournal_client],
395 c_args : ['-fvisibility=default'],
396 dependencies : libshared_deps,
397 install : true,
398 install_dir : rootlibexecdir)
399
400 ############################################################
401
402 run_target(
403 'syscall-names-update',
404 command : [syscall_names_update_sh, meson.current_source_dir()])