1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
247 missing_audit_h = files('missing_audit.h')
248 missing_capability_h = files('missing_capability.h')
249 missing_socket_h = files('missing_socket.h')
251 generate_af_list = find_program('generate-af-list.sh')
252 af_list_txt = custom_target(
254 output : 'af-list.txt',
255 command : [generate_af_list, cpp, config_h, missing_socket_h],
258 generate_arphrd_list = find_program('generate-arphrd-list.sh')
259 arphrd_list_txt = custom_target(
261 output : 'arphrd-list.txt',
262 command : [generate_arphrd_list, cpp, config_h],
265 generate_cap_list = find_program('generate-cap-list.sh')
266 cap_list_txt = custom_target(
268 output : 'cap-list.txt',
269 command : [generate_cap_list, cpp, config_h, missing_capability_h],
272 generate_errno_list = find_program('generate-errno-list.sh')
273 errno_list_txt = custom_target(
275 output : 'errno-list.txt',
276 command : [generate_errno_list, cpp],
279 generated_gperf_headers = []
280 foreach item : [['af', af_list_txt, 'af', ''],
281 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
282 ['cap', cap_list_txt, 'capability', ''],
283 ['errno', errno_list_txt, 'errno', '']]
285 fname = '@0@-from-name.gperf'.format(item[0])
286 gperf_file = custom_target(
290 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
293 fname = '@0@-from-name.h'.format(item[0])
294 target1 = custom_target(
299 '-L', 'ANSI-C', '-t', '--ignore-case',
300 '-N', 'lookup_@0@'.format(item[2]),
301 '-H', 'hash_@0@_name'.format(item[2]),
306 fname = '@0@-to-name.h'.format(item[0])
307 awkscript = '@0@-to-name.awk'.format(item[0])
308 target2 = custom_target(
310 input : [awkscript, item[1]],
312 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
315 generated_gperf_headers += [target1, target2]
318 basic_sources += generated_gperf_headers
319 basic_gcrypt_sources = files(
323 libbasic = static_library(
326 include_directories : includes,
327 dependencies : [versiondep,
332 c_args : ['-fvisibility=default'],
335 # A convenience library that is separate from libbasic to avoid
336 # unnecessary linking to libgcrypt.
337 libbasic_gcrypt = static_library(
339 basic_gcrypt_sources,
340 include_directories : includes,
341 dependencies : [libgcrypt],
342 c_args : ['-fvisibility=default'])