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 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then | 158 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then |
159 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" | 159 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
160 fi | 160 fi |
161 | 161 |
162 # Makes sure ANDROID_BUILD_TOP is unset if build has option --sdk | 162 # Makes sure ANDROID_BUILD_TOP is unset if build has option --sdk |
163 unset ANDROID_BUILD_TOP | 163 unset ANDROID_BUILD_TOP |
164 | 164 |
165 # Set default target. | 165 # Set default target. |
166 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" | 166 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" |
167 | 167 |
168 # Android sdk platform version to use | |
169 export ANDROID_SDK_VERSION=15 | |
170 # Unset toolchain so that it can be set based on TARGET_PRODUCT. | 168 # Unset toolchain so that it can be set based on TARGET_PRODUCT. |
171 # This makes it easy to switch between architectures. | 169 # This makes it easy to switch between architectures. |
172 unset ANDROID_TOOLCHAIN | 170 unset ANDROID_TOOLCHAIN |
173 | 171 |
174 common_vars_defines | 172 common_vars_defines |
175 | 173 |
176 DEFINES+=" sdk_build=1" | 174 DEFINES+=" sdk_build=1" |
177 # If we are building NDK/SDK, and in the upstream (open source) tree, | 175 # If we are building NDK/SDK, and in the upstream (open source) tree, |
178 # define a special variable for bringup purposes. | 176 # define a special variable for bringup purposes. |
179 case "${ANDROID_BUILD_TOP-undefined}" in | 177 case "${ANDROID_BUILD_TOP-undefined}" in |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 # > make | 217 # > make |
220 ############################################################################# | 218 ############################################################################# |
221 non_sdk_build_init() { | 219 non_sdk_build_init() { |
222 # We export "TOP" here so that "mmm" can be run to build Java code without | 220 # We export "TOP" here so that "mmm" can be run to build Java code without |
223 # having to cd to $ANDROID_BUILD_TOP. | 221 # having to cd to $ANDROID_BUILD_TOP. |
224 export TOP="$ANDROID_BUILD_TOP" | 222 export TOP="$ANDROID_BUILD_TOP" |
225 | 223 |
226 # We export "ANDROID_NDK_ROOT" for building Chromium for Android by NDK. | 224 # We export "ANDROID_NDK_ROOT" for building Chromium for Android by NDK. |
227 export ANDROID_NDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/ndk/android-ndk-r7 | 225 export ANDROID_NDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/ndk/android-ndk-r7 |
228 | 226 |
229 # Android sdk platform version to use | |
230 export ANDROID_SDK_VERSION=15 | |
231 | |
232 # We export "ANDROID_SDK_ROOT" for building Java source with the SDK. | 227 # We export "ANDROID_SDK_ROOT" for building Java source with the SDK. |
233 export ANDROID_SDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/sdk/\ | 228 export ANDROID_SDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/sdk/\ |
234 ${ANDROID_SDK_VERSION} | 229 ${ANDROID_SDK_VERSION} |
235 # Needed by android antfiles when creating apks. | 230 # Needed by android antfiles when creating apks. |
236 export ANDROID_SDK_HOME=${ANDROID_SDK_ROOT} | 231 export ANDROID_SDK_HOME=${ANDROID_SDK_ROOT} |
237 | 232 |
238 common_vars_defines | 233 common_vars_defines |
239 | 234 |
240 DEFINES+=" sdk_build=0" | 235 DEFINES+=" sdk_build=0" |
241 DEFINES+=" android_product_out=${ANDROID_PRODUCT_OUT}" | 236 DEFINES+=" android_product_out=${ANDROID_PRODUCT_OUT}" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 277 |
283 export GYP_GENERATORS="android" | 278 export GYP_GENERATORS="android" |
284 | 279 |
285 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 280 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
286 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 281 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
287 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 282 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
288 | 283 |
289 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. | 284 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. |
290 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" | 285 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" |
291 } | 286 } |
OLD | NEW |