]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
ethtool: add several new link modes
[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 ima-util.c
121 ima-util.h
122 import-util.c
123 import-util.h
124 initreq.h
125 install-printf.c
126 install-printf.h
127 install.c
128 install.h
129 ipvlan-util.c
130 ipvlan-util.h
131 ip-protocol-list.c
132 ip-protocol-list.h
133 journal-importer.c
134 journal-importer.h
135 journal-util.c
136 journal-util.h
137 json-internal.h
138 json.c
139 json.h
140 libcrypt-util.c
141 libcrypt-util.h
142 libmount-util.h
143 linux/auto_dev-ioctl.h
144 linux/bpf.h
145 linux/bpf_common.h
146 linux/bpf_insn.h
147 linux/dm-ioctl.h
148 linux/ethtool.h
149 local-addresses.c
150 local-addresses.h
151 lockfile-util.c
152 lockfile-util.h
153 log-link.h
154 logs-show.c
155 logs-show.h
156 loop-util.c
157 loop-util.h
158 machine-image.c
159 machine-image.h
160 machine-pool.c
161 machine-pool.h
162 macvlan-util.c
163 macvlan-util.h
164 main-func.h
165 mkfs-util.c
166 mkfs-util.h
167 module-util.h
168 mount-util.c
169 mount-util.h
170 netif-naming-scheme.c
171 netif-naming-scheme.h
172 nscd-flush.c
173 nscd-flush.h
174 nsflags.c
175 nsflags.h
176 numa-util.c
177 numa-util.h
178 openssl-util.h
179 os-util.c
180 os-util.h
181 output-mode.c
182 output-mode.h
183 pager.c
184 pager.h
185 pe-header.h
186 pkcs11-util.c
187 pkcs11-util.h
188 pretty-print.c
189 pretty-print.h
190 ptyfwd.c
191 ptyfwd.h
192 pwquality-util.c
193 pwquality-util.h
194 reboot-util.c
195 reboot-util.h
196 resize-fs.c
197 resize-fs.h
198 resolve-util.c
199 resolve-util.h
200 seccomp-util.h
201 securebits-util.c
202 securebits-util.h
203 serialize.c
204 serialize.h
205 service-util.c
206 service-util.h
207 sleep-config.c
208 sleep-config.h
209 socket-netlink.c
210 socket-netlink.h
211 spawn-ask-password-agent.c
212 spawn-ask-password-agent.h
213 spawn-polkit-agent.c
214 spawn-polkit-agent.h
215 specifier.c
216 specifier.h
217 switch-root.c
218 switch-root.h
219 sysctl-util.c
220 sysctl-util.h
221 tmpfile-util-label.c
222 tmpfile-util-label.h
223 tomoyo-util.c
224 tomoyo-util.h
225 udev-util.c
226 udev-util.h
227 uid-range.c
228 uid-range.h
229 unit-file.c
230 unit-file.h
231 user-record-nss.c
232 user-record-nss.h
233 user-record-show.c
234 user-record-show.h
235 user-record.c
236 user-record.h
237 userdb.c
238 userdb.h
239 utmp-wtmp.h
240 varlink.c
241 varlink.h
242 verbs.c
243 verbs.h
244 vlan-util.c
245 vlan-util.h
246 volatile-util.c
247 volatile-util.h
248 watchdog.c
249 watchdog.h
250 web-util.c
251 web-util.h
252 wifi-util.c
253 wifi-util.h
254 xml.c
255 xml.h
256 '''.split())
257
258 if get_option('tests') != 'false'
259 shared_sources += files('tests.c', 'tests.h')
260 endif
261
262 test_tables_h = files('test-tables.h')
263 shared_sources += test_tables_h
264
265 generate_syscall_list = find_program('generate-syscall-list.py')
266 fname = 'syscall-list.h'
267 syscall_list_h = custom_target(
268 fname,
269 input : 'syscall-names.text',
270 output : fname,
271 command : [generate_syscall_list,
272 '@INPUT@'],
273 capture : true)
274
275 if conf.get('HAVE_ACL') == 1
276 shared_sources += files('acl-util.c')
277 endif
278
279 if conf.get('ENABLE_UTMP') == 1
280 shared_sources += files('utmp-wtmp.c')
281 endif
282
283 if conf.get('HAVE_SECCOMP') == 1
284 shared_sources += files('seccomp-util.c')
285 shared_sources += syscall_list_h
286 endif
287
288 if conf.get('HAVE_LIBIPTC') == 1
289 shared_sources += files('firewall-util.c')
290 endif
291
292 if conf.get('HAVE_KMOD') == 1
293 shared_sources += files('module-util.c')
294 endif
295
296 if conf.get('HAVE_PAM') == 1
297 shared_sources += files('''
298 pam-util.c
299 pam-util.h
300 '''.split())
301 endif
302
303 if conf.get('HAVE_QRENCODE') == 1
304 shared_sources += files('''
305 qrcode-util.c
306 qrcode-util.h
307 '''.split())
308 endif
309
310 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
311 ip_protocol_list_txt = custom_target(
312 'ip-protocol-list.txt',
313 output : 'ip-protocol-list.txt',
314 command : [generate_ip_protocol_list, cpp],
315 capture : true)
316
317 fname = 'ip-protocol-from-name.gperf'
318 gperf_file = custom_target(
319 fname,
320 input : ip_protocol_list_txt,
321 output : fname,
322 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
323 capture : true)
324
325 fname = 'ip-protocol-from-name.h'
326 target1 = custom_target(
327 fname,
328 input : gperf_file,
329 output : fname,
330 command : [gperf,
331 '-L', 'ANSI-C', '-t', '--ignore-case',
332 '-N', 'lookup_ip_protocol',
333 '-H', 'hash_ip_protocol_name',
334 '-p', '-C',
335 '@INPUT@'],
336 capture : true)
337
338 fname = 'ip-protocol-to-name.h'
339 awkscript = 'ip-protocol-to-name.awk'
340 target2 = custom_target(
341 fname,
342 input : [awkscript, ip_protocol_list_txt],
343 output : fname,
344 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
345 capture : true)
346
347 shared_generated_gperf_headers = [target1, target2]
348 shared_sources += shared_generated_gperf_headers
349
350 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
351
352 libshared_deps = [threads,
353 libacl,
354 libblkid,
355 libcap,
356 libcrypt,
357 libgcrypt,
358 libidn,
359 libiptc,
360 libkmod,
361 liblz4,
362 libmount,
363 libopenssl,
364 libp11kit,
365 libpam,
366 librt,
367 libseccomp,
368 libselinux,
369 libzstd,
370 libxz]
371
372 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
373
374 libshared_static = static_library(
375 libshared_name,
376 shared_sources,
377 include_directories : includes,
378 dependencies : libshared_deps,
379 c_args : ['-fvisibility=default'])
380
381 libshared = shared_library(
382 libshared_name,
383 libudev_sources,
384 include_directories : includes,
385 link_args : ['-shared',
386 '-Wl,--version-script=' + libshared_sym_path],
387 link_whole : [libshared_static,
388 libbasic,
389 libbasic_gcrypt,
390 libsystemd_static,
391 libjournal_client],
392 c_args : ['-fvisibility=default'],
393 dependencies : libshared_deps,
394 install : true,
395 install_dir : rootlibexecdir)
396
397 ############################################################
398
399 run_target(
400 'syscall-names-update',
401 command : [syscall_names_update_sh, meson.current_source_dir()])