1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
132 spawn-ask-password-agent.c
133 spawn-ask-password-agent.h
166 if get_option('tests') != 'false'
167 shared_sources += files('tests.c', 'tests.h')
170 test_tables_h = files('test-tables.h')
171 shared_sources += test_tables_h
173 if conf.get('HAVE_ACL') == 1
174 shared_sources += files('acl-util.c')
177 if conf.get('ENABLE_UTMP') == 1
178 shared_sources += files('utmp-wtmp.c')
181 if conf.get('HAVE_SECCOMP') == 1
182 shared_sources += files('seccomp-util.c')
185 if conf.get('HAVE_LIBIPTC') == 1
186 shared_sources += files('firewall-util.c')
189 if conf.get('HAVE_KMOD') == 1
190 shared_sources += files('module-util.c')
193 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
194 ip_protocol_list_txt = custom_target(
195 'ip-protocol-list.txt',
196 output : 'ip-protocol-list.txt',
197 command : [generate_ip_protocol_list, cpp],
200 fname = 'ip-protocol-from-name.gperf'
201 gperf_file = custom_target(
203 input : ip_protocol_list_txt,
205 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
208 fname = 'ip-protocol-from-name.h'
209 target1 = custom_target(
214 '-L', 'ANSI-C', '-t', '--ignore-case',
215 '-N', 'lookup_ip_protocol',
216 '-H', 'hash_ip_protocol_name',
221 fname = 'ip-protocol-to-name.h'
222 awkscript = 'ip-protocol-to-name.awk'
223 target2 = custom_target(
225 input : [awkscript, ip_protocol_list_txt],
227 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
230 shared_generated_gperf_headers = [target1, target2]
231 shared_sources += shared_generated_gperf_headers
233 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
235 libshared_deps = [threads,
251 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
253 libshared_static = static_library(
256 include_directories : includes,
257 dependencies : libshared_deps,
258 c_args : ['-fvisibility=default'])
260 libshared = shared_library(
263 include_directories : includes,
264 link_args : ['-shared',
265 '-Wl,--version-script=' + libshared_sym_path],
266 link_whole : [libshared_static,
271 c_args : ['-fvisibility=default'],
272 dependencies : libshared_deps,
274 install_dir : rootlibexecdir)