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
191 spawn-ask-password-agent.c
192 spawn-ask-password-agent.h
238 if get_option('tests') != 'false'
239 shared_sources += files('tests.c', 'tests.h')
242 test_tables_h = files('test-tables.h')
243 shared_sources += test_tables_h
245 if conf.get('HAVE_ACL') == 1
246 shared_sources += files('acl-util.c')
249 if conf.get('ENABLE_UTMP') == 1
250 shared_sources += files('utmp-wtmp.c')
253 if conf.get('HAVE_SECCOMP') == 1
254 shared_sources += files('seccomp-util.c')
257 if conf.get('HAVE_LIBIPTC') == 1
258 shared_sources += files('firewall-util.c')
261 if conf.get('HAVE_KMOD') == 1
262 shared_sources += files('module-util.c')
265 if conf.get('HAVE_PAM') == 1
266 shared_sources += files('''
272 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
273 ip_protocol_list_txt = custom_target(
274 'ip-protocol-list.txt',
275 output : 'ip-protocol-list.txt',
276 command : [generate_ip_protocol_list, cpp],
279 fname = 'ip-protocol-from-name.gperf'
280 gperf_file = custom_target(
282 input : ip_protocol_list_txt,
284 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
287 fname = 'ip-protocol-from-name.h'
288 target1 = custom_target(
293 '-L', 'ANSI-C', '-t', '--ignore-case',
294 '-N', 'lookup_ip_protocol',
295 '-H', 'hash_ip_protocol_name',
300 fname = 'ip-protocol-to-name.h'
301 awkscript = 'ip-protocol-to-name.awk'
302 target2 = custom_target(
304 input : [awkscript, ip_protocol_list_txt],
306 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
309 shared_generated_gperf_headers = [target1, target2]
310 shared_sources += shared_generated_gperf_headers
312 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
314 libshared_deps = [threads,
335 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
337 libshared_static = static_library(
340 include_directories : includes,
341 dependencies : libshared_deps,
342 c_args : ['-fvisibility=default'])
344 libshared = shared_library(
347 include_directories : includes,
348 link_args : ['-shared',
349 '-Wl,--version-script=' + libshared_sym_path],
350 link_whole : [libshared_static,
355 c_args : ['-fvisibility=default'],
356 dependencies : libshared_deps,
358 install_dir : rootlibexecdir)