aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2016-11-15 12:18:24 +0530
committerVishal Bhoj <vishal.bhoj@linaro.org>2016-11-16 14:50:00 +0530
commite8373c7897f0a09c00448f5a9599855539b40484 (patch)
tree2a123f4a090e14c651b91336d128248ba043803e
parent681b7a7bcc68f4d86e017814a7b92103df7249ca (diff)
downloadlinaro-android-build-tools-e8373c7897f0a09c00448f5a9599855539b40484.tar.gz
build-android: support for external clang toolchain
Change-Id: I5b6a3a3b80e6ad5d0528bf0ef72838a3b9c05553 Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rw-r--r--build-scripts/build-android10
1 files changed, 10 insertions, 0 deletions
diff --git a/build-scripts/build-android b/build-scripts/build-android
index a1e648a..74aa7a4 100644
--- a/build-scripts/build-android
+++ b/build-scripts/build-android
@@ -199,6 +199,16 @@ else
unpack_external_tarball "$EXTERNAL_TARBALL"
fi
+ if [ -n "$CLANG_TOOLCHAIN_URL" ]; then
+ unpack_external_tarball "$CLANG_TOOLCHAIN_URL"
+ # Adapt to the aosp toolchain directory hierarchy - compile error otherwise
+ ANDROID_CLANGVER=$(gawk '{ if ($1 == "LLVM_PREBUILTS_VERSION") print $3 }' $PWD/build/core/clang/versions.mk)
+ [ -z $ANDROID_CLANGVER ] && ANDROID_CLANGVER=clang-3217047 # aosp prebuilt build number at 2016/10/20 master
+ mkdir -p upstream_clang/linux-x86/$ANDROID_CLANGVER/
+ cp -r $(basename ${CLANG_TOOLCHAIN_URL})/* upstream_clang/linux-x86/$ANDROID_CLANGVER/
+ export LLVM_PREBUILTS_BASE=${PWD}/upstream_clang/
+ fi
+
if [ -x "${TARGET_TOOLS_PREFIX}gcc" ]; then
${TARGET_TOOLS_PREFIX}gcc -v
fi