1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
137 linux/auto_dev-ioctl.h
162 netif-naming-scheme.c
163 netif-naming-scheme.h
201 spawn-ask-password-agent.c
202 spawn-ask-password-agent.h
248 if get_option('tests') != 'false'
249 shared_sources += files('tests.c', 'tests.h')
252 test_tables_h = files('test-tables.h')
253 shared_sources += test_tables_h
255 if conf.get('HAVE_ACL') == 1
256 shared_sources += files('acl-util.c')
259 if conf.get('ENABLE_UTMP') == 1
260 shared_sources += files('utmp-wtmp.c')
263 if conf.get('HAVE_SECCOMP') == 1
264 shared_sources += files('seccomp-util.c')
267 if conf.get('HAVE_LIBIPTC') == 1
268 shared_sources += files('firewall-util.c')
271 if conf.get('HAVE_KMOD') == 1
272 shared_sources += files('module-util.c')
275 if conf.get('HAVE_PAM') == 1
276 shared_sources += files('''
282 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
283 ip_protocol_list_txt = custom_target(
284 'ip-protocol-list.txt',
285 output : 'ip-protocol-list.txt',
286 command : [generate_ip_protocol_list, cpp],
289 fname = 'ip-protocol-from-name.gperf'
290 gperf_file = custom_target(
292 input : ip_protocol_list_txt,
294 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
297 fname = 'ip-protocol-from-name.h'
298 target1 = custom_target(
303 '-L', 'ANSI-C', '-t', '--ignore-case',
304 '-N', 'lookup_ip_protocol',
305 '-H', 'hash_ip_protocol_name',
310 fname = 'ip-protocol-to-name.h'
311 awkscript = 'ip-protocol-to-name.awk'
312 target2 = custom_target(
314 input : [awkscript, ip_protocol_list_txt],
316 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
319 shared_generated_gperf_headers = [target1, target2]
320 shared_sources += shared_generated_gperf_headers
322 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
324 libshared_deps = [threads,
345 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
347 libshared_static = static_library(
350 include_directories : includes,
351 dependencies : libshared_deps,
352 c_args : ['-fvisibility=default'])
354 libshared = shared_library(
357 include_directories : includes,
358 link_args : ['-shared',
359 '-Wl,--version-script=' + libshared_sym_path],
360 link_whole : [libshared_static,
365 c_args : ['-fvisibility=default'],
366 dependencies : libshared_deps,
368 install_dir : rootlibexecdir)