From cfc105249533c6937230a7a65ab227281aa81973 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 29 Nov 2020 11:58:34 +0200 Subject: [PATCH] build script: add configure+make target --- build.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/build.py b/build.py index 9a1f7a46..61b323cf 100755 --- a/build.py +++ b/build.py @@ -115,6 +115,44 @@ class MakeTarget(Target): self._update_env(varname, f'-mmacosx-version-min={builder.os_version}') +class ConfigureMakeTarget(Target): + def __init__(self, name=None): + super().__init__(name) + self.make = MakeTarget(name) + self.prefix = None + + def initialize(self, builder: 'Builder'): + super().initialize(builder) + + self.prefix = builder.deps_path + self.name + self.options['--prefix'] = self.prefix + + self.make.initialize(builder) + + def configure(self, builder: 'Builder'): + super().configure(builder) + self.make.configure(builder) + + def build(self, builder: 'Builder'): + assert not builder.xcode + + work_path = builder.build_path + self.src_root + args = [work_path + os.sep + 'configure'] + + for arg_name, arg_value in self.options.items(): + args.append(f'{arg_name}={arg_value}') + + subprocess.check_call(args, cwd=work_path, env=self.environment) + + self.make.build(builder) + + def install(self, builder: 'Builder'): + shutil.rmtree(self.prefix) + + work_path = builder.build_path + self.src_root + subprocess.check_call(['make', 'install'], cwd=work_path) + + class CMakeTarget(Target): def __init__(self, name=None): super().__init__(name)