| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 # Cross compiling Android on Mac is not currently supported by gyp. | 96 # Cross compiling Android on Mac is not currently supported by gyp. |
| 97 # It doesn't appear to be supported on Windows either. | 97 # It doesn't appear to be supported on Windows either. |
| 98 # As of now, we will only support cross compiling on Linux. | 98 # As of now, we will only support cross compiling on Linux. |
| 99 # libjpeg-turbo assembly code for x86 and x86-64 Android devices | 99 # libjpeg-turbo assembly code for x86 and x86-64 Android devices |
| 100 # must be disabled for Android on non-Linux platforms because | 100 # must be disabled for Android on non-Linux platforms because |
| 101 # of this issue. We still support compiling on Mac and other | 101 # of this issue. We still support compiling on Mac and other |
| 102 # variants for local development, but shipping versions of Skia | 102 # variants for local development, but shipping versions of Skia |
| 103 # should be compiled on Linux for performance reasons. | 103 # should be compiled on Linux for performance reasons. |
| 104 # TODO (msarett): Collect more information about this. | 104 # TODO (msarett): Collect more information about this. |
| 105 if [ $(uname) == "Linux" ]; then | 105 if [ $HOST == "linux" ]; then |
| 106 if [ "$USE_CLANG" != "true" ]; then | 106 if [ "$USE_CLANG" != "true" ]; then |
| 107 exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc" | 107 exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc" |
| 108 exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++" | 108 exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++" |
| 109 exportVar LINK_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc" | 109 exportVar LINK_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc" |
| 110 exportVar CC_host "$CCACHE cc" | 110 exportVar CC_host "$CCACHE cc" |
| 111 exportVar CXX_host "$CCACHE c++" | 111 exportVar CXX_host "$CCACHE c++" |
| 112 exportVar LINK_host "$CCACHE cc" | 112 exportVar LINK_host "$CCACHE cc" |
| 113 else | 113 else |
| 114 exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang" | 114 exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang" |
| 115 exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang++" | 115 exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang++" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 140 | 140 |
| 141 exportVar AR "$ANDROID_TOOLCHAIN_PREFIX-ar" | 141 exportVar AR "$ANDROID_TOOLCHAIN_PREFIX-ar" |
| 142 exportVar RANLIB "$ANDROID_TOOLCHAIN_PREFIX-ranlib" | 142 exportVar RANLIB "$ANDROID_TOOLCHAIN_PREFIX-ranlib" |
| 143 exportVar OBJCOPY "$ANDROID_TOOLCHAIN_PREFIX-objcopy" | 143 exportVar OBJCOPY "$ANDROID_TOOLCHAIN_PREFIX-objcopy" |
| 144 exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip" | 144 exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip" |
| 145 fi | 145 fi |
| 146 | 146 |
| 147 # 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 |
| 148 # 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. |
| 149 # This is required to build using ninja on a Mac. | 149 # This is required to build using ninja on a Mac. |
| 150 if [ $(uname) == "Darwin" ]; then | 150 if [ $HOST == "darwin" ]; then |
| 151 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/nm | 151 ln -sf $ANDROID_TOOLCHAIN_PREFIX-nm $ANDROID_TOOLCHAIN/bin/nm |
| 152 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/readelf | 152 ln -sf $ANDROID_TOOLCHAIN_PREFIX-readelf $ANDROID_TOOLCHAIN/bin/readelf |
| 153 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as | 153 ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/bin/as |
| 154 fi | 154 fi |
| 155 | 155 |
| 156 exportVar PATH ${ANDROID_TOOLCHAIN}/bin:${PATH} | 156 exportVar PATH ${ANDROID_TOOLCHAIN}/bin:${PATH} |
| OLD | NEW |