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