1 # SPDX-License-Identifier: LGPL-2.1+
3 basic_sources = files('''
180 missing_h = files('missing.h')
182 generate_af_list = find_program('generate-af-list.sh')
183 af_list_txt = custom_target(
185 output : 'af-list.txt',
186 command : [generate_af_list, cpp],
189 generate_arphrd_list = find_program('generate-arphrd-list.sh')
190 arphrd_list_txt = custom_target(
192 output : 'arphrd-list.txt',
193 command : [generate_arphrd_list, cpp],
196 generate_cap_list = find_program('generate-cap-list.sh')
197 cap_list_txt = custom_target(
199 output : 'cap-list.txt',
200 command : [generate_cap_list, cpp, config_h, missing_h],
203 generate_errno_list = find_program('generate-errno-list.sh')
204 errno_list_txt = custom_target(
206 output : 'errno-list.txt',
207 command : [generate_errno_list, cpp],
210 generated_gperf_headers = []
211 foreach item : [['af', af_list_txt, 'af', ''],
212 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
213 ['cap', cap_list_txt, 'capability', ''],
214 ['errno', errno_list_txt, 'errno', '']]
216 fname = '@0@-from-name.gperf'.format(item[0])
217 gperf_file = custom_target(
221 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
224 fname = '@0@-from-name.h'.format(item[0])
225 target1 = custom_target(
230 '-L', 'ANSI-C', '-t', '--ignore-case',
231 '-N', 'lookup_@0@'.format(item[2]),
232 '-H', 'hash_@0@_name'.format(item[2]),
237 fname = '@0@-to-name.h'.format(item[0])
238 awkscript = '@0@-to-name.awk'.format(item[0])
239 target2 = custom_target(
241 input : [awkscript, item[1]],
243 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
246 generated_gperf_headers += [target1, target2]
249 basic_sources += [missing_h] + generated_gperf_headers
250 basic_gcrypt_sources = files(
254 libbasic = static_library(
257 include_directories : includes,
258 dependencies : [threads,
262 c_args : ['-fvisibility=default'],
265 # A convenience library that is separate from libbasic to avoid
266 # unnecessary linking to libgcrypt.
267 libbasic_gcrypt = static_library(
269 basic_gcrypt_sources,
270 include_directories : includes,
271 dependencies : [libgcrypt],
272 c_args : ['-fvisibility=default'])