| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Sets up environment for building Chromium on Android. It can either be | 7 # Sets up environment for building Chromium on Android. It can either be |
| 8 # compiled with the Android tree or using the Android SDK/NDK. To build with | 8 # compiled with the Android tree or using the Android SDK/NDK. To build with |
| 9 # NDK/SDK: ". build/android/envsetup.sh --sdk". Environment variable | 9 # NDK/SDK: ". build/android/envsetup.sh --sdk". Environment variable |
| 10 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to | 10 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 # Source a bunch of helper functions | 90 # Source a bunch of helper functions |
| 91 . ${CHROME_SRC}/build/android/adb_device_functions.sh | 91 . ${CHROME_SRC}/build/android/adb_device_functions.sh |
| 92 | 92 |
| 93 ANDROID_GOMA_WRAPPER="" | 93 ANDROID_GOMA_WRAPPER="" |
| 94 if [[ -d $GOMA_DIR ]]; then | 94 if [[ -d $GOMA_DIR ]]; then |
| 95 ANDROID_GOMA_WRAPPER="$GOMA_DIR/gomacc" | 95 ANDROID_GOMA_WRAPPER="$GOMA_DIR/gomacc" |
| 96 fi | 96 fi |
| 97 export ANDROID_GOMA_WRAPPER | 97 export ANDROID_GOMA_WRAPPER |
| 98 | 98 |
| 99 # Declare Android are cross compile. |
| 100 export GYP_CROSSCOMPILE=1 |
| 101 |
| 99 export CXX_target="${ANDROID_GOMA_WRAPPER} \ | 102 export CXX_target="${ANDROID_GOMA_WRAPPER} \ |
| 100 $(echo -n ${ANDROID_TOOLCHAIN}/*-g++)" | 103 $(echo -n ${ANDROID_TOOLCHAIN}/*-g++)" |
| 101 | 104 |
| 102 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 105 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
| 103 android_gyp() { | 106 android_gyp() { |
| 104 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" | 107 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
| 105 # http://crbug.com/143889. | 108 # http://crbug.com/143889. |
| 106 # In case we are doing a Clang build, we have to unset CC_target and | 109 # In case we are doing a Clang build, we have to unset CC_target and |
| 107 # CXX_target. Otherwise GYP ends up generating a gcc build (although we set | 110 # CXX_target. Otherwise GYP ends up generating a gcc build (although we set |
| 108 # 'clang' to 1). This behavior was introduced by | 111 # 'clang' to 1). This behavior was introduced by |
| 109 # 54d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83f in GYP. | 112 # 54d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83f in GYP. |
| 110 ( | 113 ( |
| 111 # Fork to avoid side effects on the user's environment variables. | 114 # Fork to avoid side effects on the user's environment variables. |
| 112 if echo "$GYP_DEFINES" | grep -q clang; then | 115 if echo "$GYP_DEFINES" | grep -q clang; then |
| 113 if echo "$CXX_target" | grep -q g++; then | 116 if echo "$CXX_target" | grep -q g++; then |
| 114 unset CXX_target | 117 unset CXX_target |
| 115 fi | 118 fi |
| 116 fi | 119 fi |
| 117 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 120 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
| 118 ) | 121 ) |
| 119 } | 122 } |
| 120 | 123 |
| 121 # FLOCK needs to be null on system that has no flock | 124 # FLOCK needs to be null on system that has no flock |
| 122 which flock > /dev/null || export FLOCK= | 125 which flock > /dev/null || export FLOCK= |
| OLD | NEW |