| 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-agent.c', |
| 8 |
'ask-password-api.c', |
| 9 |
'async.c', |
| 10 |
'barrier.c', |
| 11 |
'base-filesystem.c', |
| 12 |
'battery-util.c', |
| 13 |
'binfmt-util.c', |
| 14 |
'bitmap.c', |
| 15 |
'blkid-util.c', |
| 16 |
'blockdev-list.c', |
| 17 |
'blockdev-util.c', |
| 18 |
'bond-util.c', |
| 19 |
'boot-entry.c', |
| 20 |
'boot-timestamps.c', |
| 21 |
'bootspec.c', |
| 22 |
'bpf-program.c', |
| 23 |
'bpf-util.c', |
| 24 |
'bridge-util.c', |
| 25 |
'btrfs-util.c', |
| 26 |
'bus-get-properties.c', |
| 27 |
'bus-locator.c', |
| 28 |
'bus-log-control-api.c', |
| 29 |
'bus-map-properties.c', |
| 30 |
'bus-message-util.c', |
| 31 |
'bus-object.c', |
| 32 |
'bus-polkit.c', |
| 33 |
'bus-print-properties.c', |
| 34 |
'bus-unit-procs.c', |
| 35 |
'bus-unit-util.c', |
| 36 |
'bus-util.c', |
| 37 |
'bus-wait-for-jobs.c', |
| 38 |
'bus-wait-for-units.c', |
| 39 |
'calendarspec.c', |
| 40 |
'cgroup-setup.c', |
| 41 |
'cgroup-show.c', |
| 42 |
'chown-recursive.c', |
| 43 |
'clean-ipc.c', |
| 44 |
'clock-util.c', |
| 45 |
'color-util.c', |
| 46 |
'common-signal.c', |
| 47 |
'compare-operator.c', |
| 48 |
'condition.c', |
| 49 |
'conf-parser.c', |
| 50 |
'copy.c', |
| 51 |
'coredump-util.c', |
| 52 |
'cpu-set-util.c', |
| 53 |
'creds-util.c', |
| 54 |
'crypto-util.c', |
| 55 |
'cryptsetup-fido2.c', |
| 56 |
'cryptsetup-tpm2.c', |
| 57 |
'cryptsetup-util.c', |
| 58 |
'curl-util.c', |
| 59 |
'daemon-util.c', |
| 60 |
'data-fd-util.c', |
| 61 |
'dev-setup.c', |
| 62 |
'discover-image.c', |
| 63 |
'dissect-image.c', |
| 64 |
'dm-util.c', |
| 65 |
'dns-answer.c', |
| 66 |
'dns-configuration.c', |
| 67 |
'dns-domain.c', |
| 68 |
'dns-packet.c', |
| 69 |
'dns-question.c', |
| 70 |
'dns-rr.c', |
| 71 |
'dns-type.c', |
| 72 |
'dropin.c', |
| 73 |
'edit-util.c', |
| 74 |
'efi-api.c', |
| 75 |
'efi-loader.c', |
| 76 |
'elf-util.c', |
| 77 |
'enable-mempool.c', |
| 78 |
'ethtool-util.c', |
| 79 |
'exec-util.c', |
| 80 |
'exit-status.c', |
| 81 |
'extension-util.c', |
| 82 |
'factory-reset.c', |
| 83 |
'fdisk-util.c', |
| 84 |
'fdset.c', |
| 85 |
'fido2-util.c', |
| 86 |
'find-esp.c', |
| 87 |
'firewall-util.c', |
| 88 |
'fork-notify.c', |
| 89 |
'format-table.c', |
| 90 |
'fstab-util.c', |
| 91 |
'generator.c', |
| 92 |
'geneve-util.c', |
| 93 |
'gnutls-util.c', |
| 94 |
'gpt.c', |
| 95 |
'group-record.c', |
| 96 |
'help-util.c', |
| 97 |
'hibernate-util.c', |
| 98 |
'hostname-setup.c', |
| 99 |
'hwdb-util.c', |
| 100 |
'id128-print.c', |
| 101 |
'idn-util.c', |
| 102 |
'ima-util.c', |
| 103 |
'image-policy.c', |
| 104 |
'import-util.c', |
| 105 |
'in-addr-prefix-util.c', |
| 106 |
'install-file.c', |
| 107 |
'install-printf.c', |
| 108 |
'install.c', |
| 109 |
'ioprio-util.c', |
| 110 |
'ip-protocol-list.c', |
| 111 |
'ipvlan-util.c', |
| 112 |
'journal-file-util.c', |
| 113 |
'journal-importer.c', |
| 114 |
'journal-util.c', |
| 115 |
'kbd-util.c', |
| 116 |
'kernel-config.c', |
| 117 |
'kernel-image.c', |
| 118 |
'killall.c', |
| 119 |
'label-util.c', |
| 120 |
'libarchive-util.c', |
| 121 |
'libaudit-util.c', |
| 122 |
'libcrypt-util.c', |
| 123 |
'libfido2-util.c', |
| 124 |
'libmount-util.c', |
| 125 |
'local-addresses.c', |
| 126 |
'locale-setup.c', |
| 127 |
'log-assert-critical.c', |
| 128 |
'logs-show.c', |
| 129 |
'loop-util.c', |
| 130 |
'loopback-setup.c', |
| 131 |
'lsm-util.c', |
| 132 |
'luo-util.c', |
| 133 |
'machine-bind-user.c', |
| 134 |
'machine-credential.c', |
| 135 |
'machine-id-setup.c', |
| 136 |
'machine-register.c', |
| 137 |
'machine-util.c', |
| 138 |
'macvlan-util.c', |
| 139 |
'main-func.c', |
| 140 |
'metrics.c', |
| 141 |
'microhttpd-util.c', |
| 142 |
'mkdir.c', |
| 143 |
'mkfs-util.c', |
| 144 |
'module-util.c', |
| 145 |
'mount-setup.c', |
| 146 |
'mount-util.c', |
| 147 |
'mstack.c', |
| 148 |
'net-condition.c', |
| 149 |
'netif-naming-scheme.c', |
| 150 |
'netif-sriov.c', |
| 151 |
'netif-util.c', |
| 152 |
'notify-recv.c', |
| 153 |
'nsflags.c', |
| 154 |
'nsresource.c', |
| 155 |
'numa-util.c', |
| 156 |
'open-file.c', |
| 157 |
'options.c', |
| 158 |
'osc-context.c', |
| 159 |
'output-mode.c', |
| 160 |
'pager.c', |
| 161 |
'pam-util.c', |
| 162 |
'parse-argument.c', |
| 163 |
'parse-helpers.c', |
| 164 |
'password-quality-util-passwdqc.c', |
| 165 |
'password-quality-util-pwquality.c', |
| 166 |
'pcre2-util.c', |
| 167 |
'pcrextend-util.c', |
| 168 |
'pe-binary.c', |
| 169 |
'pkcs7-util.c', |
| 170 |
'pkcs11-util.c', |
| 171 |
'plymouth-util.c', |
| 172 |
'polkit-agent.c', |
| 173 |
'portable-util.c', |
| 174 |
'pretty-print.c', |
| 175 |
'printk-util.c', |
| 176 |
'prompt-util.c', |
| 177 |
'ptyfwd.c', |
| 178 |
'qmp-client.c', |
| 179 |
'qrcode-util.c', |
| 180 |
'quota-util.c', |
| 181 |
'reboot-util.c', |
| 182 |
'recovery-key.c', |
| 183 |
'reread-partition-table.c', |
| 184 |
'resize-fs.c', |
| 185 |
'resolve-hook-util.c', |
| 186 |
'resolve-util.c', |
| 187 |
'rm-rf.c', |
| 188 |
'seccomp-util.c', |
| 189 |
'securebits-util.c', |
| 190 |
'selinux-util.c', |
| 191 |
'serialize.c', |
| 192 |
'service-util.c', |
| 193 |
'shift-uid.c', |
| 194 |
'sleep-config.c', |
| 195 |
'smack-util.c', |
| 196 |
'smbios11.c', |
| 197 |
'snapshot-util.c', |
| 198 |
'socket-forward.c', |
| 199 |
'socket-label.c', |
| 200 |
'socket-netlink.c', |
| 201 |
'specifier.c', |
| 202 |
'ssl-util.c', |
| 203 |
'storage-util.c', |
| 204 |
'switch-root.c', |
| 205 |
'swtpm-util.c', |
| 206 |
'tar-util.c', |
| 207 |
'tmpfile-util.c', |
| 208 |
'tomoyo-util.c', |
| 209 |
'tpm2-util.c', |
| 210 |
'tpm2-event-log.c', |
| 211 |
'udev-util.c', |
| 212 |
'unit-file.c', |
| 213 |
'user-record-nss.c', |
| 214 |
'user-record-show.c', |
| 215 |
'user-record.c', |
| 216 |
'userdb-dropin.c', |
| 217 |
'userdb.c', |
| 218 |
'varlink-idl-common.c', |
| 219 |
'varlink-io.systemd.AskPassword.c', |
| 220 |
'varlink-io.systemd.BootControl.c', |
| 221 |
'varlink-io.systemd.Credentials.c', |
| 222 |
'varlink-io.systemd.FactoryReset.c', |
| 223 |
'varlink-io.systemd.Hostname.c', |
| 224 |
'varlink-io.systemd.Import.c', |
| 225 |
'varlink-io.systemd.InstanceMetadata.c', |
| 226 |
'varlink-io.systemd.Job.c', |
| 227 |
'varlink-io.systemd.Journal.c', |
| 228 |
'varlink-io.systemd.JournalAccess.c', |
| 229 |
'varlink-io.systemd.Login.c', |
| 230 |
'varlink-io.systemd.Machine.c', |
| 231 |
'varlink-io.systemd.MachineImage.c', |
| 232 |
'varlink-io.systemd.MachineInstance.c', |
| 233 |
'varlink-io.systemd.ManagedOOM.c', |
| 234 |
'varlink-io.systemd.Manager.c', |
| 235 |
'varlink-io.systemd.Metrics.c', |
| 236 |
'varlink-io.systemd.MountFileSystem.c', |
| 237 |
'varlink-io.systemd.MuteConsole.c', |
| 238 |
'varlink-io.systemd.NamespaceResource.c', |
| 239 |
'varlink-io.systemd.Network.c', |
| 240 |
'varlink-io.systemd.Network.Link.c', |
| 241 |
'varlink-io.systemd.PCRExtend.c', |
| 242 |
'varlink-io.systemd.PCRLock.c', |
| 243 |
'varlink-io.systemd.Repart.c', |
| 244 |
'varlink-io.systemd.Resolve.c', |
| 245 |
'varlink-io.systemd.Resolve.Hook.c', |
| 246 |
'varlink-io.systemd.Resolve.Monitor.c', |
| 247 |
'varlink-io.systemd.Shutdown.c', |
| 248 |
'varlink-io.systemd.StorageProvider.c', |
| 249 |
'varlink-io.systemd.Udev.c', |
| 250 |
'varlink-io.systemd.Unit.c', |
| 251 |
'varlink-io.systemd.UserDatabase.c', |
| 252 |
'varlink-io.systemd.VirtualMachineInstance.c', |
| 253 |
'varlink-io.systemd.oom.c', |
| 254 |
'varlink-io.systemd.oom.Prekill.c', |
| 255 |
'varlink-io.systemd.service.c', |
| 256 |
'varlink-io.systemd.sysext.c', |
| 257 |
'varlink-serialize.c', |
| 258 |
'vconsole-util.c', |
| 259 |
'verb-log-control.c', |
| 260 |
'verbs.c', |
| 261 |
'vlan-util.c', |
| 262 |
'volatile-util.c', |
| 263 |
'vpick.c', |
| 264 |
'vsock-util.c', |
| 265 |
'wall.c', |
| 266 |
'watchdog.c', |
| 267 |
'web-util.c', |
| 268 |
'wifi-util.c', |
| 269 |
'xml.c', |
| 270 |
) |
| 271 |
|
| 272 |
if get_option('tests') != 'false' |
| 273 |
shared_sources += files('tests.c') |
| 274 |
endif |
| 275 |
|
| 276 |
syscall_list_inc = custom_target( |
| 277 |
input : syscall_list_txt, |
| 278 |
output : 'syscall-list.inc', |
| 279 |
command : [files('generate-syscall-list.py'), |
| 280 |
'@INPUT@'], |
| 281 |
capture : true) |
| 282 |
|
| 283 |
generated_sources += syscall_list_inc |
| 284 |
shared_sources += syscall_list_inc |
| 285 |
|
| 286 |
if conf.get('ENABLE_NSS') == 1 |
| 287 |
shared_sources += files('nss-util.c') |
| 288 |
endif |
| 289 |
|
| 290 |
if conf.get('ENABLE_UTMP') == 1 |
| 291 |
shared_sources += files('utmp-wtmp.c') |
| 292 |
endif |
| 293 |
|
| 294 |
if conf.get('HAVE_LIBBPF') == 1 |
| 295 |
shared_sources += files('bpf-link.c') |
| 296 |
endif |
| 297 |
|
| 298 |
generate_ip_protocol_list = files('generate-ip-protocol-list.sh') |
| 299 |
ip_protocol_list_txt = custom_target( |
| 300 |
input : [generate_ip_protocol_list, ipproto_sources], |
| 301 |
output : 'ip-protocol-list.txt', |
| 302 |
command : [env, 'bash', generate_ip_protocol_list, cpp, system_include_args], |
| 303 |
capture : true) |
| 304 |
|
| 305 |
gperf_file = custom_target( |
| 306 |
input : ip_protocol_list_txt, |
| 307 |
output : 'ip-protocol-from-name.gperf', |
| 308 |
command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@', '<netinet/in.h>'], |
| 309 |
capture : true) |
| 310 |
|
| 311 |
target1 = custom_target( |
| 312 |
input : gperf_file, |
| 313 |
output : 'ip-protocol-from-name.inc', |
| 314 |
command : [gperf, |
| 315 |
'-L', 'ANSI-C', '-t', '--ignore-case', |
| 316 |
'-N', 'lookup_ip_protocol', |
| 317 |
'-H', 'hash_ip_protocol_name', |
| 318 |
'-p', '-C', |
| 319 |
'@INPUT@'], |
| 320 |
capture : true) |
| 321 |
|
| 322 |
awkscript = 'ip-protocol-to-name.awk' |
| 323 |
target2 = custom_target( |
| 324 |
input : [awkscript, ip_protocol_list_txt], |
| 325 |
output : 'ip-protocol-to-name.inc', |
| 326 |
command : [awk, '-f', '@INPUT0@', '@INPUT1@'], |
| 327 |
capture : true) |
| 328 |
|
| 329 |
generated_sources += [target1, target2] |
| 330 |
shared_sources += [target1, target2] |
| 331 |
|
| 332 |
ethtool_link_mode_py = files('ethtool-link-mode.py') |
| 333 |
ethtool_link_mode_inc = custom_target( |
| 334 |
input : [ethtool_link_mode_py, ethtool_link_mode_sources], |
| 335 |
output : 'ethtool-link-mode.inc', |
| 336 |
command : [python, ethtool_link_mode_py, '--header', cpp, system_include_args], |
| 337 |
capture : true) |
| 338 |
|
| 339 |
generated_sources += ethtool_link_mode_inc |
| 340 |
shared_sources += ethtool_link_mode_inc |
| 341 |
sources += shared_sources |
| 342 |
|
| 343 |
ethtool_link_mode_xml = custom_target( |
| 344 |
input : [ethtool_link_mode_py, ethtool_link_mode_sources], |
| 345 |
output : 'ethtool-link-mode.xml', |
| 346 |
command : [python, ethtool_link_mode_py, '--xml', cpp, system_include_args], |
| 347 |
capture : true) |
| 348 |
man_page_depends += ethtool_link_mode_xml |
| 349 |
|
| 350 |
dns_type_list_txt = custom_target( |
| 351 |
input : ['generate-dns_type-list.sed', 'dns-type.h'], |
| 352 |
output : 'dns_type-list.txt', |
| 353 |
command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'], |
| 354 |
capture : true) |
| 355 |
|
| 356 |
gperf_file = custom_target( |
| 357 |
input : dns_type_list_txt, |
| 358 |
output : 'dns_type-from-name.gperf', |
| 359 |
command : [files('generate-dns_type-gperf.py'), |
| 360 |
'dns_type', |
| 361 |
'DNS_TYPE_', |
| 362 |
'@INPUT@'], |
| 363 |
capture : true) |
| 364 |
|
| 365 |
dns_type_from_name_inc = custom_target( |
| 366 |
input : gperf_file, |
| 367 |
output : 'dns_type-from-name.inc', |
| 368 |
command : [gperf, |
| 369 |
'-L', 'ANSI-C', '-t', '--ignore-case', |
| 370 |
'-N', 'lookup_dns_type', |
| 371 |
'-H', 'hash_dns_type_name', |
| 372 |
'-p', '-C', |
| 373 |
'@INPUT@'], |
| 374 |
capture : true) |
| 375 |
|
| 376 |
dns_type_to_name_inc = custom_target( |
| 377 |
input : ['dns_type-to-name.awk', dns_type_list_txt], |
| 378 |
output : 'dns_type-to-name.inc', |
| 379 |
command : [awk, '-f', '@INPUT0@', '@INPUT1@'], |
| 380 |
capture : true) |
| 381 |
|
| 382 |
generated_sources += [dns_type_from_name_inc, dns_type_to_name_inc] |
| 383 |
shared_sources += [dns_type_from_name_inc, dns_type_to_name_inc] |
| 384 |
|
| 385 |
libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag) |
| 386 |
|
| 387 |
libshared_deps = [libacl_cflags, |
| 388 |
libapparmor_cflags, |
| 389 |
libarchive_cflags, |
| 390 |
libaudit_cflags, |
| 391 |
libblkid_cflags, |
| 392 |
libbpf_cflags, |
| 393 |
libcrypt_cflags, |
| 394 |
libcryptsetup_cflags, |
| 395 |
libcurl_cflags, |
| 396 |
libdw_cflags, |
| 397 |
libelf_cflags, |
| 398 |
libfdisk_cflags, |
| 399 |
libfido2_cflags, |
| 400 |
libgcrypt_cflags, |
| 401 |
libgnutls_cflags, |
| 402 |
libidn2_cflags, |
| 403 |
libkmod_cflags, |
| 404 |
libmicrohttpd_cflags, |
| 405 |
libmount_cflags, |
| 406 |
libopenssl_cflags, |
| 407 |
libp11kit_cflags, |
| 408 |
libpam_cflags, |
| 409 |
libpcre2_cflags, |
| 410 |
libpwquality_cflags, |
| 411 |
libqrencode_cflags, |
| 412 |
libseccomp_cflags, |
| 413 |
libselinux_cflags, |
| 414 |
libucontext, |
| 415 |
libxenctrl_cflags, |
| 416 |
libxz_cflags, |
| 417 |
libzstd_cflags, |
| 418 |
tpm2_cflags] |
| 419 |
|
| 420 |
libshared_sym_path = meson.current_source_dir() / 'libshared.sym' |
| 421 |
libshared_build_dir = meson.current_build_dir() |
| 422 |
|
| 423 |
libshared_static = static_library( |
| 424 |
libshared_name, |
| 425 |
shared_sources, |
| 426 |
include_directories : includes, |
| 427 |
implicit_include_directories : false, |
| 428 |
dependencies : [libshared_deps, |
| 429 |
userspace], |
| 430 |
c_args : ['-fvisibility=default'], |
| 431 |
build_by_default : false) |
| 432 |
|
| 433 |
libshared = shared_library( |
| 434 |
libshared_name, |
| 435 |
include_directories : includes, |
| 436 |
implicit_include_directories : false, |
| 437 |
c_args : ['-fvisibility=default'], |
| 438 |
link_args : ['-shared', |
| 439 |
'-Wl,--version-script=' + libshared_sym_path], |
| 440 |
link_depends : libshared_sym_path, |
| 441 |
link_whole : [libc_wrapper_static, |
| 442 |
libshared_static, |
| 443 |
libbasic_static, |
| 444 |
libsystemd_static], |
| 445 |
dependencies : [libshared_deps, |
| 446 |
userspace], |
| 447 |
install : true, |
| 448 |
install_dir : pkglibdir) |