]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/meson.build
udev: move naming-scheme.[ch] into src/shared/
[thirdparty/systemd.git] / src / shared / meson.build
CommitLineData
3a726fcd 1# SPDX-License-Identifier: LGPL-2.1+
3a726fcd 2
975464e0 3shared_sources = files('''
37efbbd8
ZJS
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
d284b82b
ZJS
11 barrier.c
12 barrier.h
37efbbd8
ZJS
13 base-filesystem.c
14 base-filesystem.h
d284b82b
ZJS
15 bitmap.c
16 bitmap.h
17 blkid-util.h
37efbbd8
ZJS
18 boot-timestamps.c
19 boot-timestamps.h
7e87c7d9
ZJS
20 bootspec.c
21 bootspec.h
d284b82b
ZJS
22 bpf-program.c
23 bpf-program.h
9f717d42
LP
24 bus-unit-procs.c
25 bus-unit-procs.h
37efbbd8
ZJS
26 bus-unit-util.c
27 bus-unit-util.h
28 bus-util.c
29 bus-util.h
e45c81b8
LP
30 bus-wait-for-jobs.c
31 bus-wait-for-jobs.h
3572d3df
LP
32 bus-wait-for-units.c
33 bus-wait-for-units.h
d284b82b
ZJS
34 calendarspec.c
35 calendarspec.h
fdb3deca
ZJS
36 cgroup-setup.c
37 cgroup-setup.h
37efbbd8
ZJS
38 cgroup-show.c
39 cgroup-show.h
417a6eec
LP
40 chown-recursive.c
41 chown-recursive.h
37efbbd8
ZJS
42 clean-ipc.c
43 clean-ipc.h
d284b82b
ZJS
44 clock-util.c
45 clock-util.h
37efbbd8
ZJS
46 condition.c
47 condition.h
48 conf-parser.c
49 conf-parser.h
d284b82b
ZJS
50 cpu-set-util.c
51 cpu-set-util.h
52 crypt-util.c
53 crypt-util.h
c157884f 54 daemon-util.h
37efbbd8
ZJS
55 dev-setup.c
56 dev-setup.h
57 dissect-image.c
58 dissect-image.h
a709a315
LP
59 dm-util.c
60 dm-util.h
37efbbd8
ZJS
61 dns-domain.c
62 dns-domain.h
63 dropin.c
64 dropin.h
0bb2f0f1
ZJS
65 efi-loader.c
66 efi-loader.h
a5d8835c 67 enable-mempool.c
686d13b9
LP
68 env-file-label.c
69 env-file-label.h
5c2316c6
YW
70 ethtool-util.c
71 ethtool-util.h
d284b82b
ZJS
72 exec-util.c
73 exec-util.h
74 exit-status.c
75 exit-status.h
37efbbd8
ZJS
76 fdset.c
77 fdset.h
d284b82b
ZJS
78 fileio-label.c
79 fileio-label.h
c3045943 80 firewall-util.h
d284b82b
ZJS
81 format-table.c
82 format-table.h
b67f05da 83 fsck-util.h
37efbbd8
ZJS
84 fstab-util.c
85 fstab-util.h
37efbbd8
ZJS
86 generator.c
87 generator.h
88 gpt.h
ff7dad48
ZJS
89 id128-print.c
90 id128-print.h
37efbbd8
ZJS
91 ima-util.c
92 ima-util.h
93 import-util.c
94 import-util.h
95 initreq.h
37efbbd8
ZJS
96 install-printf.c
97 install-printf.h
d68c645b
LP
98 install.c
99 install.h
f079c372
LP
100 ip-protocol-list.c
101 ip-protocol-list.h
d284b82b
ZJS
102 journal-importer.c
103 journal-importer.h
37efbbd8
ZJS
104 journal-util.c
105 journal-util.h
d284b82b
ZJS
106 json-internal.h
107 json.c
108 json.h
fb36b133 109 libmount-util.h
01234e1f
YW
110 linux/auto_dev-ioctl.h
111 linux/bpf.h
112 linux/bpf_common.h
113 linux/bpf_insn.h
114 linux/dm-ioctl.h
115 linux/ethtool.h
733cbd00
LP
116 local-addresses.c
117 local-addresses.h
d284b82b
ZJS
118 lockfile-util.c
119 lockfile-util.h
e67ae9f5 120 log-link.h
37efbbd8
ZJS
121 logs-show.c
122 logs-show.h
123 loop-util.c
124 loop-util.h
125 machine-image.c
126 machine-image.h
127 machine-pool.c
128 machine-pool.h
294bf0c3 129 main-func.h
3cb9b42a 130 module-util.h
77c772f2
ZJS
131 mount-util.c
132 mount-util.h
b355d0c9
LP
133 netif-naming-scheme.c
134 netif-naming-scheme.h
f079c372
LP
135 nscd-flush.c
136 nscd-flush.h
37efbbd8
ZJS
137 nsflags.c
138 nsflags.h
3f637019 139 openssl-util.h
d284b82b
ZJS
140 os-util.c
141 os-util.h
37efbbd8
ZJS
142 output-mode.c
143 output-mode.h
294bf0c3
ZJS
144 pager.c
145 pager.h
37efbbd8
ZJS
146 path-lookup.c
147 path-lookup.h
5e146a75 148 pe-header.h
839fddbe
LP
149 pkcs11-util.c
150 pkcs11-util.h
294bf0c3
ZJS
151 pretty-print.c
152 pretty-print.h
37efbbd8
ZJS
153 ptyfwd.c
154 ptyfwd.h
d284b82b
ZJS
155 reboot-util.c
156 reboot-util.h
28937bcc
LP
157 resize-fs.c
158 resize-fs.h
37efbbd8
ZJS
159 resolve-util.c
160 resolve-util.h
161 seccomp-util.h
d284b82b
ZJS
162 securebits-util.c
163 securebits-util.h
d68c645b
LP
164 serialize.c
165 serialize.h
37efbbd8
ZJS
166 sleep-config.c
167 sleep-config.h
168 spawn-ask-password-agent.c
169 spawn-ask-password-agent.h
170 spawn-polkit-agent.c
171 spawn-polkit-agent.h
172 specifier.c
173 specifier.h
174 switch-root.c
175 switch-root.h
176 sysctl-util.c
177 sysctl-util.h
e4de7287
LP
178 tmpfile-util-label.c
179 tmpfile-util-label.h
ed440f6b
SL
180 tomoyo-util.c
181 tomoyo-util.h
b237a168 182 udev-util.c
d68c645b 183 udev-util.h
37efbbd8
ZJS
184 uid-range.c
185 uid-range.h
5cfa33e0 186 unit-file.c
dfadc1f2 187 unit-file.h
37efbbd8 188 utmp-wtmp.h
d41bd96f
LP
189 varlink.c
190 varlink.h
d284b82b
ZJS
191 verbs.c
192 verbs.h
37efbbd8
ZJS
193 vlan-util.c
194 vlan-util.h
195 volatile-util.c
196 volatile-util.h
197 watchdog.c
198 watchdog.h
d284b82b
ZJS
199 web-util.c
200 web-util.h
b492aea0
ZJS
201 wifi-util.c
202 wifi-util.h
d284b82b
ZJS
203 xml.c
204 xml.h
975464e0 205'''.split())
5c23128d 206
b9fa9b71
MO
207if get_option('tests') != 'false'
208 shared_sources += files('tests.c', 'tests.h')
209endif
210
69e96427 211test_tables_h = files('test-tables.h')
5a8b1640 212shared_sources += test_tables_h
69e96427 213
349cc4a5 214if conf.get('HAVE_ACL') == 1
975464e0 215 shared_sources += files('acl-util.c')
5c23128d
ZJS
216endif
217
3211da4b 218if conf.get('ENABLE_UTMP') == 1
975464e0 219 shared_sources += files('utmp-wtmp.c')
5c23128d
ZJS
220endif
221
349cc4a5 222if conf.get('HAVE_SECCOMP') == 1
975464e0 223 shared_sources += files('seccomp-util.c')
5c23128d
ZJS
224endif
225
349cc4a5 226if conf.get('HAVE_LIBIPTC') == 1
975464e0 227 shared_sources += files('firewall-util.c')
c3045943
MB
228endif
229
ba323bbe
YW
230if conf.get('HAVE_KMOD') == 1
231 shared_sources += files('module-util.c')
232endif
233
da96ad5a
YW
234generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
235ip_protocol_list_txt = custom_target(
236 'ip-protocol-list.txt',
237 output : 'ip-protocol-list.txt',
238 command : [generate_ip_protocol_list, cpp],
7b5e750d
YW
239 capture : true)
240
da96ad5a 241fname = 'ip-protocol-from-name.gperf'
7b5e750d
YW
242gperf_file = custom_target(
243 fname,
da96ad5a 244 input : ip_protocol_list_txt,
7b5e750d 245 output : fname,
da96ad5a 246 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
7b5e750d
YW
247 capture : true)
248
da96ad5a 249fname = 'ip-protocol-from-name.h'
7b5e750d
YW
250target1 = custom_target(
251 fname,
252 input : gperf_file,
253 output : fname,
254 command : [gperf,
255 '-L', 'ANSI-C', '-t', '--ignore-case',
da96ad5a
YW
256 '-N', 'lookup_ip_protocol',
257 '-H', 'hash_ip_protocol_name',
7b5e750d
YW
258 '-p', '-C',
259 '@INPUT@'],
260 capture : true)
261
da96ad5a
YW
262fname = 'ip-protocol-to-name.h'
263awkscript = 'ip-protocol-to-name.awk'
7b5e750d
YW
264target2 = custom_target(
265 fname,
da96ad5a 266 input : [awkscript, ip_protocol_list_txt],
7b5e750d
YW
267 output : fname,
268 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
269 capture : true)
270
dca23091
YW
271shared_generated_gperf_headers = [target1, target2]
272shared_sources += shared_generated_gperf_headers
7b5e750d 273
5c23128d
ZJS
274libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
275
4b57a272 276libshared_deps = [threads,
4b57a272 277 libacl,
462255c6
LP
278 libblkid,
279 libcap,
4b57a272
ZJS
280 libcryptsetup,
281 libgcrypt,
462255c6 282 libidn,
4b57a272 283 libiptc,
3cb9b42a 284 libkmod,
462255c6 285 liblz4,
77c772f2 286 libmount,
839fddbe
LP
287 libopenssl,
288 libp11kit,
462255c6 289 librt,
4b57a272
ZJS
290 libseccomp,
291 libselinux,
462255c6 292 libxz]
4b57a272 293
4f5993c3
FS
294libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
295
2d4ceca8 296libshared_static = static_library(
37efbbd8
ZJS
297 libshared_name,
298 shared_sources,
2d4ceca8
ZJS
299 include_directories : includes,
300 dependencies : libshared_deps,
301 c_args : ['-fvisibility=default'])
302
303libshared = shared_library(
304 libshared_name,
8e899a92 305 libudev_sources,
37efbbd8 306 include_directories : includes,
4f5993c3 307 link_args : ['-shared',
2d4ceca8
ZJS
308 '-Wl,--version-script=' + libshared_sym_path],
309 link_whole : [libshared_static,
34e221a5 310 libbasic,
a8e559d4 311 libbasic_gcrypt,
5e3cec87
ZJS
312 libsystemd_static,
313 libjournal_client],
37efbbd8 314 c_args : ['-fvisibility=default'],
4b57a272 315 dependencies : libshared_deps,
37efbbd8
ZJS
316 install : true,
317 install_dir : rootlibexecdir)