1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
182 missing_h = files('missing.h')
184 generate_af_list = find_program('generate-af-list.sh')
185 af_list_txt = custom_target(
187 output : 'af-list.txt',
188 command : [generate_af_list, cpp],
191 generate_arphrd_list = find_program('generate-arphrd-list.sh')
192 arphrd_list_txt = custom_target(
194 output : 'arphrd-list.txt',
195 command : [generate_arphrd_list, cpp],
198 generate_cap_list = find_program('generate-cap-list.sh')
199 cap_list_txt = custom_target(
201 output : 'cap-list.txt',
202 command : [generate_cap_list, cpp, config_h, missing_h],
205 generate_errno_list = find_program('generate-errno-list.sh')
206 errno_list_txt = custom_target(
208 output : 'errno-list.txt',
209 command : [generate_errno_list, cpp],
212 generated_gperf_headers = []
213 foreach item : [['af', af_list_txt, 'af', ''],
214 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
215 ['cap', cap_list_txt, 'capability', ''],
216 ['errno', errno_list_txt, 'errno', '']]
218 fname = '@0@-from-name.gperf'.format(item[0])
219 gperf_file = custom_target(
223 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
226 fname = '@0@-from-name.h'.format(item[0])
227 target1 = custom_target(
232 '-L', 'ANSI-C', '-t', '--ignore-case',
233 '-N', 'lookup_@0@'.format(item[2]),
234 '-H', 'hash_@0@_name'.format(item[2]),
239 fname = '@0@-to-name.h'.format(item[0])
240 awkscript = '@0@-to-name.awk'.format(item[0])
241 target2 = custom_target(
243 input : [awkscript, item[1]],
245 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
248 generated_gperf_headers += [target1, target2]
251 basic_sources += [missing_h] + generated_gperf_headers
252 basic_gcrypt_sources = files(
256 libbasic = static_library(
259 include_directories : includes,
260 dependencies : [threads,
264 c_args : ['-fvisibility=default'],
267 # A convenience library that is separate from libbasic to avoid
268 # unnecessary linking to libgcrypt.
269 libbasic_gcrypt = static_library(
271 basic_gcrypt_sources,
272 include_directories : includes,
273 dependencies : [libgcrypt],
274 c_args : ['-fvisibility=default'])