1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
197 missing_h = files('missing.h')
199 generate_af_list = find_program('generate-af-list.sh')
200 af_list_txt = custom_target(
202 output : 'af-list.txt',
203 command : [generate_af_list, cpp],
206 generate_arphrd_list = find_program('generate-arphrd-list.sh')
207 arphrd_list_txt = custom_target(
209 output : 'arphrd-list.txt',
210 command : [generate_arphrd_list, cpp],
213 generate_cap_list = find_program('generate-cap-list.sh')
214 cap_list_txt = custom_target(
216 output : 'cap-list.txt',
217 command : [generate_cap_list, cpp, config_h, missing_h],
220 generate_errno_list = find_program('generate-errno-list.sh')
221 errno_list_txt = custom_target(
223 output : 'errno-list.txt',
224 command : [generate_errno_list, cpp],
227 generated_gperf_headers = []
228 foreach item : [['af', af_list_txt, 'af', ''],
229 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
230 ['cap', cap_list_txt, 'capability', ''],
231 ['errno', errno_list_txt, 'errno', '']]
233 fname = '@0@-from-name.gperf'.format(item[0])
234 gperf_file = custom_target(
238 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
241 fname = '@0@-from-name.h'.format(item[0])
242 target1 = custom_target(
247 '-L', 'ANSI-C', '-t', '--ignore-case',
248 '-N', 'lookup_@0@'.format(item[2]),
249 '-H', 'hash_@0@_name'.format(item[2]),
254 fname = '@0@-to-name.h'.format(item[0])
255 awkscript = '@0@-to-name.awk'.format(item[0])
256 target2 = custom_target(
258 input : [awkscript, item[1]],
260 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
263 generated_gperf_headers += [target1, target2]
266 basic_sources += [missing_h] + generated_gperf_headers
267 basic_gcrypt_sources = files(
271 libbasic = static_library(
274 include_directories : includes,
275 dependencies : [threads,
279 c_args : ['-fvisibility=default'],
282 # A convenience library that is separate from libbasic to avoid
283 # unnecessary linking to libgcrypt.
284 libbasic_gcrypt = static_library(
286 basic_gcrypt_sources,
287 include_directories : includes,
288 dependencies : [libgcrypt],
289 c_args : ['-fvisibility=default'])