]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/meson.build
nsresourced: add client-side helpers around nsresourced APIs
[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
LP
182 'varlink-io.systemd.Journal.c',
183 'varlink-io.systemd.ManagedOOM.c',
8aee931e 184 'varlink-io.systemd.NamespaceResource.c',
c5c74d85 185 'varlink-io.systemd.Network.c',
4e16d5c6 186 'varlink-io.systemd.PCRExtend.c',
15138e79 187 'varlink-io.systemd.PCRLock.c',
abef4a7b 188 'varlink-io.systemd.Resolve.c',
c5c74d85 189 'varlink-io.systemd.Resolve.Monitor.c',
abef4a7b
LP
190 'varlink-io.systemd.UserDatabase.c',
191 'varlink-io.systemd.oom.c',
4ffe0aed 192 'varlink-io.systemd.service.c',
f5151fb4 193 'varlink-io.systemd.sysext.c',
f946d4c9 194 'varlink-org.varlink.service.c',
f1b98127 195 'verb-log-control.c',
f1b98127 196 'verbs.c',
f1b98127 197 'vlan-util.c',
f1b98127 198 'volatile-util.c',
76511c1b 199 'vpick.c',
53c0397b 200 'wall.c',
f1b98127 201 'watchdog.c',
f1b98127 202 'web-util.c',
f1b98127 203 'wifi-util.c',
f1b98127 204 'xml.c',
2f492a73 205)
5c23128d 206
b9fa9b71 207if get_option('tests') != 'false'
04a7790f 208 shared_sources += files('tests.c')
b9fa9b71
MO
209endif
210
95aac012
ZJS
211generate_syscall_list = find_program('generate-syscall-list.py')
212fname = 'syscall-list.h'
213syscall_list_h = custom_target(
214 fname,
984b5296 215 input : syscall_list_txt,
95aac012
ZJS
216 output : fname,
217 command : [generate_syscall_list,
218 '@INPUT@'],
219 capture : true)
220
349cc4a5 221if conf.get('HAVE_ACL') == 1
04a7790f 222 shared_sources += files('devnode-acl.c')
5c23128d
ZJS
223endif
224
3211da4b 225if conf.get('ENABLE_UTMP') == 1
975464e0 226 shared_sources += files('utmp-wtmp.c')
5c23128d
ZJS
227endif
228
349cc4a5 229if conf.get('HAVE_SECCOMP') == 1
975464e0 230 shared_sources += files('seccomp-util.c')
95aac012 231 shared_sources += syscall_list_h
5c23128d
ZJS
232endif
233
349cc4a5 234if conf.get('HAVE_LIBIPTC') == 1
31220972 235 shared_sources += files('firewall-util-iptables.c')
c3045943
MB
236endif
237
43b3f0fb 238if conf.get('HAVE_LIBBPF') == 1
04a7790f 239 shared_sources += files('bpf-link.c')
43b3f0fb
JK
240endif
241
cef9f2a6 242if conf.get('HAVE_PAM') == 1
04a7790f 243 shared_sources += files('pam-util.c')
cef9f2a6
LP
244endif
245
7e0079f9
ZJS
246if conf.get('ENABLE_NSCD') == 1
247 shared_sources += files('nscd-flush.c')
248endif
249
38fc5e03 250if conf.get('HAVE_LIBFIDO2') == 1 and conf.get('HAVE_LIBCRYPTSETUP') == 1
0a8e026e
PC
251 shared_sources += files('cryptsetup-fido2.c')
252endif
253
47b425de
GAP
254if conf.get('HAVE_TPM2') == 1 and conf.get('HAVE_LIBCRYPTSETUP') == 1
255 shared_sources += files('cryptsetup-tpm2.c')
256endif
257
da96ad5a
YW
258generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
259ip_protocol_list_txt = custom_target(
260 'ip-protocol-list.txt',
261 output : 'ip-protocol-list.txt',
262 command : [generate_ip_protocol_list, cpp],
7b5e750d
YW
263 capture : true)
264
da96ad5a 265fname = 'ip-protocol-from-name.gperf'
7b5e750d
YW
266gperf_file = custom_target(
267 fname,
da96ad5a 268 input : ip_protocol_list_txt,
7b5e750d 269 output : fname,
da96ad5a 270 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
7b5e750d
YW
271 capture : true)
272
da96ad5a 273fname = 'ip-protocol-from-name.h'
7b5e750d
YW
274target1 = custom_target(
275 fname,
276 input : gperf_file,
277 output : fname,
278 command : [gperf,
279 '-L', 'ANSI-C', '-t', '--ignore-case',
da96ad5a
YW
280 '-N', 'lookup_ip_protocol',
281 '-H', 'hash_ip_protocol_name',
7b5e750d
YW
282 '-p', '-C',
283 '@INPUT@'],
284 capture : true)
285
da96ad5a
YW
286fname = 'ip-protocol-to-name.h'
287awkscript = 'ip-protocol-to-name.awk'
7b5e750d
YW
288target2 = custom_target(
289 fname,
da96ad5a 290 input : [awkscript, ip_protocol_list_txt],
7b5e750d
YW
291 output : fname,
292 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
293 capture : true)
294
dca23091
YW
295shared_generated_gperf_headers = [target1, target2]
296shared_sources += shared_generated_gperf_headers
7b5e750d 297
6049ddcc
ZJS
298fname = 'ethtool-link-mode.h'
299ethtool_link_mode_h = custom_target(
300 fname,
301 input : ['ethtool-link-mode.py', 'linux/ethtool.h'],
302 output : fname,
1e473c2e 303 command : [python, '@INPUT0@', '--header', cpp, '@INPUT1@'],
6049ddcc
ZJS
304 capture : true)
305shared_sources += ethtool_link_mode_h
306
c18dde32
ZJS
307fname = 'ethtool-link-mode.xml'
308ethtool_link_mode_xml = custom_target(
309 fname,
310 input : ['ethtool-link-mode.py', 'linux/ethtool.h'],
311 output : fname,
1e473c2e 312 command : [python, '@INPUT0@', '--xml', cpp, '@INPUT1@'],
c18dde32
ZJS
313 capture : true)
314man_page_depends += ethtool_link_mode_xml
315
a2b0cd3f 316libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag)
5c23128d 317
4b57a272 318libshared_deps = [threads,
4b57a272 319 libacl,
462255c6
LP
320 libblkid,
321 libcap,
42f3b2f9 322 libcrypt,
c5fd89ad 323 libdl,
4b57a272 324 libgcrypt,
5b5f8f8b 325 libiptc_cflags,
1d98716e 326 libkmod_cflags,
3fc72d54 327 liblz4_cflags,
77c772f2 328 libmount,
839fddbe 329 libopenssl,
da035a3a 330 libp11kit_cflags,
cef9f2a6 331 libpam,
462255c6 332 librt,
4b57a272
ZJS
333 libseccomp,
334 libselinux,
2bdd7a8a 335 libxenctrl_cflags,
3fc72d54
MC
336 libxz_cflags,
337 libzstd_cflags]
4b57a272 338
90461ef5 339libshared_sym_path = meson.current_source_dir() / 'libshared.sym'
c18dde32 340libshared_build_dir = meson.current_build_dir()
4f5993c3 341
2d4ceca8 342libshared_static = static_library(
37efbbd8
ZJS
343 libshared_name,
344 shared_sources,
2d4ceca8 345 include_directories : includes,
92148283
JJ
346 dependencies : [libshared_deps,
347 userspace],
03f7ddf0
ZJS
348 c_args : ['-fvisibility=default'],
349 build_by_default : false)
2d4ceca8
ZJS
350
351libshared = shared_library(
352 libshared_name,
37efbbd8 353 include_directories : includes,
4287c855 354 c_args : ['-fvisibility=default'],
4f5993c3 355 link_args : ['-shared',
2d4ceca8 356 '-Wl,--version-script=' + libshared_sym_path],
90461ef5 357 link_depends : libshared_sym_path,
2d4ceca8 358 link_whole : [libshared_static,
34e221a5 359 libbasic,
99b9f8fd 360 libsystemd_static],
92148283
JJ
361 dependencies : [libshared_deps,
362 userspace],
37efbbd8 363 install : true,
b0d3095f 364 install_dir : pkglibdir)
f8cf3d19 365
04a7790f 366shared_fdisk_sources = files('fdisk-util.c')
f8cf3d19 367
9ee80846
JJ
368libshared_fdisk = static_library(
369 'shared-fdisk',
370 shared_fdisk_sources,
371 include_directories : includes,
372 dependencies : [libfdisk,
373 userspace],
374 c_args : ['-fvisibility=default'],
375 build_by_default : false)