Introduce configure and make wrapper.

This way, we can use small wrapper tools from sdk to run configure and
make.
This commit is contained in:
Matthieu Gautier 2022-11-02 11:53:14 +01:00
parent 3c445389be
commit ce82860b85
2 changed files with 27 additions and 4 deletions

View File

@ -148,3 +148,21 @@ class BuildEnv:
if cross_path:
env['PATH'] = ':'.join(self.platformInfo.get_bin_dir() + [env['PATH']])
return env
@property
def configure_wrapper(self):
wrapper = getattr(self.platformInfo, "configure_wrapper", "")
if wrapper:
return "{} ".format(wrapper)
else:
return ""
@property
def make_wrapper(self):
wrapper = getattr(self.platformInfo, "make_wrapper", "")
if wrapper:
return "{} ".format(wrapper)
else:
return ""

View File

@ -368,8 +368,9 @@ class MakeBuilder(Builder):
def _configure(self, context):
context.try_skip(self.build_path)
command = "{configure_script} {configure_option}"
command = "{configure_wrapper}{configure_script} {configure_option}"
command = command.format(
configure_wrapper=self.buildEnv.configure_wrapper,
configure_script=pj(self.source_path, self.configure_script),
configure_option=self.all_configure_option
)
@ -379,7 +380,8 @@ class MakeBuilder(Builder):
def _compile(self, context):
context.try_skip(self.build_path)
command = "make -j4 {make_target} {make_option}".format(
command = "{make_wrapper}make -j4 {make_target} {make_option}".format(
make_wrapper=self.buildEnv.make_wrapper,
make_target=self.make_target,
make_option=self.make_option
)
@ -388,7 +390,8 @@ class MakeBuilder(Builder):
def _install(self, context):
context.try_skip(self.build_path)
command = "make {make_install_target} {make_option}".format(
command = "{make_wrapper}make {make_install_target} {make_option}".format(
make_wrapper=self.buildEnv.make_wrapper,
make_install_target=self.make_install_target,
make_option=self.make_option
)
@ -397,7 +400,9 @@ class MakeBuilder(Builder):
def _make_dist(self, context):
context.try_skip(self.build_path)
command = "make dist"
command = "{make_wrapper}make dist".format(
make_wrapper=self.buildEnv.make_wrapper
)
env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
run_command(command, self.build_path, context, env=env)