Commit 9ec0fcb7 authored by Dan Albert's avatar Dan Albert Committed by Gerrit Code Review
Browse files

Merge changes Ie0fb6b48,I137b1239,I26095a2d

* changes:
  Add support for NDK_NEW_TOOLCHAINS_LAYOUT.
  Add support for NDK_TOOLCHAINS_ROOT.
  Move STL support packaging up a level.
parents 24e5dcc2 f7221214
......@@ -103,18 +103,22 @@ endif
# -----------------------------------------------------------------------------
# Function : host-toolchain-path
# Arguments: 1: NDK root
# 2: Toolchain name
# Returns : The parent path of all toolchains for this host. Note that
# HOST_TAG64 == HOST_TAG for 32-bit systems.
# -----------------------------------------------------------------------------
host-toolchain-path = $1/prebuilt/$(HOST_TAG64)
ifeq ($(NDK_NEW_TOOLCHAINS_LAYOUT),true)
host-toolchain-path = $1/$(HOST_TAG64)/$2
else
host-toolchain-path = $1/$2/prebuilt/$(HOST_TAG64)
endif
# -----------------------------------------------------------------------------
# Function : get-toolchain-root
# Arguments: 1: NDK root
# 2: Toolchain name
# Arguments: 1: Toolchain name
# Returns : Path to the given prebuilt toolchain.
# -----------------------------------------------------------------------------
get-toolchain-root = $(call host-toolchain-path,$1/toolchains/$2)
get-toolchain-root = $(call host-toolchain-path,$(NDK_TOOLCHAINS_ROOT),$1)
# -----------------------------------------------------------------------------
# Function : get-binutils-root
......@@ -510,6 +514,15 @@ $(foreach level,$(NDK_ALL_PLATFORM_LEVELS),\
$(call ndk_log,Found max platform level: $(NDK_MAX_PLATFORM_LEVEL))
# Allow the user to point at an alternate location for the toolchains. This is
# particularly helpful if we want to use prebuilt toolchains for building an NDK
# module. Specifically, we use this to build libc++ using ndk-build instead of
# the old build-cxx-stl.sh and maintaining two sets of build rules.
NDK_TOOLCHAINS_ROOT := $(strip $(NDK_TOOLCHAINS_ROOT))
ifndef NDK_TOOLCHAINS_ROOT
NDK_TOOLCHAINS_ROOT := $(strip $(NDK_ROOT)/toolchains)
endif
# ====================================================================
#
# Read all toolchain-specific configuration files.
......
......@@ -136,7 +136,7 @@ endif
# Renderscript
RENDERSCRIPT_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),renderscript)
RENDERSCRIPT_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,renderscript)
RENDERSCRIPT_TOOLCHAIN_PREFIX := $(RENDERSCRIPT_TOOLCHAIN_PREBUILT_ROOT)/bin/
RENDERSCRIPT_TOOLCHAIN_HEADER := $(RENDERSCRIPT_TOOLCHAIN_PREBUILT_ROOT)/lib/clang/3.5/include
......
......@@ -132,7 +132,7 @@ TOOLCHAIN_NAME := $(TARGET_TOOLCHAIN)
TOOLCHAIN_VERSION := $(call last,$(subst -,$(space),$(TARGET_TOOLCHAIN)))
# Define the root path where toolchain prebuilts are stored
TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),$(TOOLCHAIN_NAME))
TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(TOOLCHAIN_NAME))
# Do the same for TOOLCHAIN_PREFIX. Note that we must chop the version
# number from the toolchain name, e.g. arm-eabi-4.4.0 -> path/bin/arm-eabi-
......
......@@ -27,12 +27,12 @@
# Override the toolchain prefix
#
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),llvm)
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,llvm)
LLVM_TOOLCHAIN_PREFIX := $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/bin/
TOOLCHAIN_NAME := aarch64-linux-android
BINUTILS_ROOT := $(call get-binutils-root,$(NDK_ROOT),$(TOOLCHAIN_NAME))
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(NDK_ROOT),$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_PREFIX := $(TOOLCHAIN_ROOT)/bin/$(TOOLCHAIN_NAME)-
TARGET_CC := $(LLVM_TOOLCHAIN_PREFIX)clang$(HOST_EXEEXT)
......
......@@ -27,12 +27,12 @@
# Override the toolchain prefix
#
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),llvm)
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,llvm)
LLVM_TOOLCHAIN_PREFIX := $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/bin/
TOOLCHAIN_NAME := arm-linux-androideabi
BINUTILS_ROOT := $(call get-binutils-root,$(NDK_ROOT),$(TOOLCHAIN_NAME))
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(NDK_ROOT),$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_PREFIX := $(TOOLCHAIN_ROOT)/bin/$(TOOLCHAIN_NAME)-
TARGET_CC := $(LLVM_TOOLCHAIN_PREFIX)clang$(HOST_EXEEXT)
......
......@@ -27,12 +27,12 @@
# Override the toolchain prefix
#
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),llvm)
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,llvm)
LLVM_TOOLCHAIN_PREFIX := $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/bin/
TOOLCHAIN_NAME := mips64el-linux-android
BINUTILS_ROOT := $(call get-binutils-root,$(NDK_ROOT),$(TOOLCHAIN_NAME))
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(NDK_ROOT),$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_PREFIX := $(TOOLCHAIN_ROOT)/bin/$(TOOLCHAIN_NAME)-
TARGET_CC := $(LLVM_TOOLCHAIN_PREFIX)clang$(HOST_EXEEXT)
......
......@@ -27,12 +27,12 @@
# Override the toolchain prefix
#
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),llvm)
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,llvm)
LLVM_TOOLCHAIN_PREFIX := $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/bin/
TOOLCHAIN_NAME := mipsel-linux-android
BINUTILS_ROOT := $(call get-binutils-root,$(NDK_ROOT),$(TOOLCHAIN_NAME))
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(NDK_ROOT),$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(TOOLCHAIN_NAME)-4.9)
TOOLCHAIN_PREFIX := $(TOOLCHAIN_ROOT)/bin/$(TOOLCHAIN_NAME)-
TARGET_CC := $(LLVM_TOOLCHAIN_PREFIX)clang$(HOST_EXEEXT)
......
......@@ -27,12 +27,12 @@
# Override the toolchain prefix
#
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),llvm)
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,llvm)
LLVM_TOOLCHAIN_PREFIX := $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/bin/
TOOLCHAIN_NAME := i686-linux-android
BINUTILS_ROOT := $(call get-binutils-root,$(NDK_ROOT),$(TOOLCHAIN_NAME))
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(NDK_ROOT),x86-4.9)
TOOLCHAIN_ROOT := $(call get-toolchain-root,x86-4.9)
TOOLCHAIN_PREFIX := $(TOOLCHAIN_ROOT)/bin/$(TOOLCHAIN_NAME)-
TARGET_CC := $(LLVM_TOOLCHAIN_PREFIX)clang$(HOST_EXEEXT)
......
......@@ -27,12 +27,12 @@
# Override the toolchain prefix
#
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,$(NDK_ROOT),llvm)
LLVM_TOOLCHAIN_PREBUILT_ROOT := $(call get-toolchain-root,llvm)
LLVM_TOOLCHAIN_PREFIX := $(LLVM_TOOLCHAIN_PREBUILT_ROOT)/bin/
TOOLCHAIN_NAME := x86_64-linux-android
BINUTILS_ROOT := $(call get-binutils-root,$(NDK_ROOT),$(TOOLCHAIN_NAME))
TOOLCHAIN_ROOT := $(call get-toolchain-root,$(NDK_ROOT),x86_64-4.9)
TOOLCHAIN_ROOT := $(call get-toolchain-root,x86_64-4.9)
TOOLCHAIN_PREFIX := $(TOOLCHAIN_ROOT)/bin/$(TOOLCHAIN_NAME)-
TARGET_CC := $(LLVM_TOOLCHAIN_PREFIX)clang$(HOST_EXEEXT)
......
......@@ -648,7 +648,6 @@ for ABI in $ABIS; do
fi
done
# If needed, package files into tarballs
if [ -n "$PACKAGE_DIR" ] ; then
if [ "$CXX_STL" = "libc++" ]; then
STL_DIR="llvm-libc++"
......@@ -663,48 +662,6 @@ if [ -n "$PACKAGE_DIR" ] ; then
log "Packaging: $PACKAGE"
pack_archive "$PACKAGE" "$OUT_DIR/sources/cxx-stl" "$STL_DIR"
fail_panic "Could not package $CXX_STL binaries!"
# TODO(danalbert): Move these up into checkbuild.py?
# None of these actually have a build step, so we could just pack them up
# simply in checkbuild.py.
#
# gabi++ and libc++abi should actually probably be moved around to be in the
# same package as stlport and libc++ respectively since they are actually
# bound to each other.
if [ "$CXX_STL" = "libc++" ]; then
# We need to package libc++abi in case the user needs to rebuild libc++.
SUBDIR="sources/cxx-stl"
make_repo_prop "$OUT_DIR/$SUBDIR/llvm-libc++abi"
PACKAGE="$PACKAGE_DIR/libcxxabi.zip"
log "Packaging: $PACKAGE"
pack_archive "$PACKAGE" "$OUT_DIR/$SUBDIR" "llvm-libc++abi"
fail_panic "Could not package libc++abi!"
# libc++ needs libandroid_support.
make_repo_prop "$OUT_DIR/sources/android/support"
PACKAGE="$PACKAGE_DIR/libandroid_support.zip"
log "Packaging: $PACKAGE"
pack_archive "$PACKAGE" "$OUT_DIR/sources/android" "support"
fail_panic "Could not package libandroid_support!"
elif [ "$CXX_STL" = "stlport" ]; then
# Stlport depends on gabi++.
SUBDIR="sources/cxx-stl"
make_repo_prop "$OUT_DIR/$SUBDIR/gabi++"
PACKAGE="$PACKAGE_DIR/gabixx.zip"
log "Packaging: $PACKAGE"
pack_archive "$PACKAGE" "$OUT_DIR/$SUBDIR" "gabi++"
fail_panic "Could not package gabi++!"
# ... and the system STL.
SUBDIR="sources/cxx-stl"
make_repo_prop "$OUT_DIR/$SUBDIR/system"
PACKAGE="$PACKAGE_DIR/system-stl.zip"
log "Packaging: $PACKAGE"
pack_archive "$PACKAGE" "$OUT_DIR/$SUBDIR" "system"
fail_panic "Could not package gabi++!"
else
panic "Unknown STL: $CXX_STL"
fi
fi
if [ -z "$OPTION_BUILD_DIR" ]; then
......
......@@ -43,18 +43,22 @@ ALL_MODULES = {
'build',
'clang',
'cpufeatures',
'gabi++',
'gcc',
'gcclibs',
'gdbserver',
'gnustl',
'gtest',
'host-tools',
'libandroid_support',
'libc++',
'libc++abi',
'native_app_glue',
'ndk_helper',
'platforms',
'python-packages',
'stlport',
'system-stl',
}
......@@ -557,6 +561,30 @@ def build_python_packages(_, dist_dir, __):
shutil.rmtree(temp_dir)
def build_gabixx(_out_dir, dist_dir, _args):
print('Building gabi++...')
path = build_support.ndk_path('sources/cxx-stl/gabi++')
build_support.make_package('gabixx', path, dist_dir)
def build_system_stl(_out_dir, dist_dir, _args):
print('Building system-stl...')
path = build_support.ndk_path('sources/cxx-stl/system')
build_support.make_package('system-stl', path, dist_dir)
def build_libandroid_support(_out_dir, dist_dir, _args):
print('Building libandroid_support...')
path = build_support.ndk_path('sources/android/support')
build_support.make_package('libandroid_support', path, dist_dir)
def build_libcxxabi(_out_dir, dist_dir, _args):
print('Building libc++abi...')
path = build_support.ndk_path('sources/cxx-stl/llvm-libc++abi')
build_support.make_package('libcxxabi', path, dist_dir)
def main():
parser = ArgParser()
args = parser.parse_args()
......@@ -606,18 +634,22 @@ def main():
('build', build_build),
('clang', build_clang),
('cpufeatures', build_cpufeatures),
('gabi++', build_gabixx),
('gcc', build_gcc),
('gcclibs', build_gcc_libs),
('gdbserver', build_gdbserver),
('gnustl', build_gnustl),
('gtest', build_gtest),
('host-tools', build_host_tools),
('libandroid_support', build_libandroid_support),
('libc++', build_libcxx),
('libc++abi', build_libcxxabi),
('native_app_glue', build_native_app_glue),
('ndk_helper', build_ndk_helper),
('platforms', build_platforms),
('python-packages', build_python_packages),
('stlport', build_stlport),
('system-stl', build_system_stl),
])
print('Building modules: {}'.format(' '.join(modules)))
......
/repo.prop
/repo.prop
/libs/
/repo.prop
/repo.prop
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment