diff options
author | 2015-10-01 13:24:23 -0700 | |
---|---|---|
committer | 2015-10-01 13:24:23 -0700 | |
commit | e14937e7c458418edcf0a87dd4dd065457d8a8d1 (patch) | |
tree | db0ece3ae4be779224d5ae8da709edb059000d64 | |
parent | 60df542afc3b792c6d563db2dfe233f65a2c3632 (diff) |
Update Android toolchains and streamline process.
- This updates to r10e / API v21 everywhere.
- This has each host machine fetch the NDK,
run make-standalone-toolchain.sh, and copy gdbserver itself.
(It will do all this once per $ARCH, which is a little inefficient, but it
washes out in steady state.)
BUG=skia:
Review URL: https://codereview.chromium.org/1385463002
-rwxr-xr-x | platform_tools/android/bin/download_toolchains.py | 19 | ||||
-rwxr-xr-x | platform_tools/android/bin/utils/setup_toolchain.sh | 54 |
2 files changed, 24 insertions, 49 deletions
diff --git a/platform_tools/android/bin/download_toolchains.py b/platform_tools/android/bin/download_toolchains.py deleted file mode 100755 index 9922283dc0..0000000000 --- a/platform_tools/android/bin/download_toolchains.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python - -"""Download all toolchains for this platform. - -This module downloads multiple tgz's. -""" - -import download_utils -import sys - -url = sys.argv[1] -filepath = sys.argv[2] - -try: - download_utils.SyncURL(url, filepath) - exit(0) -except download_utils.HashError, e: - exit(1) - diff --git a/platform_tools/android/bin/utils/setup_toolchain.sh b/platform_tools/android/bin/utils/setup_toolchain.sh index 3f271890ed..a61b50727f 100755 --- a/platform_tools/android/bin/utils/setup_toolchain.sh +++ b/platform_tools/android/bin/utils/setup_toolchain.sh @@ -32,47 +32,41 @@ if [ -z "$SCRIPT_DIR" ]; then fi function default_toolchain() { - NDK_REV=${NDK_REV-10c} + TOOLCHAINS=${SCRIPT_DIR}/../toolchains + ANDROID_ARCH=${ANDROID_ARCH-arm} - + LLVM=3.6 + NDK=r10e + if [[ $ANDROID_ARCH == *64* ]]; then - API_LEVEL=21 # Official Android 5.0 (Lollipop) system images + API=21 # Android 5.0 else - API_LEVEL=14 # Official Android 4.0 system images + API=14 # Android 4.0 fi - TOOLCHAIN_DIR=${SCRIPT_DIR}/../toolchains - if [ $(uname) == "Darwin" ]; then - verbose "Using Mac toolchain." - TOOLCHAIN_TYPE=ndk-r$NDK_REV-$ANDROID_ARCH-darwin_v$API_LEVEL - else - verbose "Using Linux toolchain." - TOOLCHAIN_TYPE=ndk-r$NDK_REV-$ANDROID_ARCH-linux_v$API_LEVEL - fi - exportVar ANDROID_TOOLCHAIN "${TOOLCHAIN_DIR}/${TOOLCHAIN_TYPE}/bin" + TOOLCHAIN=$ANDROID_ARCH-$NDK-$API + HOST=`uname | tr '[A-Z]' '[a-z]'` - # Hack for NDK_REV == 10c to ensure that clang is present as it was - # added to the tarball after it was initially distributed. - if [ ! -x ${ANDROID_TOOLCHAIN}/clang ]; then - rm -rf ${TOOLCHAIN_DIR}/${TOOLCHAIN_TYPE} - fi + exportVar ANDROID_TOOLCHAIN "${TOOLCHAINS}/${TOOLCHAIN}/bin" - # if the toolchain doesn't exist on your machine then we need to fetch it if [ ! -d "$ANDROID_TOOLCHAIN" ]; then - mkdir -p $TOOLCHAIN_DIR - # enter the toolchain directory then download, unpack, and remove the tarball - pushd $TOOLCHAIN_DIR - TARBALL=ndk-r$NDK_REV-v$API_LEVEL.tgz - - ${SCRIPT_DIR}/download_toolchains.py \ - http://storage.googleapis.com/chromium-skia-gm/android-toolchains/$TARBALL \ - $TOOLCHAIN_DIR/$TARBALL - tar -xzf $TARBALL $TOOLCHAIN_TYPE - rm $TARBALL + mkdir -p $TOOLCHAINS + pushd $TOOLCHAINS + curl -o $NDK.bin https://dl.google.com/android/ndk/android-ndk-$NDK-$HOST-x86_64.bin + chmod +x $NDK.bin + ./$NDK.bin -y + ./android-ndk-$NDK/build/tools/make-standalone-toolchain.sh \ + --arch=$ANDROID_ARCH \ + --llvm-version=$LLVM \ + --platform=android-$API \ + --install_dir=$TOOLCHAIN + cp android-ndk-$NDK/prebuilt/android-$ANDROID_ARCH/gdbserver/gdbserver $TOOLCHAIN + rm $NDK.bin + rm -rf android-ndk-$NDK popd fi - verbose "Targeting NDK API $API_LEVEL (NDK Revision $NDK_REV)" + verbose "Targeting NDK API $API (NDK Revision $NDK)" } #check to see if the toolchain has been defined and if not setup the default toolchain |