aboutsummaryrefslogtreecommitdiff
path: root/ndk/checkbuild.py
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-08-23 02:47:40 -0700
committerHaibo Huang <hhb@google.com>2019-08-23 19:13:29 +0000
commiteebeee16af6ee4341e4c872799158d90e5223809 (patch)
tree2829f3bfa4503ce93164ff029b8bd139dec86e95 /ndk/checkbuild.py
parent8a52d02d1ccd5bbecb8f5023f416d215820a7540 (diff)
downloadndk-eebeee16af6ee4341e4c872799158d90e5223809.tar.gz
[NDK] Move make to a separate module
Test: checkbuild.py and make sure make is in the right place. Change-Id: I8689c57ab207487edd8f3e21790f9c7720bbcfb0
Diffstat (limited to 'ndk/checkbuild.py')
-rwxr-xr-xndk/checkbuild.py71
1 files changed, 36 insertions, 35 deletions
diff --git a/ndk/checkbuild.py b/ndk/checkbuild.py
index 57cd53abe..7d9820844 100755
--- a/ndk/checkbuild.py
+++ b/ndk/checkbuild.py
@@ -576,34 +576,17 @@ class ShaderTools(ndk.builds.InvokeBuildModule):
]
-class HostTools(ndk.builds.Module):
- name = 'host-tools'
+class Make(ndk.builds.Module):
+ name = 'make'
path = 'prebuilt/{host}'
notice_group = ndk.builds.NoticeGroup.TOOLCHAIN
- yasm_notices = [
- ndk.paths.android_path('toolchain/yasm/Artistic.txt'),
- ndk.paths.android_path('toolchain/yasm/BSD.txt'),
- ndk.paths.android_path('toolchain/yasm/COPYING'),
- ndk.paths.android_path('toolchain/yasm/GNU_GPL-2.0'),
- ndk.paths.android_path('toolchain/yasm/GNU_LGPL-2.0'),
- ]
-
- make_src = ndk.paths.ANDROID_DIR / 'toolchain/make'
+ make_src: Path = ndk.paths.ANDROID_DIR / 'toolchain/make'
_make_builder: Optional[AutoconfBuilder] = None
@property
def notices(self) -> List[str]:
- return [
- ndk.paths.android_path('toolchain/python/Python-2.7.5/LICENSE'),
- str(self.make_src / 'COPYING'),
- ndk.paths.ndk_path('sources/host-tools/toolbox/NOTICE'),
- ] + self.yasm_notices
-
- @property
- def intermediate_out_dir(self) -> Path:
- """Path for intermediate outputs of this module."""
- return Path(self.out_dir) / self.host.value
+ return [str(self.make_src / 'COPYING')]
@property
def make_builder(self) -> AutoconfBuilder:
@@ -611,23 +594,49 @@ class HostTools(ndk.builds.Module):
if self._make_builder is None:
self._make_builder = AutoconfBuilder(
self.make_src / 'configure',
- self.intermediate_out_dir / 'make', self.host,
+ self.intermediate_out_dir,
+ self.host,
use_clang=True)
return self._make_builder
- def build_make(self) -> None:
+ def build(self) -> None:
+ print('Building make...')
self.make_builder.build([
"--disable-nls",
"--disable-rpath",
])
+ def install(self) -> None:
+ install_dir = self.get_install_path()
+ copy_tree(
+ str(self.make_builder.install_directory),
+ str(install_dir))
+
+
+class HostTools(ndk.builds.Module):
+ name = 'host-tools'
+ path = 'prebuilt/{host}'
+ notice_group = ndk.builds.NoticeGroup.TOOLCHAIN
+
+ yasm_notices = [
+ ndk.paths.android_path('toolchain/yasm/Artistic.txt'),
+ ndk.paths.android_path('toolchain/yasm/BSD.txt'),
+ ndk.paths.android_path('toolchain/yasm/COPYING'),
+ ndk.paths.android_path('toolchain/yasm/GNU_GPL-2.0'),
+ ndk.paths.android_path('toolchain/yasm/GNU_LGPL-2.0'),
+ ]
+
+ @property
+ def notices(self) -> List[str]:
+ return [
+ ndk.paths.android_path('toolchain/python/Python-2.7.5/LICENSE'),
+ ndk.paths.ndk_path('sources/host-tools/toolbox/NOTICE'),
+ ] + self.yasm_notices
+
def build(self) -> None:
build_args = ndk.builds.common_build_args(self.out_dir, self.dist_dir,
self.host)
- print('Building make...')
- self.build_make()
-
if self.host.is_windows:
print('Building toolbox...')
ndk.builds.invoke_external_build(
@@ -670,10 +679,6 @@ class HostTools(ndk.builds.Module):
shutil.copy2(
ndk.paths.ndk_path(f), os.path.join(install_dir, 'bin'))
- copy_tree(
- str(self.make_builder.install_directory),
- str(install_dir))
-
def install_exe(out_dir: str, install_dir: str, name: str,
host: ndk.hosts.Host) -> None:
@@ -1117,11 +1122,6 @@ class Gdb(ndk.builds.Module):
]
@property
- def intermediate_out_dir(self) -> Path:
- """Path for intermediate outputs of this module."""
- return Path(self.out_dir) / self.host.value / 'gdb'
-
- @property
def expat_builder(self) -> ndk.autoconf.AutoconfBuilder:
"""Returns the lazily initialized expat builder for this module."""
if self._expat_builder is None:
@@ -2648,6 +2648,7 @@ ALL_MODULES = [
Libcxx(),
Libcxxabi(),
Lit(),
+ Make(),
Meta(),
NativeAppGlue(),
NdkBuild(),