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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 | 88 |
89 # Source a bunch of helper functions | 89 # Source a bunch of helper functions |
90 . ${CHROME_SRC}/build/android/adb_device_functions.sh | 90 . ${CHROME_SRC}/build/android/adb_device_functions.sh |
91 | 91 |
92 ANDROID_GOMA_WRAPPER="" | 92 ANDROID_GOMA_WRAPPER="" |
93 if [[ -d $GOMA_DIR ]]; then | 93 if [[ -d $GOMA_DIR ]]; then |
94 ANDROID_GOMA_WRAPPER="$GOMA_DIR/gomacc" | 94 ANDROID_GOMA_WRAPPER="$GOMA_DIR/gomacc" |
95 fi | 95 fi |
96 export ANDROID_GOMA_WRAPPER | 96 export ANDROID_GOMA_WRAPPER |
97 | 97 |
98 export CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) | 98 # Set cross-compile targets for Ninja. The configuration is necessarily |
99 export CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) | 99 # different from Make because we bake absolute paths into the generated |
100 export LINK_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) | 100 # makefiles whereas Ninja builds depend on the PATH variable being set in order |
101 export AR_target=$(basename ${ANDROID_TOOLCHAIN}/*-ar) | 101 # to pick up the correct version of the build tools. |
102 if [[ "${GYP_GENERATORS}" == "ninja" ]]; then | |
103 echo "Configuring environment for Ninja." | |
104 export CC=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) | |
105 export CXX=$(basename ${ANDROID_TOOLCHAIN}/*-g++) | |
106 export AR=$(basename ${ANDROID_TOOLCHAIN}/*-ar) | |
107 export CC_host=gcc | |
108 export CXX_host=g++ | |
Nico
2012/08/13 22:34:31
This makes it hard to build with clang I suppose?
Yaron
2012/08/13 23:12:06
True, this makes it so that ninja+clang doesn't wo
| |
109 export AR_host=ar | |
110 fi | |
111 | |
112 # Add a paranoid check to help developers accidentally switching between Ninja | |
113 # and non-Ninja which would lead to a build break. | |
114 if [[ "${GYP_GENERATORS}" == "ninja" && \ | |
115 "$CC" == $(basename ${ANDROID_TOOLCHAIN}/*-gcc) ]]; then | |
116 echo "Warning! You are using a non-ninja gyp generator but" | |
117 echo "overriding the CC environment variable. Build may" | |
118 echo "not be correct." | |
119 fi | |
102 | 120 |
103 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 121 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
104 android_gyp() { | 122 android_gyp() { |
105 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" | 123 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
106 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 124 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
107 } | 125 } |
108 | 126 |
109 # FLOCK needs to be null on system that has no flock | 127 # FLOCK needs to be null on system that has no flock |
110 which flock > /dev/null || export FLOCK= | 128 which flock > /dev/null || export FLOCK= |
OLD | NEW |