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. Only Android NDK, | 7 # Sets up environment for building Chromium on Android. Only Android NDK, |
8 # Revision 6b on Linux or Mac is offically supported. | 8 # Revision 6b on Linux or Mac is offically supported. |
9 # | 9 # |
10 # To run this script, the system environment ANDROID_NDK_ROOT must be set | 10 # To run this script, the system environment ANDROID_NDK_ROOT must be set |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 if [ ! -d "${CHROME_SRC}" ]; then | 109 if [ ! -d "${CHROME_SRC}" ]; then |
110 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 110 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
111 return 1 | 111 return 1 |
112 fi | 112 fi |
113 | 113 |
114 # Add Chromium Android development scripts to system path. | 114 # Add Chromium Android development scripts to system path. |
115 # Must be after CHROME_SRC is set. | 115 # Must be after CHROME_SRC is set. |
116 export PATH=$PATH:${CHROME_SRC}/build/android | 116 export PATH=$PATH:${CHROME_SRC}/build/android |
117 | 117 |
| 118 ANDROID_GOMA_WRAPPER="" |
| 119 if [[ -d $GOMA_DIR ]]; then |
| 120 ANDROID_GOMA_WRAPPER="$GOMA_DIR/gomacc" |
| 121 fi |
| 122 export ANDROID_GOMA_WRAPPER |
| 123 |
| 124 export CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) |
| 125 export CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) |
| 126 export LINK_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) |
| 127 export AR_target=$(basename ${ANDROID_TOOLCHAIN}/*-ar) |
| 128 |
118 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 129 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
119 android_gyp() { | 130 android_gyp() { |
120 ANDROID_GOMA_WRAPPER="" | |
121 if [[ -d $GOMA_DIR ]]; then | |
122 ANDROID_GOMA_WRAPPER="$GOMA_DIR/gomacc" | |
123 fi | |
124 # Ninja requires "*_target" for target builds. | |
125 ANDROID_GOMA_WRAPPER=${ANDROID_GOMA_WRAPPER} \ | |
126 CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) \ | |
127 CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) \ | |
128 LINK_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) \ | |
129 AR_target=$(basename ${ANDROID_TOOLCHAIN}/*-ar) \ | |
130 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" "$@" | 131 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" "$@" |
131 } | 132 } |
132 | 133 |
133 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) | 134 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) |
134 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) | 135 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) |
135 | 136 |
136 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories | 137 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories |
137 # to canonicalize them (remove double '/', remove trailing '/', etc). | 138 # to canonicalize them (remove double '/', remove trailing '/', etc). |
138 DEFINES+=" OS=android" | 139 DEFINES+=" OS=android" |
139 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. | 140 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. |
(...skipping 14 matching lines...) Expand all Loading... |
154 export GYP_DEFINES="${DEFINES}" | 155 export GYP_DEFINES="${DEFINES}" |
155 | 156 |
156 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 157 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
157 export GYP_GENERATORS="make-android" | 158 export GYP_GENERATORS="make-android" |
158 | 159 |
159 # Use our All target as the default | 160 # Use our All target as the default |
160 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 161 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
161 | 162 |
162 # We want to use our version of "all" targets. | 163 # We want to use our version of "all" targets. |
163 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 164 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |