1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
141 spawn-ask-password-agent.c
142 spawn-ask-password-agent.h
175 if get_option('tests') != 'false'
176 shared_sources += files('tests.c', 'tests.h')
179 test_tables_h = files('test-tables.h')
180 shared_sources += test_tables_h
182 if conf.get('HAVE_ACL') == 1
183 shared_sources += files('acl-util.c')
186 if conf.get('ENABLE_UTMP') == 1
187 shared_sources += files('utmp-wtmp.c')
190 if conf.get('HAVE_SECCOMP') == 1
191 shared_sources += files('seccomp-util.c')
194 if conf.get('HAVE_LIBIPTC') == 1
195 shared_sources += files('firewall-util.c')
198 if conf.get('HAVE_KMOD') == 1
199 shared_sources += files('module-util.c')
202 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
203 ip_protocol_list_txt = custom_target(
204 'ip-protocol-list.txt',
205 output : 'ip-protocol-list.txt',
206 command : [generate_ip_protocol_list, cpp],
209 fname = 'ip-protocol-from-name.gperf'
210 gperf_file = custom_target(
212 input : ip_protocol_list_txt,
214 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
217 fname = 'ip-protocol-from-name.h'
218 target1 = custom_target(
223 '-L', 'ANSI-C', '-t', '--ignore-case',
224 '-N', 'lookup_ip_protocol',
225 '-H', 'hash_ip_protocol_name',
230 fname = 'ip-protocol-to-name.h'
231 awkscript = 'ip-protocol-to-name.awk'
232 target2 = custom_target(
234 input : [awkscript, ip_protocol_list_txt],
236 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
239 shared_generated_gperf_headers = [target1, target2]
240 shared_sources += shared_generated_gperf_headers
242 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
244 libshared_deps = [threads,
260 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
262 libshared_static = static_library(
265 include_directories : includes,
266 dependencies : libshared_deps,
267 c_args : ['-fvisibility=default'])
269 libshared = shared_library(
272 include_directories : includes,
273 link_args : ['-shared',
274 '-Wl,--version-script=' + libshared_sym_path],
275 link_whole : [libshared_static,
280 c_args : ['-fvisibility=default'],
281 dependencies : libshared_deps,
283 install_dir : rootlibexecdir)