1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
240 missing_audit_h = files('missing_audit.h')
241 missing_capability_h = files('missing_capability.h')
242 missing_socket_h = files('missing_socket.h')
244 generate_af_list = find_program('generate-af-list.sh')
245 af_list_txt = custom_target(
247 output : 'af-list.txt',
248 command : [generate_af_list, cpp, config_h, missing_socket_h],
251 generate_arphrd_list = find_program('generate-arphrd-list.sh')
252 arphrd_list_txt = custom_target(
254 output : 'arphrd-list.txt',
255 command : [generate_arphrd_list, cpp, config_h],
258 generate_cap_list = find_program('generate-cap-list.sh')
259 cap_list_txt = custom_target(
261 output : 'cap-list.txt',
262 command : [generate_cap_list, cpp, config_h, missing_capability_h],
265 generate_errno_list = find_program('generate-errno-list.sh')
266 errno_list_txt = custom_target(
268 output : 'errno-list.txt',
269 command : [generate_errno_list, cpp],
272 generated_gperf_headers = []
273 foreach item : [['af', af_list_txt, 'af', ''],
274 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
275 ['cap', cap_list_txt, 'capability', ''],
276 ['errno', errno_list_txt, 'errno', '']]
278 fname = '@0@-from-name.gperf'.format(item[0])
279 gperf_file = custom_target(
283 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
286 fname = '@0@-from-name.h'.format(item[0])
287 target1 = custom_target(
292 '-L', 'ANSI-C', '-t', '--ignore-case',
293 '-N', 'lookup_@0@'.format(item[2]),
294 '-H', 'hash_@0@_name'.format(item[2]),
299 fname = '@0@-to-name.h'.format(item[0])
300 awkscript = '@0@-to-name.awk'.format(item[0])
301 target2 = custom_target(
303 input : [awkscript, item[1]],
305 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
308 generated_gperf_headers += [target1, target2]
311 basic_sources += generated_gperf_headers
312 basic_gcrypt_sources = files(
316 libbasic = static_library(
319 include_directories : includes,
320 dependencies : [versiondep,
325 c_args : ['-fvisibility=default'],
328 # A convenience library that is separate from libbasic to avoid
329 # unnecessary linking to libgcrypt.
330 libbasic_gcrypt = static_library(
332 basic_gcrypt_sources,
333 include_directories : includes,
334 dependencies : [libgcrypt],
335 c_args : ['-fvisibility=default'])