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 # Defines functions for envsetup.sh which sets up environment for building | 7 # Defines functions for envsetup.sh which sets up environment for building |
8 # Chromium on Android. The build can be either use the Android NDK/SDK or | 8 # Chromium on Android. The build can be either use the Android NDK/SDK or |
9 # android source tree. Each has a unique init function which calls functions | 9 # android source tree. Each has a unique init function which calls functions |
10 # prefixed with "common_" that is common for both environment setups. | 10 # prefixed with "common_" that is common for both environment setups. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 158 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
159 } | 159 } |
160 | 160 |
161 | 161 |
162 ################################################################################ | 162 ################################################################################ |
163 # Initializes environment variables for NDK/SDK build. Only Android NDK Revision | 163 # Initializes environment variables for NDK/SDK build. Only Android NDK Revision |
164 # 7 on Linux or Mac is offically supported. To run this script, the system | 164 # 7 on Linux or Mac is offically supported. To run this script, the system |
165 # environment ANDROID_NDK_ROOT must be set to Android NDK's root path. The | 165 # environment ANDROID_NDK_ROOT must be set to Android NDK's root path. The |
166 # ANDROID_SDK_ROOT only needs to be set to override the default SDK which is in | 166 # ANDROID_SDK_ROOT only needs to be set to override the default SDK which is in |
167 # the tree under $ROOT/src/third_party/android_tools/sdk. | 167 # the tree under $ROOT/src/third_party/android_tools/sdk. |
168 # TODO(navabi): Add NDK to $ROOT/src/third_party/android_tools/ndk. | |
169 # To build Chromium for Android with NDK/SDK follow the steps below: | 168 # To build Chromium for Android with NDK/SDK follow the steps below: |
170 # > export ANDROID_NDK_ROOT=<android ndk root> | 169 # > export ANDROID_NDK_ROOT=<android ndk root> |
171 # > export ANDROID_SDK_ROOT=<android sdk root> # to override the default sdk | 170 # > export ANDROID_SDK_ROOT=<android sdk root> # to override the default sdk |
172 # > . build/android/envsetup.sh --sdk | 171 # > . build/android/envsetup.sh |
173 # > make | 172 # > make |
174 ################################################################################ | 173 ################################################################################ |
175 sdk_build_init() { | 174 sdk_build_init() { |
176 # If ANDROID_NDK_ROOT is set when envsetup is run, use the ndk pointed to by | 175 # If ANDROID_NDK_ROOT is set when envsetup is run, use the ndk pointed to by |
177 # the environment variable. Otherwise, use the default ndk from the tree. | 176 # the environment variable. Otherwise, use the default ndk from the tree. |
178 if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then | 177 if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then |
179 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" | 178 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" |
180 fi | 179 fi |
181 | 180 |
182 # If ANDROID_SDK_ROOT is set when envsetup is run, and if it has the | 181 # If ANDROID_SDK_ROOT is set when envsetup is run, and if it has the |
183 # right SDK-compatible directory layout, use the sdk pointed to by the | 182 # right SDK-compatible directory layout, use the sdk pointed to by the |
184 # environment variable. Otherwise, use the default sdk from the tree. | 183 # environment variable. Otherwise, use the default sdk from the tree. |
185 local sdk_suffix=platforms/android-${ANDROID_SDK_VERSION} | 184 local sdk_suffix=platforms/android-${ANDROID_SDK_VERSION} |
186 if [[ -z "${ANDROID_SDK_ROOT}" || \ | 185 if [[ -z "${ANDROID_SDK_ROOT}" || \ |
187 ! -d "${ANDROID_SDK_ROOT}/${sdk_suffix}" ]]; then | 186 ! -d "${ANDROID_SDK_ROOT}/${sdk_suffix}" ]]; then |
188 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" | 187 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
189 fi | 188 fi |
190 | 189 |
191 # Makes sure ANDROID_BUILD_TOP is unset if build has option --sdk | |
192 unset ANDROID_BUILD_TOP | 190 unset ANDROID_BUILD_TOP |
193 | 191 |
194 # Set default target. | 192 # Set default target. |
195 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" | 193 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" |
196 | 194 |
197 # Unset toolchain so that it can be set based on TARGET_PRODUCT. | 195 # Unset toolchain so that it can be set based on TARGET_PRODUCT. |
198 # This makes it easy to switch between architectures. | 196 # This makes it easy to switch between architectures. |
199 unset ANDROID_TOOLCHAIN | 197 unset ANDROID_TOOLCHAIN |
200 | 198 |
201 common_vars_defines | 199 common_vars_defines |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 } | 234 } |
237 | 235 |
238 ################################################################################ | 236 ################################################################################ |
239 # Initializes environment variables for build with android source. This expects | 237 # Initializes environment variables for build with android source. This expects |
240 # android environment to be set up along with lunch. To build: | 238 # android environment to be set up along with lunch. To build: |
241 # > . build/envsetup.sh | 239 # > . build/envsetup.sh |
242 # > lunch <lunch-type> | 240 # > lunch <lunch-type> |
243 # > . build/android/envsetup.sh | 241 # > . build/android/envsetup.sh |
244 # > make | 242 # > make |
245 ############################################################################# | 243 ############################################################################# |
246 non_sdk_build_init() { | 244 non_sdk_build_init() { |
Yaron
2012/10/15 22:47:01
Why not remove this section entirely?
shashi
2012/10/15 22:54:50
Partially because of power bot, which seems to be
Yaron
2012/10/15 23:11:32
I thought powerbot only needs lunch and doesn't ne
shashi
2012/10/15 23:37:33
Just verified you are right :).
Fixing power bot f
shashi
2012/10/16 23:00:49
Done.
With Frank's change, this should be fixed.
| |
247 # We export "TOP" here so that "mmm" can be run to build Java code without | 245 # We export "TOP" here so that "mmm" can be run to build Java code without |
248 # having to cd to $ANDROID_BUILD_TOP. | 246 # having to cd to $ANDROID_BUILD_TOP. |
249 export TOP="$ANDROID_BUILD_TOP" | 247 export TOP="$ANDROID_BUILD_TOP" |
250 | 248 |
251 # Set "ANDROID_NDK_ROOT" as checked-in version, if it was not set. | 249 # Set "ANDROID_NDK_ROOT" as checked-in version, if it was not set. |
252 if [[ "${ANDROID_NDK_ROOT}" || ! -d "$ANDROID_NDK_ROOT" ]] ; then | 250 if [[ "${ANDROID_NDK_ROOT}" || ! -d "$ANDROID_NDK_ROOT" ]] ; then |
253 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" | 251 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" |
254 fi | 252 fi |
255 if [[ ! -d "${ANDROID_NDK_ROOT}" ]] ; then | 253 if [[ ! -d "${ANDROID_NDK_ROOT}" ]] ; then |
256 echo "Can not find Android NDK root ${ANDROID_NDK_ROOT}." >& 2 | 254 echo "Can not find Android NDK root ${ANDROID_NDK_ROOT}." >& 2 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 export GYP_DEFINES="${DEFINES}" | 323 export GYP_DEFINES="${DEFINES}" |
326 | 324 |
327 export GYP_GENERATORS="android" | 325 export GYP_GENERATORS="android" |
328 | 326 |
329 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 327 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
330 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 328 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
331 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 329 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
332 | 330 |
333 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" | 331 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" |
334 } | 332 } |
OLD | NEW |