1 # SPDX-License-Identifier: LGPL-2.1-or-later
22 'confidential-virt.c',
104 'uid-classification.c',
115 missing_audit_h = files('missing_audit.h')
116 missing_capability_h = files('missing_capability.h')
117 missing_socket_h = files('missing_socket.h')
119 missing_syscall_def_h = files('missing_syscall_def.h')
120 basic_sources += missing_syscall_def_h
122 generate_af_list = find_program('generate-af-list.sh')
123 af_list_txt = custom_target(
125 output : 'af-list.txt',
126 command : [generate_af_list, cpp, config_h, missing_socket_h],
129 generate_arphrd_list = find_program('generate-arphrd-list.sh')
130 arphrd_list_txt = custom_target(
132 output : 'arphrd-list.txt',
133 command : [generate_arphrd_list, cpp, config_h],
136 generate_cap_list = find_program('generate-cap-list.sh')
137 cap_list_txt = custom_target(
139 output : 'cap-list.txt',
140 command : [generate_cap_list, cpp, config_h, missing_capability_h],
143 generate_errno_list = find_program('generate-errno-list.sh')
144 errno_list_txt = custom_target(
146 output : 'errno-list.txt',
147 command : [generate_errno_list, cpp],
150 generated_gperf_headers = []
151 foreach item : [['af', af_list_txt, 'af', ''],
152 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
153 ['cap', cap_list_txt, 'capability', ''],
154 ['errno', errno_list_txt, 'errno', '']]
156 fname = '@0@-from-name.gperf'.format(item[0])
157 gperf_file = custom_target(
161 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
164 fname = '@0@-from-name.h'.format(item[0])
165 target1 = custom_target(
170 '-L', 'ANSI-C', '-t', '--ignore-case',
171 '-N', 'lookup_@0@'.format(item[2]),
172 '-H', 'hash_@0@_name'.format(item[2]),
177 fname = '@0@-to-name.h'.format(item[0])
178 awkscript = '@0@-to-name.awk'.format(item[0])
179 target2 = custom_target(
181 input : [awkscript, item[1]],
183 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
186 generated_gperf_headers += [target1, target2]
189 basic_sources += generated_gperf_headers
191 ############################################################
217 'update-syscall-tables',
218 command : [update_syscall_tables_sh, meson.current_source_dir()] + arch_list)
220 syscall_list_txt = files('syscall-list.txt')
223 foreach arch: arch_list
224 syscall_lists += files('syscalls-@0@.txt'.format(arch))
227 missing_syscalls_py = find_program('missing_syscalls.py')
230 'update-syscall-header',
231 command : [missing_syscalls_py,
232 missing_syscall_def_h,
235 ############################################################
237 filesystem_includes = files(
242 check_filesystems = find_program('check-filesystems.sh')
243 r = run_command([check_filesystems, cpp, files('filesystems-gperf.gperf')] + filesystem_includes, check: false)
244 if r.returncode() != 0
245 warning('Unknown filesystems defined in kernel headers:\n\n' + r.stdout())
248 filesystems_gperf_h = custom_target(
249 'filesystems-gperf.h',
250 input : 'filesystems-gperf.gperf',
251 output : 'filesystems-gperf.h',
252 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
254 generate_filesystem_list = find_program('generate-filesystem-list.py')
255 fname = 'filesystem-list.h'
256 filesystem_list_h = custom_target(
258 input : 'filesystems-gperf.gperf',
260 command : [generate_filesystem_list,
264 generate_filesystem_switch_case_h = find_program('generate-filesystem-switch-case.py')
265 fname = 'filesystem-switch-case.h'
266 filesystem_switch_case_h = custom_target(
268 input : 'filesystems-gperf.gperf',
269 output : 'filesystem-switch-case.h',
270 command : [generate_filesystem_switch_case_h,
274 basic_sources += [filesystem_list_h, filesystem_switch_case_h, filesystems_gperf_h]
276 libbasic = static_library(
280 include_directories : basic_includes,
281 dependencies : [libcap,
291 c_args : ['-fvisibility=default'],
292 build_by_default : false)