1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
116 linux/auto_dev-ioctl.h
139 netif-naming-scheme.c
140 netif-naming-scheme.h
176 spawn-ask-password-agent.c
177 spawn-ask-password-agent.h
219 if get_option('tests') != 'false'
220 shared_sources += files('tests.c', 'tests.h')
223 test_tables_h = files('test-tables.h')
224 shared_sources += test_tables_h
226 if conf.get('HAVE_ACL') == 1
227 shared_sources += files('acl-util.c')
230 if conf.get('ENABLE_UTMP') == 1
231 shared_sources += files('utmp-wtmp.c')
234 if conf.get('HAVE_SECCOMP') == 1
235 shared_sources += files('seccomp-util.c')
238 if conf.get('HAVE_LIBIPTC') == 1
239 shared_sources += files('firewall-util.c')
242 if conf.get('HAVE_KMOD') == 1
243 shared_sources += files('module-util.c')
246 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
247 ip_protocol_list_txt = custom_target(
248 'ip-protocol-list.txt',
249 output : 'ip-protocol-list.txt',
250 command : [generate_ip_protocol_list, cpp],
253 fname = 'ip-protocol-from-name.gperf'
254 gperf_file = custom_target(
256 input : ip_protocol_list_txt,
258 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
261 fname = 'ip-protocol-from-name.h'
262 target1 = custom_target(
267 '-L', 'ANSI-C', '-t', '--ignore-case',
268 '-N', 'lookup_ip_protocol',
269 '-H', 'hash_ip_protocol_name',
274 fname = 'ip-protocol-to-name.h'
275 awkscript = 'ip-protocol-to-name.awk'
276 target2 = custom_target(
278 input : [awkscript, ip_protocol_list_txt],
280 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
283 shared_generated_gperf_headers = [target1, target2]
284 shared_sources += shared_generated_gperf_headers
286 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
288 libshared_deps = [threads,
307 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
309 libshared_static = static_library(
312 include_directories : includes,
313 dependencies : libshared_deps,
314 c_args : ['-fvisibility=default'])
316 libshared = shared_library(
319 include_directories : includes,
320 link_args : ['-shared',
321 '-Wl,--version-script=' + libshared_sym_path],
322 link_whole : [libshared_static,
327 c_args : ['-fvisibility=default'],
328 dependencies : libshared_deps,
330 install_dir : rootlibexecdir)