| OLD | NEW |
| 1 # Copyright 2015 Google Inc. | 1 # Copyright 2015 Google Inc. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 #!/bin/bash | 6 #!/bin/bash |
| 7 # | 7 # |
| 8 # setup_toolchain.sh: Sets toolchain environment variables used by other scripts
. | 8 # setup_toolchain.sh: Sets toolchain environment variables used by other scripts
. |
| 9 | 9 |
| 10 # Fail-fast if anything in the script fails. | 10 # Fail-fast if anything in the script fails. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 TOOLCHAINS=${SCRIPT_DIR}/../toolchains | 35 TOOLCHAINS=${SCRIPT_DIR}/../toolchains |
| 36 | 36 |
| 37 ANDROID_ARCH=${ANDROID_ARCH-arm} | 37 ANDROID_ARCH=${ANDROID_ARCH-arm} |
| 38 NDK=r11c | 38 NDK=r11c |
| 39 | 39 |
| 40 if [[ $ANDROID_ARCH == *64* ]]; then | 40 if [[ $ANDROID_ARCH == *64* ]]; then |
| 41 API=21 # Android 5.0 | 41 API=21 # Android 5.0 |
| 42 else | 42 else |
| 43 API=14 # Android 4.0 | 43 API=14 # Android 4.0 |
| 44 fi | 44 fi |
| 45 |
| 46 if [ "$SKIA_VULKAN" == "true" ]; then |
| 47 API=24 # Android N Preview |
| 48 fi |
| 45 | 49 |
| 46 TOOLCHAIN=$ANDROID_ARCH-$NDK-$API | 50 TOOLCHAIN=$ANDROID_ARCH-$NDK-$API |
| 47 HOST=`uname | tr '[A-Z]' '[a-z]'` | 51 HOST=`uname | tr '[A-Z]' '[a-z]'` |
| 48 | 52 |
| 49 exportVar ANDROID_TOOLCHAIN "${TOOLCHAINS}/${TOOLCHAIN}" | 53 exportVar ANDROID_TOOLCHAIN "${TOOLCHAINS}/${TOOLCHAIN}" |
| 50 | 54 |
| 51 if [ ! -d "$ANDROID_TOOLCHAIN" ]; then | 55 if [ ! -d "$ANDROID_TOOLCHAIN" ]; then |
| 52 mkdir -p $TOOLCHAINS | 56 mkdir -p $TOOLCHAINS |
| 53 pushd $TOOLCHAINS | 57 pushd $TOOLCHAINS |
| 54 curl -o $NDK.zip https://dl.google.com/android/repository/android-ndk-$NDK-$
HOST-x86_64.zip | 58 curl -o $NDK.zip https://dl.google.com/android/repository/android-ndk-$NDK-$
HOST-x86_64.zip |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 # Create symlinks for nm & readelf and add them to the path so that the ninja | 147 # Create symlinks for nm & readelf and add them to the path so that the ninja |
| 144 # build uses them instead of attempting to use the one on the system. | 148 # build uses them instead of attempting to use the one on the system. |
| 145 # This is required to build using ninja on a Mac. | 149 # This is required to build using ninja on a Mac. |
| 146 if [ $(uname) == "Darwin" ]; then | 150 if [ $(uname) == "Darwin" ]; then |
| 147 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/nm | 151 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/nm |
| 148 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/readelf | 152 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/readelf |
| 149 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as | 153 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as |
| 150 fi | 154 fi |
| 151 | 155 |
| 152 exportVar PATH ${ANDROID_TOOLCHAIN}/bin:${PATH} | 156 exportVar PATH ${ANDROID_TOOLCHAIN}/bin:${PATH} |
| OLD | NEW |