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 13:34:08 +0530
commit10314d0c3c7c9f1d79524b98c3c6037abf4efbe3 (patch)
tree2a123f4a090e14c651b91336d128248ba043803e
parent8702f2ea009d0234aa09023c246a4e13a9ccd9ce (diff)
downloadlinaro-android-build-tools-10314d0c3c7c9f1d79524b98c3c6037abf4efbe3.tar.gz
build-android: support for external clang toolchain
Change-Id: I8cf83a7bbfbe78b30910c3b87922a010e2b45198 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