1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
134 spawn-ask-password-agent.c
135 spawn-ask-password-agent.h
168 if get_option('tests') != 'false'
169 shared_sources += files('tests.c', 'tests.h')
172 test_tables_h = files('test-tables.h')
173 shared_sources += test_tables_h
175 if conf.get('HAVE_ACL') == 1
176 shared_sources += files('acl-util.c')
179 if conf.get('ENABLE_UTMP') == 1
180 shared_sources += files('utmp-wtmp.c')
183 if conf.get('HAVE_SECCOMP') == 1
184 shared_sources += files('seccomp-util.c')
187 if conf.get('HAVE_LIBIPTC') == 1
188 shared_sources += files('firewall-util.c')
191 if conf.get('HAVE_KMOD') == 1
192 shared_sources += files('module-util.c')
195 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
196 ip_protocol_list_txt = custom_target(
197 'ip-protocol-list.txt',
198 output : 'ip-protocol-list.txt',
199 command : [generate_ip_protocol_list, cpp],
202 fname = 'ip-protocol-from-name.gperf'
203 gperf_file = custom_target(
205 input : ip_protocol_list_txt,
207 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
210 fname = 'ip-protocol-from-name.h'
211 target1 = custom_target(
216 '-L', 'ANSI-C', '-t', '--ignore-case',
217 '-N', 'lookup_ip_protocol',
218 '-H', 'hash_ip_protocol_name',
223 fname = 'ip-protocol-to-name.h'
224 awkscript = 'ip-protocol-to-name.awk'
225 target2 = custom_target(
227 input : [awkscript, ip_protocol_list_txt],
229 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
232 shared_generated_gperf_headers = [target1, target2]
233 shared_sources += shared_generated_gperf_headers
235 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
237 libshared_deps = [threads,
253 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
255 libshared_static = static_library(
258 include_directories : includes,
259 dependencies : libshared_deps,
260 c_args : ['-fvisibility=default'])
262 libshared = shared_library(
265 include_directories : includes,
266 link_args : ['-shared',
267 '-Wl,--version-script=' + libshared_sym_path],
268 link_whole : [libshared_static,
273 c_args : ['-fvisibility=default'],
274 dependencies : libshared_deps,
276 install_dir : rootlibexecdir)