1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
245 missing_audit_h = files('missing_audit.h')
246 missing_capability_h = files('missing_capability.h')
247 missing_socket_h = files('missing_socket.h')
249 generate_af_list = find_program('generate-af-list.sh')
250 af_list_txt = custom_target(
252 output : 'af-list.txt',
253 command : [generate_af_list, cpp, config_h, missing_socket_h],
256 generate_arphrd_list = find_program('generate-arphrd-list.sh')
257 arphrd_list_txt = custom_target(
259 output : 'arphrd-list.txt',
260 command : [generate_arphrd_list, cpp, config_h],
263 generate_cap_list = find_program('generate-cap-list.sh')
264 cap_list_txt = custom_target(
266 output : 'cap-list.txt',
267 command : [generate_cap_list, cpp, config_h, missing_capability_h],
270 generate_errno_list = find_program('generate-errno-list.sh')
271 errno_list_txt = custom_target(
273 output : 'errno-list.txt',
274 command : [generate_errno_list, cpp],
277 generated_gperf_headers = []
278 foreach item : [['af', af_list_txt, 'af', ''],
279 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
280 ['cap', cap_list_txt, 'capability', ''],
281 ['errno', errno_list_txt, 'errno', '']]
283 fname = '@0@-from-name.gperf'.format(item[0])
284 gperf_file = custom_target(
288 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
291 fname = '@0@-from-name.h'.format(item[0])
292 target1 = custom_target(
297 '-L', 'ANSI-C', '-t', '--ignore-case',
298 '-N', 'lookup_@0@'.format(item[2]),
299 '-H', 'hash_@0@_name'.format(item[2]),
304 fname = '@0@-to-name.h'.format(item[0])
305 awkscript = '@0@-to-name.awk'.format(item[0])
306 target2 = custom_target(
308 input : [awkscript, item[1]],
310 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
313 generated_gperf_headers += [target1, target2]
316 basic_sources += generated_gperf_headers
317 basic_gcrypt_sources = files(
321 libbasic = static_library(
324 include_directories : includes,
325 dependencies : [versiondep,
330 c_args : ['-fvisibility=default'],
333 # A convenience library that is separate from libbasic to avoid
334 # unnecessary linking to libgcrypt.
335 libbasic_gcrypt = static_library(
337 basic_gcrypt_sources,
338 include_directories : includes,
339 dependencies : [libgcrypt],
340 c_args : ['-fvisibility=default'])