1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
135 spawn-ask-password-agent.c
136 spawn-ask-password-agent.h
169 if get_option('tests') != 'false'
170 shared_sources += files('tests.c', 'tests.h')
173 test_tables_h = files('test-tables.h')
174 shared_sources += test_tables_h
176 if conf.get('HAVE_ACL') == 1
177 shared_sources += files('acl-util.c')
180 if conf.get('ENABLE_UTMP') == 1
181 shared_sources += files('utmp-wtmp.c')
184 if conf.get('HAVE_SECCOMP') == 1
185 shared_sources += files('seccomp-util.c')
188 if conf.get('HAVE_LIBIPTC') == 1
189 shared_sources += files('firewall-util.c')
192 if conf.get('HAVE_KMOD') == 1
193 shared_sources += files('module-util.c')
196 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
197 ip_protocol_list_txt = custom_target(
198 'ip-protocol-list.txt',
199 output : 'ip-protocol-list.txt',
200 command : [generate_ip_protocol_list, cpp],
203 fname = 'ip-protocol-from-name.gperf'
204 gperf_file = custom_target(
206 input : ip_protocol_list_txt,
208 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
211 fname = 'ip-protocol-from-name.h'
212 target1 = custom_target(
217 '-L', 'ANSI-C', '-t', '--ignore-case',
218 '-N', 'lookup_ip_protocol',
219 '-H', 'hash_ip_protocol_name',
224 fname = 'ip-protocol-to-name.h'
225 awkscript = 'ip-protocol-to-name.awk'
226 target2 = custom_target(
228 input : [awkscript, ip_protocol_list_txt],
230 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
233 shared_generated_gperf_headers = [target1, target2]
234 shared_sources += shared_generated_gperf_headers
236 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
238 libshared_deps = [threads,
254 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
256 libshared_static = static_library(
259 include_directories : includes,
260 dependencies : libshared_deps,
261 c_args : ['-fvisibility=default'])
263 libshared = shared_library(
266 include_directories : includes,
267 link_args : ['-shared',
268 '-Wl,--version-script=' + libshared_sym_path],
269 link_whole : [libshared_static,
274 c_args : ['-fvisibility=default'],
275 dependencies : libshared_deps,
277 install_dir : rootlibexecdir)