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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 fi | 58 fi |
59 | 59 |
60 # if the toolchain doesn't exist on your machine then we need to fetch it | 60 # if the toolchain doesn't exist on your machine then we need to fetch it |
61 if [ ! -d "$ANDROID_TOOLCHAIN" ]; then | 61 if [ ! -d "$ANDROID_TOOLCHAIN" ]; then |
62 mkdir -p $TOOLCHAIN_DIR | 62 mkdir -p $TOOLCHAIN_DIR |
63 # enter the toolchain directory then download, unpack, and remove the tarbal
l | 63 # enter the toolchain directory then download, unpack, and remove the tarbal
l |
64 pushd $TOOLCHAIN_DIR | 64 pushd $TOOLCHAIN_DIR |
65 TARBALL=ndk-r$NDK_REV-v$API_LEVEL.tgz | 65 TARBALL=ndk-r$NDK_REV-v$API_LEVEL.tgz |
66 | 66 |
67 ${SCRIPT_DIR}/download_toolchains.py \ | 67 ${SCRIPT_DIR}/download_toolchains.py \ |
68 http://chromium-skia-gm.commondatastorage.googleapis.com/android-toolcha
ins/$TARBALL \ | 68 http://storage.googleapis.com/chromium-skia-gm/android-toolchains/$TARBA
LL \ |
69 $TOOLCHAIN_DIR/$TARBALL | 69 $TOOLCHAIN_DIR/$TARBALL |
70 tar -xzf $TARBALL $TOOLCHAIN_TYPE | 70 tar -xzf $TARBALL $TOOLCHAIN_TYPE |
71 rm $TARBALL | 71 rm $TARBALL |
72 popd | 72 popd |
73 fi | 73 fi |
74 | 74 |
75 verbose "Targeting NDK API $API_LEVEL (NDK Revision $NDK_REV)" | 75 verbose "Targeting NDK API $API_LEVEL (NDK Revision $NDK_REV)" |
76 } | 76 } |
77 | 77 |
78 #check to see if the toolchain has been defined and if not setup the default too
lchain | 78 #check to see if the toolchain has been defined and if not setup the default too
lchain |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 # Create symlinks for nm & readelf and add them to the path so that the ninja | 153 # Create symlinks for nm & readelf and add them to the path so that the ninja |
154 # build uses them instead of attempting to use the one on the system. | 154 # build uses them instead of attempting to use the one on the system. |
155 # This is required to build using ninja on a Mac. | 155 # This is required to build using ninja on a Mac. |
156 if [ $(uname) == "Darwin" ]; then | 156 if [ $(uname) == "Darwin" ]; then |
157 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/nm | 157 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/nm |
158 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/readelf | 158 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/readelf |
159 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as | 159 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as |
160 fi | 160 fi |
161 | 161 |
162 exportVar PATH $ANDROID_TOOLCHAIN:$PATH | 162 exportVar PATH $ANDROID_TOOLCHAIN:$PATH |
OLD | NEW |