1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
108 linux/auto_dev-ioctl.h
159 spawn-ask-password-agent.c
160 spawn-ask-password-agent.h
198 if get_option('tests') != 'false'
199 shared_sources += files('tests.c', 'tests.h')
202 test_tables_h = files('test-tables.h')
203 shared_sources += test_tables_h
205 if conf.get('HAVE_ACL') == 1
206 shared_sources += files('acl-util.c')
209 if conf.get('ENABLE_UTMP') == 1
210 shared_sources += files('utmp-wtmp.c')
213 if conf.get('HAVE_SECCOMP') == 1
214 shared_sources += files('seccomp-util.c')
217 if conf.get('HAVE_LIBIPTC') == 1
218 shared_sources += files('firewall-util.c')
221 if conf.get('HAVE_KMOD') == 1
222 shared_sources += files('module-util.c')
225 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
226 ip_protocol_list_txt = custom_target(
227 'ip-protocol-list.txt',
228 output : 'ip-protocol-list.txt',
229 command : [generate_ip_protocol_list, cpp],
232 fname = 'ip-protocol-from-name.gperf'
233 gperf_file = custom_target(
235 input : ip_protocol_list_txt,
237 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
240 fname = 'ip-protocol-from-name.h'
241 target1 = custom_target(
246 '-L', 'ANSI-C', '-t', '--ignore-case',
247 '-N', 'lookup_ip_protocol',
248 '-H', 'hash_ip_protocol_name',
253 fname = 'ip-protocol-to-name.h'
254 awkscript = 'ip-protocol-to-name.awk'
255 target2 = custom_target(
257 input : [awkscript, ip_protocol_list_txt],
259 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
262 shared_generated_gperf_headers = [target1, target2]
263 shared_sources += shared_generated_gperf_headers
265 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
267 libshared_deps = [threads,
283 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
285 libshared_static = static_library(
288 include_directories : includes,
289 dependencies : libshared_deps,
290 c_args : ['-fvisibility=default'])
292 libshared = shared_library(
295 include_directories : includes,
296 link_args : ['-shared',
297 '-Wl,--version-script=' + libshared_sym_path],
298 link_whole : [libshared_static,
303 c_args : ['-fvisibility=default'],
304 dependencies : libshared_deps,
306 install_dir : rootlibexecdir)