1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
120 linux/auto_dev-ioctl.h
143 netif-naming-scheme.c
144 netif-naming-scheme.h
180 spawn-ask-password-agent.c
181 spawn-ask-password-agent.h
227 if get_option('tests') != 'false'
228 shared_sources += files('tests.c', 'tests.h')
231 test_tables_h = files('test-tables.h')
232 shared_sources += test_tables_h
234 if conf.get('HAVE_ACL') == 1
235 shared_sources += files('acl-util.c')
238 if conf.get('ENABLE_UTMP') == 1
239 shared_sources += files('utmp-wtmp.c')
242 if conf.get('HAVE_SECCOMP') == 1
243 shared_sources += files('seccomp-util.c')
246 if conf.get('HAVE_LIBIPTC') == 1
247 shared_sources += files('firewall-util.c')
250 if conf.get('HAVE_KMOD') == 1
251 shared_sources += files('module-util.c')
254 if conf.get('HAVE_PAM') == 1
255 shared_sources += files('''
261 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
262 ip_protocol_list_txt = custom_target(
263 'ip-protocol-list.txt',
264 output : 'ip-protocol-list.txt',
265 command : [generate_ip_protocol_list, cpp],
268 fname = 'ip-protocol-from-name.gperf'
269 gperf_file = custom_target(
271 input : ip_protocol_list_txt,
273 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
276 fname = 'ip-protocol-from-name.h'
277 target1 = custom_target(
282 '-L', 'ANSI-C', '-t', '--ignore-case',
283 '-N', 'lookup_ip_protocol',
284 '-H', 'hash_ip_protocol_name',
289 fname = 'ip-protocol-to-name.h'
290 awkscript = 'ip-protocol-to-name.awk'
291 target2 = custom_target(
293 input : [awkscript, ip_protocol_list_txt],
295 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
298 shared_generated_gperf_headers = [target1, target2]
299 shared_sources += shared_generated_gperf_headers
301 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
303 libshared_deps = [threads,
323 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
325 libshared_static = static_library(
328 include_directories : includes,
329 dependencies : libshared_deps,
330 c_args : ['-fvisibility=default'])
332 libshared = shared_library(
335 include_directories : includes,
336 link_args : ['-shared',
337 '-Wl,--version-script=' + libshared_sym_path],
338 link_whole : [libshared_static,
343 c_args : ['-fvisibility=default'],
344 dependencies : libshared_deps,
346 install_dir : rootlibexecdir)