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