]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
creds: add varlink API for encrypting/decrypting credentials
[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 'plymouth-util.c',
141 'pretty-print.c',
142 'ptyfwd.c',
143 'qrcode-util.c',
144 'quota-util.c',
145 'reboot-util.c',
146 'recovery-key.c',
147 'resize-fs.c',
148 'resolve-util.c',
149 'rm-rf.c',
150 'securebits-util.c',
151 'selinux-util.c',
152 'serialize.c',
153 'service-util.c',
154 'sleep-config.c',
155 'smack-util.c',
156 'socket-label.c',
157 'socket-netlink.c',
158 'spawn-ask-password-agent.c',
159 'spawn-polkit-agent.c',
160 'specifier.c',
161 'switch-root.c',
162 'tmpfile-util-label.c',
163 'tomoyo-util.c',
164 'tpm2-util.c',
165 'tpm2-event-log.c',
166 'udev-util.c',
167 'user-record-nss.c',
168 'user-record-show.c',
169 'user-record.c',
170 'userdb-dropin.c',
171 'userdb.c',
172 'varlink.c',
173 'varlink-idl.c',
174 'varlink-io.systemd.c',
175 'varlink-io.systemd.Credentials.c',
176 'varlink-io.systemd.Journal.c',
177 'varlink-io.systemd.ManagedOOM.c',
178 'varlink-io.systemd.PCRExtend.c',
179 'varlink-io.systemd.Resolve.Monitor.c',
180 'varlink-io.systemd.Resolve.c',
181 'varlink-io.systemd.UserDatabase.c',
182 'varlink-io.systemd.oom.c',
183 'varlink-io.systemd.service.c',
184 'varlink-io.systemd.sysext.c',
185 'varlink-org.varlink.service.c',
186 'verb-log-control.c',
187 'verbs.c',
188 'vlan-util.c',
189 'volatile-util.c',
190 'wall.c',
191 'watchdog.c',
192 'web-util.c',
193 'wifi-util.c',
194 'xml.c',
195 )
196
197 if get_option('tests') != 'false'
198 shared_sources += files(
199 'tests.c',
200 )
201 endif
202
203 generate_syscall_list = find_program('generate-syscall-list.py')
204 fname = 'syscall-list.h'
205 syscall_list_h = custom_target(
206 fname,
207 input : syscall_list_txt,
208 output : fname,
209 command : [generate_syscall_list,
210 '@INPUT@'],
211 capture : true)
212
213 if conf.get('HAVE_ACL') == 1
214 shared_sources += files(
215 'devnode-acl.c',
216 )
217 endif
218
219 if conf.get('ENABLE_UTMP') == 1
220 shared_sources += files('utmp-wtmp.c')
221 endif
222
223 if conf.get('HAVE_SECCOMP') == 1
224 shared_sources += files('seccomp-util.c')
225 shared_sources += syscall_list_h
226 endif
227
228 if conf.get('HAVE_LIBIPTC') == 1
229 shared_sources += files('firewall-util-iptables.c')
230 endif
231
232 if conf.get('HAVE_LIBBPF') == 1
233 shared_sources += files(
234 'bpf-link.c',
235 )
236 endif
237
238 if conf.get('HAVE_KMOD') == 1
239 shared_sources += files('module-util.c')
240 endif
241
242 if conf.get('HAVE_PAM') == 1
243 shared_sources += files(
244 'pam-util.c',
245 )
246 endif
247
248 if conf.get('ENABLE_NSCD') == 1
249 shared_sources += files('nscd-flush.c')
250 endif
251
252 if conf.get('HAVE_LIBFIDO2') == 1 and conf.get('HAVE_LIBCRYPTSETUP') == 1
253 shared_sources += files('cryptsetup-fido2.c')
254 endif
255
256 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
257 ip_protocol_list_txt = custom_target(
258 'ip-protocol-list.txt',
259 output : 'ip-protocol-list.txt',
260 command : [generate_ip_protocol_list, cpp],
261 capture : true)
262
263 fname = 'ip-protocol-from-name.gperf'
264 gperf_file = custom_target(
265 fname,
266 input : ip_protocol_list_txt,
267 output : fname,
268 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
269 capture : true)
270
271 fname = 'ip-protocol-from-name.h'
272 target1 = custom_target(
273 fname,
274 input : gperf_file,
275 output : fname,
276 command : [gperf,
277 '-L', 'ANSI-C', '-t', '--ignore-case',
278 '-N', 'lookup_ip_protocol',
279 '-H', 'hash_ip_protocol_name',
280 '-p', '-C',
281 '@INPUT@'],
282 capture : true)
283
284 fname = 'ip-protocol-to-name.h'
285 awkscript = 'ip-protocol-to-name.awk'
286 target2 = custom_target(
287 fname,
288 input : [awkscript, ip_protocol_list_txt],
289 output : fname,
290 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
291 capture : true)
292
293 shared_generated_gperf_headers = [target1, target2]
294 shared_sources += shared_generated_gperf_headers
295
296 fname = 'ethtool-link-mode.h'
297 ethtool_link_mode_h = custom_target(
298 fname,
299 input : ['ethtool-link-mode.py', 'linux/ethtool.h'],
300 output : fname,
301 command : [python, '@INPUT0@', '--header', cpp, '@INPUT1@'],
302 capture : true)
303 shared_sources += ethtool_link_mode_h
304
305 fname = 'ethtool-link-mode.xml'
306 ethtool_link_mode_xml = custom_target(
307 fname,
308 input : ['ethtool-link-mode.py', 'linux/ethtool.h'],
309 output : fname,
310 command : [python, '@INPUT0@', '--xml', cpp, '@INPUT1@'],
311 capture : true)
312 man_page_depends += ethtool_link_mode_xml
313
314 libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag)
315
316 libshared_deps = [threads,
317 libacl,
318 libblkid,
319 libcap,
320 libcrypt,
321 libdl,
322 libgcrypt,
323 libiptc_cflags,
324 libkmod,
325 liblz4,
326 libmount,
327 libopenssl,
328 libp11kit_cflags,
329 libpam,
330 librt,
331 libseccomp,
332 libselinux,
333 libxenctrl_cflags,
334 libxz,
335 libzstd]
336
337 libshared_sym_path = meson.current_source_dir() / 'libshared.sym'
338 libshared_build_dir = meson.current_build_dir()
339
340 libshared_static = static_library(
341 libshared_name,
342 shared_sources,
343 include_directories : includes,
344 dependencies : [libshared_deps,
345 userspace],
346 c_args : ['-fvisibility=default'],
347 build_by_default : false)
348
349 libshared = shared_library(
350 libshared_name,
351 include_directories : includes,
352 c_args : ['-fvisibility=default'],
353 link_args : ['-shared',
354 '-Wl,--version-script=' + libshared_sym_path],
355 link_depends : libshared_sym_path,
356 link_whole : [libshared_static,
357 libbasic,
358 libbasic_gcrypt,
359 libsystemd_static],
360 dependencies : [libshared_deps,
361 userspace],
362 install : true,
363 install_dir : pkglibdir)
364
365 shared_fdisk_sources = files(
366 'fdisk-util.c',
367 )
368
369 libshared_fdisk = static_library(
370 'shared-fdisk',
371 shared_fdisk_sources,
372 include_directories : includes,
373 dependencies : [libfdisk,
374 userspace],
375 c_args : ['-fvisibility=default'],
376 build_by_default : false)