mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 20:44:26 +01:00
userland: move more userland/arch/ logic into property tree
This commit is contained in:
@@ -211,28 +211,10 @@ Default: build all examples that have their package dependencies met, e.g.:
|
||||
cc_flags_dir = cc_flags.copy()
|
||||
if dirpath_relative_root_components_len > 0:
|
||||
if dirpath_relative_root_components[0] == 'arch':
|
||||
if dirpath_relative_root_components_len > 1:
|
||||
if dirpath_relative_root_components[1] == self.env['arch']:
|
||||
cc_flags_dir.extend([
|
||||
'-I', os.path.join(self.env['userland_source_arch_arch_dir']), LF,
|
||||
'-I', os.path.join(self.env['userland_source_arch_dir']), LF,
|
||||
])
|
||||
if 'freestanding' in dirpath_relative_root_components:
|
||||
common_objs_dir = []
|
||||
cc_flags_dir.extend([
|
||||
'-ffreestanding', LF,
|
||||
'-nostdlib', LF,
|
||||
'-static', LF,
|
||||
])
|
||||
else:
|
||||
if 'c' in dirpath_relative_root_components:
|
||||
common_objs_dir = []
|
||||
else:
|
||||
common_objs_dir = [common_obj_asm]
|
||||
else:
|
||||
continue
|
||||
else:
|
||||
continue
|
||||
cc_flags_dir.extend([
|
||||
'-I', os.path.join(self.env['userland_source_arch_arch_dir']), LF,
|
||||
'-I', os.path.join(self.env['userland_source_arch_dir']), LF,
|
||||
])
|
||||
elif dirpath_relative_root_components[0] == 'libs':
|
||||
if dirpath_relative_root_components_len > 1:
|
||||
pkg_key = dirpath_relative_root_components[1]
|
||||
@@ -268,22 +250,25 @@ Default: build all examples that have their package dependencies met, e.g.:
|
||||
dirpath_relative_root,
|
||||
in_filename
|
||||
))
|
||||
if my_path_properties['pedantic']:
|
||||
cc_flags_file.extend(['-pedantic', LF])
|
||||
common_objs_file = common_objs_dir.copy()
|
||||
if my_path_properties['lkmc_common_obj']:
|
||||
common_objs_file.append(common_obj)
|
||||
error = thread_pool.submit({
|
||||
'c_std': my_path_properties['c_std'],
|
||||
'cc_flags': cc_flags_file + my_path_properties['cc_flags'],
|
||||
'cc_flags_after': cc_flags_after,
|
||||
'cxx_std': my_path_properties['cxx_std'],
|
||||
'extra_objs': common_objs_file,
|
||||
'in_path': in_path,
|
||||
'out_path': self.resolve_userland_executable(in_path),
|
||||
})
|
||||
if error is not None:
|
||||
raise common.ExitLoop()
|
||||
if my_path_properties.should_be_built(self.env['arch']):
|
||||
if my_path_properties['pedantic']:
|
||||
cc_flags_file.extend(['-pedantic', LF])
|
||||
common_objs_file = common_objs_dir.copy()
|
||||
if my_path_properties['extra_objs_lkmc_common']:
|
||||
common_objs_file.append(common_obj)
|
||||
if my_path_properties['extra_objs_userland_asm']:
|
||||
common_objs_file.append(common_obj_asm)
|
||||
error = thread_pool.submit({
|
||||
'c_std': my_path_properties['c_std'],
|
||||
'cc_flags': cc_flags_file + my_path_properties['cc_flags'],
|
||||
'cc_flags_after': cc_flags_after,
|
||||
'cxx_std': my_path_properties['cxx_std'],
|
||||
'extra_objs': common_objs_file,
|
||||
'in_path': in_path,
|
||||
'out_path': self.resolve_userland_executable(in_path),
|
||||
})
|
||||
if error is not None:
|
||||
raise common.ExitLoop()
|
||||
except common.ExitLoop:
|
||||
pass
|
||||
error = thread_pool.get_error()
|
||||
|
||||
Reference in New Issue
Block a user