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