1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
242 missing_audit_h = files('missing_audit.h')
243 missing_capability_h = files('missing_capability.h')
244 missing_socket_h = files('missing_socket.h')
246 generate_af_list = find_program('generate-af-list.sh')
247 af_list_txt = custom_target(
249 output : 'af-list.txt',
250 command : [generate_af_list, cpp, config_h, missing_socket_h],
253 generate_arphrd_list = find_program('generate-arphrd-list.sh')
254 arphrd_list_txt = custom_target(
256 output : 'arphrd-list.txt',
257 command : [generate_arphrd_list, cpp, config_h],
260 generate_cap_list = find_program('generate-cap-list.sh')
261 cap_list_txt = custom_target(
263 output : 'cap-list.txt',
264 command : [generate_cap_list, cpp, config_h, missing_capability_h],
267 generate_errno_list = find_program('generate-errno-list.sh')
268 errno_list_txt = custom_target(
270 output : 'errno-list.txt',
271 command : [generate_errno_list, cpp],
274 generated_gperf_headers = []
275 foreach item : [['af', af_list_txt, 'af', ''],
276 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
277 ['cap', cap_list_txt, 'capability', ''],
278 ['errno', errno_list_txt, 'errno', '']]
280 fname = '@0@-from-name.gperf'.format(item[0])
281 gperf_file = custom_target(
285 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
288 fname = '@0@-from-name.h'.format(item[0])
289 target1 = custom_target(
294 '-L', 'ANSI-C', '-t', '--ignore-case',
295 '-N', 'lookup_@0@'.format(item[2]),
296 '-H', 'hash_@0@_name'.format(item[2]),
301 fname = '@0@-to-name.h'.format(item[0])
302 awkscript = '@0@-to-name.awk'.format(item[0])
303 target2 = custom_target(
305 input : [awkscript, item[1]],
307 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
310 generated_gperf_headers += [target1, target2]
313 basic_sources += generated_gperf_headers
314 basic_gcrypt_sources = files(
318 libbasic = static_library(
321 include_directories : includes,
322 dependencies : [versiondep,
327 c_args : ['-fvisibility=default'],
330 # A convenience library that is separate from libbasic to avoid
331 # unnecessary linking to libgcrypt.
332 libbasic_gcrypt = static_library(
334 basic_gcrypt_sources,
335 include_directories : includes,
336 dependencies : [libgcrypt],
337 c_args : ['-fvisibility=default'])