1 # SPDX-License-Identifier: LGPL-2.1-or-later
22 'confidential-virt.c',
105 'uid-classification.c',
116 missing_audit_h = files('missing_audit.h')
117 missing_capability_h = files('missing_capability.h')
118 missing_socket_h = files('missing_socket.h')
120 missing_syscall_def_h = files('missing_syscall_def.h')
121 basic_sources += missing_syscall_def_h
123 generate_af_list = find_program('generate-af-list.sh')
124 af_list_txt = custom_target(
126 output : 'af-list.txt',
127 command : [generate_af_list, cpp, config_h, missing_socket_h],
130 generate_arphrd_list = find_program('generate-arphrd-list.sh')
131 arphrd_list_txt = custom_target(
133 output : 'arphrd-list.txt',
134 command : [generate_arphrd_list, cpp, config_h],
137 generate_cap_list = find_program('generate-cap-list.sh')
138 cap_list_txt = custom_target(
140 output : 'cap-list.txt',
141 command : [generate_cap_list, cpp, config_h, missing_capability_h],
144 generate_errno_list = find_program('generate-errno-list.sh')
145 errno_list_txt = custom_target(
147 output : 'errno-list.txt',
148 command : [generate_errno_list, cpp],
151 generated_gperf_headers = []
152 foreach item : [['af', af_list_txt, 'af', ''],
153 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
154 ['cap', cap_list_txt, 'capability', ''],
155 ['errno', errno_list_txt, 'errno', '']]
157 fname = '@0@-from-name.gperf'.format(item[0])
158 gperf_file = custom_target(
162 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
165 fname = '@0@-from-name.h'.format(item[0])
166 target1 = custom_target(
171 '-L', 'ANSI-C', '-t', '--ignore-case',
172 '-N', 'lookup_@0@'.format(item[2]),
173 '-H', 'hash_@0@_name'.format(item[2]),
178 fname = '@0@-to-name.h'.format(item[0])
179 awkscript = '@0@-to-name.awk'.format(item[0])
180 target2 = custom_target(
182 input : [awkscript, item[1]],
184 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
187 generated_gperf_headers += [target1, target2]
190 basic_sources += generated_gperf_headers
192 ############################################################
218 'update-syscall-tables',
219 command : [update_syscall_tables_sh, meson.current_source_dir()] + arch_list)
221 syscall_list_txt = files('syscall-list.txt')
224 foreach arch: arch_list
225 syscall_lists += files('syscalls-@0@.txt'.format(arch))
228 missing_syscalls_py = find_program('missing_syscalls.py')
231 'update-syscall-header',
232 command : [missing_syscalls_py,
233 missing_syscall_def_h,
236 ############################################################
238 filesystem_includes = files(
243 check_filesystems = find_program('check-filesystems.sh')
244 r = run_command([check_filesystems, cpp, files('filesystems-gperf.gperf')] + filesystem_includes, check: false)
245 if r.returncode() != 0
246 warning('Unknown filesystems defined in kernel headers:\n\n' + r.stdout())
249 filesystems_gperf_h = custom_target(
250 'filesystems-gperf.h',
251 input : 'filesystems-gperf.gperf',
252 output : 'filesystems-gperf.h',
253 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
255 generate_filesystem_list = find_program('generate-filesystem-list.py')
256 fname = 'filesystem-list.h'
257 filesystem_list_h = custom_target(
259 input : 'filesystems-gperf.gperf',
261 command : [generate_filesystem_list,
265 generate_filesystem_switch_case_h = find_program('generate-filesystem-switch-case.py')
266 fname = 'filesystem-switch-case.h'
267 filesystem_switch_case_h = custom_target(
269 input : 'filesystems-gperf.gperf',
270 output : 'filesystem-switch-case.h',
271 command : [generate_filesystem_switch_case_h,
275 basic_sources += [filesystem_list_h, filesystem_switch_case_h, filesystems_gperf_h]
277 libbasic = static_library(
281 include_directories : basic_includes,
282 dependencies : [libcap,
292 c_args : ['-fvisibility=default'],
293 build_by_default : false)