1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
118 linux/auto_dev-ioctl.h
141 netif-naming-scheme.c
142 netif-naming-scheme.h
178 spawn-ask-password-agent.c
179 spawn-ask-password-agent.h
225 if get_option('tests') != 'false'
226 shared_sources += files('tests.c', 'tests.h')
229 test_tables_h = files('test-tables.h')
230 shared_sources += test_tables_h
232 if conf.get('HAVE_ACL') == 1
233 shared_sources += files('acl-util.c')
236 if conf.get('ENABLE_UTMP') == 1
237 shared_sources += files('utmp-wtmp.c')
240 if conf.get('HAVE_SECCOMP') == 1
241 shared_sources += files('seccomp-util.c')
244 if conf.get('HAVE_LIBIPTC') == 1
245 shared_sources += files('firewall-util.c')
248 if conf.get('HAVE_KMOD') == 1
249 shared_sources += files('module-util.c')
252 if conf.get('HAVE_PAM') == 1
253 shared_sources += files('''
259 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
260 ip_protocol_list_txt = custom_target(
261 'ip-protocol-list.txt',
262 output : 'ip-protocol-list.txt',
263 command : [generate_ip_protocol_list, cpp],
266 fname = 'ip-protocol-from-name.gperf'
267 gperf_file = custom_target(
269 input : ip_protocol_list_txt,
271 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
274 fname = 'ip-protocol-from-name.h'
275 target1 = custom_target(
280 '-L', 'ANSI-C', '-t', '--ignore-case',
281 '-N', 'lookup_ip_protocol',
282 '-H', 'hash_ip_protocol_name',
287 fname = 'ip-protocol-to-name.h'
288 awkscript = 'ip-protocol-to-name.awk'
289 target2 = custom_target(
291 input : [awkscript, ip_protocol_list_txt],
293 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
296 shared_generated_gperf_headers = [target1, target2]
297 shared_sources += shared_generated_gperf_headers
299 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
301 libshared_deps = [threads,
321 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
323 libshared_static = static_library(
326 include_directories : includes,
327 dependencies : libshared_deps,
328 c_args : ['-fvisibility=default'])
330 libshared = shared_library(
333 include_directories : includes,
334 link_args : ['-shared',
335 '-Wl,--version-script=' + libshared_sym_path],
336 link_whole : [libshared_static,
341 c_args : ['-fvisibility=default'],
342 dependencies : libshared_deps,
344 install_dir : rootlibexecdir)