1 # SPDX-License-Identifier: LGPL-2.1+
3 shared_sources = files('''
130 socket-protocol-list.c
131 socket-protocol-list.h
132 spawn-ask-password-agent.c
133 spawn-ask-password-agent.h
164 if get_option('tests') != 'false'
165 shared_sources += files('tests.c', 'tests.h')
168 test_tables_h = files('test-tables.h')
169 shared_sources += test_tables_h
171 if conf.get('HAVE_ACL') == 1
172 shared_sources += files('acl-util.c')
175 if conf.get('ENABLE_UTMP') == 1
176 shared_sources += files('utmp-wtmp.c')
179 if conf.get('HAVE_SECCOMP') == 1
180 shared_sources += files('seccomp-util.c')
183 if conf.get('HAVE_LIBIPTC') == 1
184 shared_sources += files('firewall-util.c')
187 if conf.get('HAVE_KMOD') == 1
188 shared_sources += files('module-util.c')
191 generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh')
192 socket_protocol_list_txt = custom_target(
193 'socket-protocol-list.txt',
194 output : 'socket-protocol-list.txt',
195 command : [generate_socket_protocol_list, cpp],
198 fname = 'socket-protocol-from-name.gperf'
199 gperf_file = custom_target(
201 input : socket_protocol_list_txt,
203 command : [generate_gperfs, 'socket_protocol', 'IPPROTO_', '@INPUT@'],
206 fname = 'socket-protocol-from-name.h'
207 target1 = custom_target(
212 '-L', 'ANSI-C', '-t', '--ignore-case',
213 '-N', 'lookup_socket_protocol',
214 '-H', 'hash_socket_protocol_name',
219 fname = 'socket-protocol-to-name.h'
220 awkscript = 'socket-protocol-to-name.awk'
221 target2 = custom_target(
223 input : [awkscript, socket_protocol_list_txt],
225 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
228 shared_sources += [target1, target2]
230 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
232 libshared_deps = [threads,
248 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
250 libshared_static = static_library(
253 include_directories : includes,
254 dependencies : libshared_deps,
255 c_args : ['-fvisibility=default'])
257 libshared = shared_library(
260 include_directories : includes,
261 link_args : ['-shared',
262 '-Wl,--version-script=' + libshared_sym_path],
263 link_whole : [libshared_static,
268 c_args : ['-fvisibility=default'],
269 dependencies : libshared_deps,
271 install_dir : rootlibexecdir)