1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
200 missing_h = files('missing.h')
202 generate_af_list = find_program('generate-af-list.sh')
203 af_list_txt = custom_target(
205 output : 'af-list.txt',
206 command : [generate_af_list, cpp],
209 generate_arphrd_list = find_program('generate-arphrd-list.sh')
210 arphrd_list_txt = custom_target(
212 output : 'arphrd-list.txt',
213 command : [generate_arphrd_list, cpp],
216 generate_cap_list = find_program('generate-cap-list.sh')
217 cap_list_txt = custom_target(
219 output : 'cap-list.txt',
220 command : [generate_cap_list, cpp, config_h, missing_h],
223 generate_errno_list = find_program('generate-errno-list.sh')
224 errno_list_txt = custom_target(
226 output : 'errno-list.txt',
227 command : [generate_errno_list, cpp],
230 generated_gperf_headers = []
231 foreach item : [['af', af_list_txt, 'af', ''],
232 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
233 ['cap', cap_list_txt, 'capability', ''],
234 ['errno', errno_list_txt, 'errno', '']]
236 fname = '@0@-from-name.gperf'.format(item[0])
237 gperf_file = custom_target(
241 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
244 fname = '@0@-from-name.h'.format(item[0])
245 target1 = custom_target(
250 '-L', 'ANSI-C', '-t', '--ignore-case',
251 '-N', 'lookup_@0@'.format(item[2]),
252 '-H', 'hash_@0@_name'.format(item[2]),
257 fname = '@0@-to-name.h'.format(item[0])
258 awkscript = '@0@-to-name.awk'.format(item[0])
259 target2 = custom_target(
261 input : [awkscript, item[1]],
263 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
266 generated_gperf_headers += [target1, target2]
269 basic_sources += [missing_h] + generated_gperf_headers
270 basic_gcrypt_sources = files(
274 libbasic = static_library(
277 include_directories : includes,
278 dependencies : [threads,
282 c_args : ['-fvisibility=default'],
285 # A convenience library that is separate from libbasic to avoid
286 # unnecessary linking to libgcrypt.
287 libbasic_gcrypt = static_library(
289 basic_gcrypt_sources,
290 include_directories : includes,
291 dependencies : [libgcrypt],
292 c_args : ['-fvisibility=default'])