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