1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
131 linux/auto_dev-ioctl.h
154 netif-naming-scheme.c
155 netif-naming-scheme.h
193 spawn-ask-password-agent.c
194 spawn-ask-password-agent.h
240 if get_option('tests') != 'false'
241 shared_sources += files('tests.c', 'tests.h')
244 test_tables_h = files('test-tables.h')
245 shared_sources += test_tables_h
247 if conf.get('HAVE_ACL') == 1
248 shared_sources += files('acl-util.c')
251 if conf.get('ENABLE_UTMP') == 1
252 shared_sources += files('utmp-wtmp.c')
255 if conf.get('HAVE_SECCOMP') == 1
256 shared_sources += files('seccomp-util.c')
259 if conf.get('HAVE_LIBIPTC') == 1
260 shared_sources += files('firewall-util.c')
263 if conf.get('HAVE_KMOD') == 1
264 shared_sources += files('module-util.c')
267 if conf.get('HAVE_PAM') == 1
268 shared_sources += files('''
274 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
275 ip_protocol_list_txt = custom_target(
276 'ip-protocol-list.txt',
277 output : 'ip-protocol-list.txt',
278 command : [generate_ip_protocol_list, cpp],
281 fname = 'ip-protocol-from-name.gperf'
282 gperf_file = custom_target(
284 input : ip_protocol_list_txt,
286 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
289 fname = 'ip-protocol-from-name.h'
290 target1 = custom_target(
295 '-L', 'ANSI-C', '-t', '--ignore-case',
296 '-N', 'lookup_ip_protocol',
297 '-H', 'hash_ip_protocol_name',
302 fname = 'ip-protocol-to-name.h'
303 awkscript = 'ip-protocol-to-name.awk'
304 target2 = custom_target(
306 input : [awkscript, ip_protocol_list_txt],
308 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
311 shared_generated_gperf_headers = [target1, target2]
312 shared_sources += shared_generated_gperf_headers
314 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
316 libshared_deps = [threads,
336 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
338 libshared_static = static_library(
341 include_directories : includes,
342 dependencies : libshared_deps,
343 c_args : ['-fvisibility=default'])
345 libshared = shared_library(
348 include_directories : includes,
349 link_args : ['-shared',
350 '-Wl,--version-script=' + libshared_sym_path],
351 link_whole : [libshared_static,
356 c_args : ['-fvisibility=default'],
357 dependencies : libshared_deps,
359 install_dir : rootlibexecdir)