Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: platform_tools/android/bin/utils/setup_toolchain.sh

Issue 1774503004: Update android_make to support both --gcc and --clang options. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better way to handle codec.gyp Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « platform_tools/android/bin/android_setup.sh ('k') | platform_tools/android/gyp/dependencies.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/bin/utils/setup_toolchain.sh
diff --git a/platform_tools/android/bin/utils/setup_toolchain.sh b/platform_tools/android/bin/utils/setup_toolchain.sh
index a61b50727f74eaf6d8d177da1faba19b3ba419c0..b4234468128576a282326214a1cac6445daa3ebb 100755
--- a/platform_tools/android/bin/utils/setup_toolchain.sh
+++ b/platform_tools/android/bin/utils/setup_toolchain.sh
@@ -99,7 +99,7 @@ CCACHE=${ANDROID_MAKE_CCACHE-$(which ccache || true)}
# should be compiled on Linux for performance reasons.
# TODO (msarett): Collect more information about this.
if [ $(uname) == "Linux" ]; then
- if [ -z $USE_CLANG ]; then
+ if [ "$USE_CLANG" != "true" ]; then
exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++"
exportVar LINK_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
@@ -107,8 +107,6 @@ if [ $(uname) == "Linux" ]; then
exportVar CXX_host "$CCACHE c++"
exportVar LINK_host "$CCACHE cc"
else
- # temporarily disable ccache as it is generating errors
- CCACHE=""
exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang++"
exportVar LINK_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
@@ -126,13 +124,11 @@ if [ $(uname) == "Linux" ]; then
exportVar OBJCOPY_host "objcopy"
exportVar STRIP_host "strip"
else
- if [ -z $USE_CLANG ]; then
+ if [ "$USE_CLANG" != "true" ]; then
exportVar CC "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
exportVar CXX "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++"
exportVar LINK "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
else
- # temporarily disable ccache as it is generating errors
- CCACHE=""
exportVar CC "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
exportVar CXX "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang++"
exportVar LINK "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
@@ -153,4 +149,12 @@ if [ $(uname) == "Darwin" ]; then
ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as
fi
+# fix bug in the toolchain in order to enable ccache to work with clang
+if [ $(head -c 2 $ANDROID_TOOLCHAIN_PREFIX-clang) != "#!" ]; then
+ echo -e "#!/bin/bash\n$(cat $ANDROID_TOOLCHAIN_PREFIX-clang)" > $ANDROID_TOOLCHAIN_PREFIX-clang
+fi
+if [ $(head -c 2 $ANDROID_TOOLCHAIN_PREFIX-clang++) != "#!" ]; then
+ echo -e "#!/bin/bash\n$(cat $ANDROID_TOOLCHAIN_PREFIX-clang++)" > $ANDROID_TOOLCHAIN_PREFIX-clang++
+fi
+
exportVar PATH $ANDROID_TOOLCHAIN:$PATH
« no previous file with comments | « platform_tools/android/bin/android_setup.sh ('k') | platform_tools/android/gyp/dependencies.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698