]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
Merge pull request #14628 from poettering/hwdb-asus-tp500la
[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 group-record-nss.c
90 group-record-nss.h
91 group-record-show.c
92 group-record-show.h
93 group-record.c
94 group-record.h
95 id128-print.c
96 id128-print.h
97 ima-util.c
98 ima-util.h
99 import-util.c
100 import-util.h
101 initreq.h
102 install-printf.c
103 install-printf.h
104 install.c
105 install.h
106 ip-protocol-list.c
107 ip-protocol-list.h
108 journal-importer.c
109 journal-importer.h
110 journal-util.c
111 journal-util.h
112 json-internal.h
113 json.c
114 json.h
115 libcrypt-util.c
116 libcrypt-util.h
117 libmount-util.h
118 linux/auto_dev-ioctl.h
119 linux/bpf.h
120 linux/bpf_common.h
121 linux/bpf_insn.h
122 linux/dm-ioctl.h
123 linux/ethtool.h
124 local-addresses.c
125 local-addresses.h
126 lockfile-util.c
127 lockfile-util.h
128 log-link.h
129 logs-show.c
130 logs-show.h
131 loop-util.c
132 loop-util.h
133 machine-image.c
134 machine-image.h
135 machine-pool.c
136 machine-pool.h
137 main-func.h
138 module-util.h
139 mount-util.c
140 mount-util.h
141 netif-naming-scheme.c
142 netif-naming-scheme.h
143 nscd-flush.c
144 nscd-flush.h
145 nsflags.c
146 nsflags.h
147 openssl-util.h
148 os-util.c
149 os-util.h
150 output-mode.c
151 output-mode.h
152 pager.c
153 pager.h
154 path-lookup.c
155 path-lookup.h
156 pe-header.h
157 pkcs11-util.c
158 pkcs11-util.h
159 pretty-print.c
160 pretty-print.h
161 ptyfwd.c
162 ptyfwd.h
163 reboot-util.c
164 reboot-util.h
165 resize-fs.c
166 resize-fs.h
167 resolve-util.c
168 resolve-util.h
169 seccomp-util.h
170 securebits-util.c
171 securebits-util.h
172 serialize.c
173 serialize.h
174 sleep-config.c
175 sleep-config.h
176 socket-netlink.c
177 socket-netlink.h
178 spawn-ask-password-agent.c
179 spawn-ask-password-agent.h
180 spawn-polkit-agent.c
181 spawn-polkit-agent.h
182 specifier.c
183 specifier.h
184 switch-root.c
185 switch-root.h
186 sysctl-util.c
187 sysctl-util.h
188 tmpfile-util-label.c
189 tmpfile-util-label.h
190 tomoyo-util.c
191 tomoyo-util.h
192 udev-util.c
193 udev-util.h
194 uid-range.c
195 uid-range.h
196 unit-file.c
197 unit-file.h
198 user-record-nss.c
199 user-record-nss.h
200 user-record-show.c
201 user-record-show.h
202 user-record.c
203 user-record.h
204 userdb.c
205 userdb.h
206 utmp-wtmp.h
207 varlink.c
208 varlink.h
209 verbs.c
210 verbs.h
211 vlan-util.c
212 vlan-util.h
213 volatile-util.c
214 volatile-util.h
215 watchdog.c
216 watchdog.h
217 web-util.c
218 web-util.h
219 wifi-util.c
220 wifi-util.h
221 xml.c
222 xml.h
223 '''.split())
224
225 if get_option('tests') != 'false'
226 shared_sources += files('tests.c', 'tests.h')
227 endif
228
229 test_tables_h = files('test-tables.h')
230 shared_sources += test_tables_h
231
232 if conf.get('HAVE_ACL') == 1
233 shared_sources += files('acl-util.c')
234 endif
235
236 if conf.get('ENABLE_UTMP') == 1
237 shared_sources += files('utmp-wtmp.c')
238 endif
239
240 if conf.get('HAVE_SECCOMP') == 1
241 shared_sources += files('seccomp-util.c')
242 endif
243
244 if conf.get('HAVE_LIBIPTC') == 1
245 shared_sources += files('firewall-util.c')
246 endif
247
248 if conf.get('HAVE_KMOD') == 1
249 shared_sources += files('module-util.c')
250 endif
251
252 if conf.get('HAVE_PAM') == 1
253 shared_sources += files('''
254 pam-util.c
255 pam-util.h
256 '''.split())
257 endif
258
259 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
260 ip_protocol_list_txt = custom_target(
261 'ip-protocol-list.txt',
262 output : 'ip-protocol-list.txt',
263 command : [generate_ip_protocol_list, cpp],
264 capture : true)
265
266 fname = 'ip-protocol-from-name.gperf'
267 gperf_file = custom_target(
268 fname,
269 input : ip_protocol_list_txt,
270 output : fname,
271 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
272 capture : true)
273
274 fname = 'ip-protocol-from-name.h'
275 target1 = custom_target(
276 fname,
277 input : gperf_file,
278 output : fname,
279 command : [gperf,
280 '-L', 'ANSI-C', '-t', '--ignore-case',
281 '-N', 'lookup_ip_protocol',
282 '-H', 'hash_ip_protocol_name',
283 '-p', '-C',
284 '@INPUT@'],
285 capture : true)
286
287 fname = 'ip-protocol-to-name.h'
288 awkscript = 'ip-protocol-to-name.awk'
289 target2 = custom_target(
290 fname,
291 input : [awkscript, ip_protocol_list_txt],
292 output : fname,
293 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
294 capture : true)
295
296 shared_generated_gperf_headers = [target1, target2]
297 shared_sources += shared_generated_gperf_headers
298
299 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
300
301 libshared_deps = [threads,
302 libacl,
303 libblkid,
304 libcap,
305 libcrypt,
306 libcryptsetup,
307 libgcrypt,
308 libidn,
309 libiptc,
310 libkmod,
311 liblz4,
312 libmount,
313 libopenssl,
314 libp11kit,
315 libpam,
316 librt,
317 libseccomp,
318 libselinux,
319 libxz]
320
321 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
322
323 libshared_static = static_library(
324 libshared_name,
325 shared_sources,
326 include_directories : includes,
327 dependencies : libshared_deps,
328 c_args : ['-fvisibility=default'])
329
330 libshared = shared_library(
331 libshared_name,
332 libudev_sources,
333 include_directories : includes,
334 link_args : ['-shared',
335 '-Wl,--version-script=' + libshared_sym_path],
336 link_whole : [libshared_static,
337 libbasic,
338 libbasic_gcrypt,
339 libsystemd_static,
340 libjournal_client],
341 c_args : ['-fvisibility=default'],
342 dependencies : libshared_deps,
343 install : true,
344 install_dir : rootlibexecdir)