1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
244 missing_audit_h = files('missing_audit.h')
245 missing_capability_h = files('missing_capability.h')
246 missing_socket_h = files('missing_socket.h')
248 generate_af_list = find_program('generate-af-list.sh')
249 af_list_txt = custom_target(
251 output : 'af-list.txt',
252 command : [generate_af_list, cpp, config_h, missing_socket_h],
255 generate_arphrd_list = find_program('generate-arphrd-list.sh')
256 arphrd_list_txt = custom_target(
258 output : 'arphrd-list.txt',
259 command : [generate_arphrd_list, cpp, config_h],
262 generate_cap_list = find_program('generate-cap-list.sh')
263 cap_list_txt = custom_target(
265 output : 'cap-list.txt',
266 command : [generate_cap_list, cpp, config_h, missing_capability_h],
269 generate_errno_list = find_program('generate-errno-list.sh')
270 errno_list_txt = custom_target(
272 output : 'errno-list.txt',
273 command : [generate_errno_list, cpp],
276 generated_gperf_headers = []
277 foreach item : [['af', af_list_txt, 'af', ''],
278 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
279 ['cap', cap_list_txt, 'capability', ''],
280 ['errno', errno_list_txt, 'errno', '']]
282 fname = '@0@-from-name.gperf'.format(item[0])
283 gperf_file = custom_target(
287 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
290 fname = '@0@-from-name.h'.format(item[0])
291 target1 = custom_target(
296 '-L', 'ANSI-C', '-t', '--ignore-case',
297 '-N', 'lookup_@0@'.format(item[2]),
298 '-H', 'hash_@0@_name'.format(item[2]),
303 fname = '@0@-to-name.h'.format(item[0])
304 awkscript = '@0@-to-name.awk'.format(item[0])
305 target2 = custom_target(
307 input : [awkscript, item[1]],
309 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
312 generated_gperf_headers += [target1, target2]
315 basic_sources += generated_gperf_headers
316 basic_gcrypt_sources = files(
320 libbasic = static_library(
323 include_directories : includes,
324 dependencies : [versiondep,
329 c_args : ['-fvisibility=default'],
332 # A convenience library that is separate from libbasic to avoid
333 # unnecessary linking to libgcrypt.
334 libbasic_gcrypt = static_library(
336 basic_gcrypt_sources,
337 include_directories : includes,
338 dependencies : [libgcrypt],
339 c_args : ['-fvisibility=default'])