1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
248 missing_audit_h = files('missing_audit.h')
249 missing_capability_h = files('missing_capability.h')
250 missing_socket_h = files('missing_socket.h')
252 generate_af_list = find_program('generate-af-list.sh')
253 af_list_txt = custom_target(
255 output : 'af-list.txt',
256 command : [generate_af_list, cpp, config_h, missing_socket_h],
259 generate_arphrd_list = find_program('generate-arphrd-list.sh')
260 arphrd_list_txt = custom_target(
262 output : 'arphrd-list.txt',
263 command : [generate_arphrd_list, cpp, config_h],
266 generate_cap_list = find_program('generate-cap-list.sh')
267 cap_list_txt = custom_target(
269 output : 'cap-list.txt',
270 command : [generate_cap_list, cpp, config_h, missing_capability_h],
273 generate_errno_list = find_program('generate-errno-list.sh')
274 errno_list_txt = custom_target(
276 output : 'errno-list.txt',
277 command : [generate_errno_list, cpp],
280 generated_gperf_headers = []
281 foreach item : [['af', af_list_txt, 'af', ''],
282 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
283 ['cap', cap_list_txt, 'capability', ''],
284 ['errno', errno_list_txt, 'errno', '']]
286 fname = '@0@-from-name.gperf'.format(item[0])
287 gperf_file = custom_target(
291 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
294 fname = '@0@-from-name.h'.format(item[0])
295 target1 = custom_target(
300 '-L', 'ANSI-C', '-t', '--ignore-case',
301 '-N', 'lookup_@0@'.format(item[2]),
302 '-H', 'hash_@0@_name'.format(item[2]),
307 fname = '@0@-to-name.h'.format(item[0])
308 awkscript = '@0@-to-name.awk'.format(item[0])
309 target2 = custom_target(
311 input : [awkscript, item[1]],
313 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
316 generated_gperf_headers += [target1, target2]
319 basic_sources += generated_gperf_headers
320 basic_gcrypt_sources = files(
324 libbasic = static_library(
327 include_directories : includes,
328 dependencies : [versiondep,
334 c_args : ['-fvisibility=default'],
337 # A convenience library that is separate from libbasic to avoid
338 # unnecessary linking to libgcrypt.
339 libbasic_gcrypt = static_library(
341 basic_gcrypt_sources,
342 include_directories : includes,
343 dependencies : [libgcrypt],
344 c_args : ['-fvisibility=default'])