]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
Merge pull request #28891 from poettering/pcrlock
[thirdparty/systemd.git] / src / shared / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 shared_sources = files(
4 'acl-util.c',
5 'acpi-fpdt.c',
6 'apparmor-util.c',
7 'ask-password-api.c',
8 'async.c',
9 'barrier.c',
10 'base-filesystem.c',
11 'battery-util.c',
12 'binfmt-util.c',
13 'bitmap.c',
14 'blockdev-util.c',
15 'bond-util.c',
16 'boot-entry.c',
17 'boot-timestamps.c',
18 'bootspec.c',
19 'bpf-dlopen.c',
20 'bpf-program.c',
21 'bridge-util.c',
22 'btrfs-util.c',
23 'bus-get-properties.c',
24 'bus-locator.c',
25 'bus-log-control-api.c',
26 'bus-map-properties.c',
27 'bus-message-util.c',
28 'bus-object.c',
29 'bus-polkit.c',
30 'bus-print-properties.c',
31 'bus-unit-procs.c',
32 'bus-unit-util.c',
33 'bus-util.c',
34 'bus-wait-for-jobs.c',
35 'bus-wait-for-units.c',
36 'calendarspec.c',
37 'cgroup-setup.c',
38 'cgroup-show.c',
39 'chown-recursive.c',
40 'clean-ipc.c',
41 'clock-util.c',
42 'common-signal.c',
43 'compare-operator.c',
44 'condition.c',
45 'conf-parser.c',
46 'copy.c',
47 'coredump-util.c',
48 'cpu-set-util.c',
49 'creds-util.c',
50 'cryptsetup-util.c',
51 'daemon-util.c',
52 'data-fd-util.c',
53 'dev-setup.c',
54 'device-nodes.c',
55 'discover-image.c',
56 'dissect-image.c',
57 'dlfcn-util.c',
58 'dm-util.c',
59 'dns-domain.c',
60 'dropin.c',
61 'edit-util.c',
62 'efi-api.c',
63 'efi-loader.c',
64 'elf-util.c',
65 'enable-mempool.c',
66 'env-file-label.c',
67 'ethtool-util.c',
68 'exec-util.c',
69 'exit-status.c',
70 'extension-util.c',
71 'fdset.c',
72 'fileio-label.c',
73 'find-esp.c',
74 'firewall-util-nft.c',
75 'firewall-util.c',
76 'format-table.c',
77 'fstab-util.c',
78 'generator.c',
79 'geneve-util.c',
80 'gpt.c',
81 'group-record.c',
82 'hibernate-util.c',
83 'hostname-setup.c',
84 'hwdb-util.c',
85 'id128-print.c',
86 'idn-util.c',
87 'ima-util.c',
88 'image-policy.c',
89 'import-util.c',
90 'in-addr-prefix-util.c',
91 'install-file.c',
92 'install-printf.c',
93 'install.c',
94 'ip-protocol-list.c',
95 'ipvlan-util.c',
96 'journal-file-util.c',
97 'journal-importer.c',
98 'journal-util.c',
99 'json.c',
100 'kbd-util.c',
101 'kernel-image.c',
102 'keyring-util.c',
103 'killall.c',
104 'label-util.c',
105 'libcrypt-util.c',
106 'libfido2-util.c',
107 'libmount-util.c',
108 'local-addresses.c',
109 'locale-setup.c',
110 'logs-show.c',
111 'loop-util.c',
112 'loopback-setup.c',
113 'lsm-util.c',
114 'machine-credential.c',
115 'machine-id-setup.c',
116 'machine-pool.c',
117 'macvlan-util.c',
118 'mkdir-label.c',
119 'mkfs-util.c',
120 'mount-setup.c',
121 'mount-util.c',
122 'net-condition.c',
123 'netif-naming-scheme.c',
124 'netif-sriov.c',
125 'netif-util.c',
126 'nsflags.c',
127 'numa-util.c',
128 'open-file.c',
129 'openssl-util.c',
130 'output-mode.c',
131 'pager.c',
132 'parse-argument.c',
133 'parse-helpers.c',
134 'password-quality-util-passwdqc.c',
135 'password-quality-util-pwquality.c',
136 'pcre2-util.c',
137 'pcrextend-util.c',
138 'pe-binary.c',
139 'pkcs11-util.c',
140 'pretty-print.c',
141 'ptyfwd.c',
142 'qrcode-util.c',
143 'quota-util.c',
144 'reboot-util.c',
145 'recovery-key.c',
146 'resize-fs.c',
147 'resolve-util.c',
148 'rm-rf.c',
149 'securebits-util.c',
150 'selinux-util.c',
151 'serialize.c',
152 'service-util.c',
153 'sleep-config.c',
154 'smack-util.c',
155 'socket-label.c',
156 'socket-netlink.c',
157 'spawn-ask-password-agent.c',
158 'spawn-polkit-agent.c',
159 'specifier.c',
160 'switch-root.c',
161 'tmpfile-util-label.c',
162 'tomoyo-util.c',
163 'tpm2-util.c',
164 'tpm2-event-log.c',
165 'udev-util.c',
166 'user-record-nss.c',
167 'user-record-show.c',
168 'user-record.c',
169 'userdb-dropin.c',
170 'userdb.c',
171 'varlink.c',
172 'varlink-idl.c',
173 'varlink-io.systemd.c',
174 'varlink-io.systemd.Journal.c',
175 'varlink-io.systemd.ManagedOOM.c',
176 'varlink-io.systemd.PCRExtend.c',
177 'varlink-io.systemd.Resolve.Monitor.c',
178 'varlink-io.systemd.Resolve.c',
179 'varlink-io.systemd.UserDatabase.c',
180 'varlink-io.systemd.oom.c',
181 'varlink-io.systemd.service.c',
182 'varlink-io.systemd.sysext.c',
183 'varlink-org.varlink.service.c',
184 'verb-log-control.c',
185 'verbs.c',
186 'vlan-util.c',
187 'volatile-util.c',
188 'wall.c',
189 'watchdog.c',
190 'web-util.c',
191 'wifi-util.c',
192 'xml.c',
193 )
194
195 if get_option('tests') != 'false'
196 shared_sources += files(
197 'tests.c',
198 )
199 endif
200
201 generate_syscall_list = find_program('generate-syscall-list.py')
202 fname = 'syscall-list.h'
203 syscall_list_h = custom_target(
204 fname,
205 input : syscall_list_txt,
206 output : fname,
207 command : [generate_syscall_list,
208 '@INPUT@'],
209 capture : true)
210
211 if conf.get('HAVE_ACL') == 1
212 shared_sources += files(
213 'devnode-acl.c',
214 )
215 endif
216
217 if conf.get('ENABLE_UTMP') == 1
218 shared_sources += files('utmp-wtmp.c')
219 endif
220
221 if conf.get('HAVE_SECCOMP') == 1
222 shared_sources += files('seccomp-util.c')
223 shared_sources += syscall_list_h
224 endif
225
226 if conf.get('HAVE_LIBIPTC') == 1
227 shared_sources += files('firewall-util-iptables.c')
228 endif
229
230 if conf.get('HAVE_LIBBPF') == 1
231 shared_sources += files(
232 'bpf-link.c',
233 )
234 endif
235
236 if conf.get('HAVE_KMOD') == 1
237 shared_sources += files('module-util.c')
238 endif
239
240 if conf.get('HAVE_PAM') == 1
241 shared_sources += files(
242 'pam-util.c',
243 )
244 endif
245
246 if conf.get('ENABLE_NSCD') == 1
247 shared_sources += files('nscd-flush.c')
248 endif
249
250 if conf.get('HAVE_LIBFIDO2') == 1 and conf.get('HAVE_LIBCRYPTSETUP') == 1
251 shared_sources += files('cryptsetup-fido2.c')
252 endif
253
254 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
255 ip_protocol_list_txt = custom_target(
256 'ip-protocol-list.txt',
257 output : 'ip-protocol-list.txt',
258 command : [generate_ip_protocol_list, cpp],
259 capture : true)
260
261 fname = 'ip-protocol-from-name.gperf'
262 gperf_file = custom_target(
263 fname,
264 input : ip_protocol_list_txt,
265 output : fname,
266 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
267 capture : true)
268
269 fname = 'ip-protocol-from-name.h'
270 target1 = custom_target(
271 fname,
272 input : gperf_file,
273 output : fname,
274 command : [gperf,
275 '-L', 'ANSI-C', '-t', '--ignore-case',
276 '-N', 'lookup_ip_protocol',
277 '-H', 'hash_ip_protocol_name',
278 '-p', '-C',
279 '@INPUT@'],
280 capture : true)
281
282 fname = 'ip-protocol-to-name.h'
283 awkscript = 'ip-protocol-to-name.awk'
284 target2 = custom_target(
285 fname,
286 input : [awkscript, ip_protocol_list_txt],
287 output : fname,
288 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
289 capture : true)
290
291 shared_generated_gperf_headers = [target1, target2]
292 shared_sources += shared_generated_gperf_headers
293
294 fname = 'ethtool-link-mode.h'
295 ethtool_link_mode_h = custom_target(
296 fname,
297 input : ['ethtool-link-mode.py', 'linux/ethtool.h'],
298 output : fname,
299 command : [python, '@INPUT0@', '--header', cpp, '@INPUT1@'],
300 capture : true)
301 shared_sources += ethtool_link_mode_h
302
303 fname = 'ethtool-link-mode.xml'
304 ethtool_link_mode_xml = custom_target(
305 fname,
306 input : ['ethtool-link-mode.py', 'linux/ethtool.h'],
307 output : fname,
308 command : [python, '@INPUT0@', '--xml', cpp, '@INPUT1@'],
309 capture : true)
310 man_page_depends += ethtool_link_mode_xml
311
312 libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag)
313
314 libshared_deps = [threads,
315 libacl,
316 libblkid,
317 libcap,
318 libcrypt,
319 libdl,
320 libgcrypt,
321 libiptc_cflags,
322 libkmod,
323 liblz4,
324 libmount,
325 libopenssl,
326 libp11kit_cflags,
327 libpam,
328 librt,
329 libseccomp,
330 libselinux,
331 libxenctrl_cflags,
332 libxz,
333 libzstd]
334
335 libshared_sym_path = meson.current_source_dir() / 'libshared.sym'
336 libshared_build_dir = meson.current_build_dir()
337
338 libshared_static = static_library(
339 libshared_name,
340 shared_sources,
341 include_directories : includes,
342 dependencies : [libshared_deps,
343 userspace],
344 c_args : ['-fvisibility=default'],
345 build_by_default : false)
346
347 libshared = shared_library(
348 libshared_name,
349 include_directories : includes,
350 c_args : ['-fvisibility=default'],
351 link_args : ['-shared',
352 '-Wl,--version-script=' + libshared_sym_path],
353 link_depends : libshared_sym_path,
354 link_whole : [libshared_static,
355 libbasic,
356 libbasic_gcrypt,
357 libsystemd_static],
358 dependencies : [libshared_deps,
359 userspace],
360 install : true,
361 install_dir : pkglibdir)
362
363 shared_fdisk_sources = files(
364 'fdisk-util.c',
365 )
366
367 libshared_fdisk = static_library(
368 'shared-fdisk',
369 shared_fdisk_sources,
370 include_directories : includes,
371 dependencies : [libfdisk,
372 userspace],
373 c_args : ['-fvisibility=default'],
374 build_by_default : false)