aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ndk/builds.py10
-rwxr-xr-xndk/checkbuild.py71
2 files changed, 46 insertions, 35 deletions
diff --git a/ndk/builds.py b/ndk/builds.py
index b68afaefa..02d315cc4 100644
--- a/ndk/builds.py
+++ b/ndk/builds.py
@@ -22,6 +22,7 @@ from __future__ import absolute_import
from enum import auto, Enum, unique
import ntpath
import os
+from pathlib import Path
import shutil
import stat
import subprocess
@@ -298,6 +299,15 @@ class Module:
return install_subdirs[0]
+ @property
+ def intermediate_out_dir(self) -> Path:
+ """Path for intermediate outputs of this module."""
+ base_path = Path(self.out_dir) / self.host.value / self.name
+ if self.split_build_by_arch:
+ return base_path / self.build_arch
+ else:
+ return base_path
+
def __str__(self) -> str:
if self.split_build_by_arch and self.build_arch is not None:
return f'{self.name} [{self.build_arch}]'
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(),