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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 pushd $TOOLCHAINS | 53 pushd $TOOLCHAINS |
54 curl -o $NDK.zip https://dl.google.com/android/repository/android-ndk-$NDK-$
HOST-x86_64.zip | 54 curl -o $NDK.zip https://dl.google.com/android/repository/android-ndk-$NDK-$
HOST-x86_64.zip |
55 unzip $NDK.zip | 55 unzip $NDK.zip |
56 UNZIPPED=android-ndk-$NDK | 56 UNZIPPED=android-ndk-$NDK |
57 ./$UNZIPPED/build/tools/make-standalone-toolchain.sh \ | 57 ./$UNZIPPED/build/tools/make-standalone-toolchain.sh \ |
58 --use-llvm \ | 58 --use-llvm \ |
59 --arch=$ANDROID_ARCH \ | 59 --arch=$ANDROID_ARCH \ |
60 --platform=android-$API \ | 60 --platform=android-$API \ |
61 --install_dir=$TOOLCHAIN | 61 --install_dir=$TOOLCHAIN |
62 cp $UNZIPPED/prebuilt/android-$ANDROID_ARCH/gdbserver/gdbserver $TOOLCHAIN | 62 cp $UNZIPPED/prebuilt/android-$ANDROID_ARCH/gdbserver/gdbserver $TOOLCHAIN |
63 cp $UNZIPPED/prebuilt/${HOST}-x86_64/bin/gdb $TOOLCHAIN | 63 cp -r $UNZIPPED/prebuilt/${HOST}-x86_64 $TOOLCHAIN/host_prebuilt |
64 rm $NDK.zip | 64 rm $NDK.zip |
65 rm -rf $UNZIPPED | 65 rm -rf $UNZIPPED |
66 popd | 66 popd |
67 fi | 67 fi |
68 | 68 |
69 verbose "Targeting NDK API $API (NDK Revision $NDK)" | 69 verbose "Targeting NDK API $API (NDK Revision $NDK)" |
70 } | 70 } |
71 | 71 |
72 #check to see if the toolchain has been defined and if not setup the default too
lchain | 72 #check to see if the toolchain has been defined and if not setup the default too
lchain |
73 if [ -z "$ANDROID_TOOLCHAIN" ]; then | 73 if [ -z "$ANDROID_TOOLCHAIN" ]; then |
(...skipping 69 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 | 143 # 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. | 144 # build uses them instead of attempting to use the one on the system. |
145 # This is required to build using ninja on a Mac. | 145 # This is required to build using ninja on a Mac. |
146 if [ $(uname) == "Darwin" ]; then | 146 if [ $(uname) == "Darwin" ]; then |
147 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/nm | 147 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/nm |
148 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/readelf | 148 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/readelf |
149 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as | 149 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as |
150 fi | 150 fi |
151 | 151 |
152 exportVar PATH $ANDROID_TOOLCHAIN:$PATH | 152 exportVar PATH $ANDROID_TOOLCHAIN:$PATH |
OLD | NEW |