1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 shared_sources = files('''
50 bus-print-properties.c
51 bus-print-properties.h
129 firewall-util-private.h
157 in-addr-prefix-util.c
158 in-addr-prefix-util.h
190 linux/auto_dev-ioctl.h
225 netif-naming-scheme.c
226 netif-naming-scheme.h
244 parse-socket-bind-item.c
245 parse-socket-bind-item.h
285 spawn-ask-password-agent.c
286 spawn-ask-password-agent.h
336 if get_option('tests') != 'false'
337 shared_sources += files('''
344 generate_syscall_list = find_program('generate-syscall-list.py')
345 fname = 'syscall-list.h'
346 syscall_list_h = custom_target(
348 input : syscall_list_txt,
350 command : [generate_syscall_list,
354 if conf.get('HAVE_ACL') == 1
355 shared_sources += files('''
361 if conf.get('ENABLE_UTMP') == 1
362 shared_sources += files('utmp-wtmp.c')
365 if conf.get('HAVE_SECCOMP') == 1
366 shared_sources += files('seccomp-util.c')
367 shared_sources += syscall_list_h
370 if conf.get('HAVE_LIBIPTC') == 1
371 shared_sources += files('firewall-util-iptables.c')
374 if conf.get('HAVE_LIBBPF') == 1
375 shared_sources += files('''
381 if conf.get('HAVE_KMOD') == 1
382 shared_sources += files('module-util.c')
385 if conf.get('HAVE_PAM') == 1
386 shared_sources += files(
391 if conf.get('ENABLE_NSCD') == 1
392 shared_sources += files('nscd-flush.c')
395 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
396 ip_protocol_list_txt = custom_target(
397 'ip-protocol-list.txt',
398 output : 'ip-protocol-list.txt',
399 command : [generate_ip_protocol_list, cpp],
402 fname = 'ip-protocol-from-name.gperf'
403 gperf_file = custom_target(
405 input : ip_protocol_list_txt,
407 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
410 fname = 'ip-protocol-from-name.h'
411 target1 = custom_target(
416 '-L', 'ANSI-C', '-t', '--ignore-case',
417 '-N', 'lookup_ip_protocol',
418 '-H', 'hash_ip_protocol_name',
423 fname = 'ip-protocol-to-name.h'
424 awkscript = 'ip-protocol-to-name.awk'
425 target2 = custom_target(
427 input : [awkscript, ip_protocol_list_txt],
429 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
432 shared_generated_gperf_headers = [target1, target2]
433 shared_sources += shared_generated_gperf_headers
435 libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag)
437 libshared_deps = [threads,
457 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
459 libshared_static = static_library(
462 include_directories : includes,
463 dependencies : libshared_deps,
464 c_args : ['-fvisibility=default'],
465 build_by_default : false)
467 libshared = shared_library(
469 include_directories : includes,
470 c_args : ['-fvisibility=default'],
471 link_args : ['-shared',
472 '-Wl,--version-script=' + libshared_sym_path],
473 link_whole : [libshared_static,
477 dependencies : libshared_deps,
479 install_dir : rootlibexecdir)