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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 # experimentation with a custom SDK. | 180 # experimentation with a custom SDK. |
181 local sdk_defines="" | 181 local sdk_defines="" |
182 if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then | 182 if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then |
183 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" | 183 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" |
184 fi | 184 fi |
185 if [[ -z "${ANDROID_SDK_VERSION}" ]]; then | 185 if [[ -z "${ANDROID_SDK_VERSION}" ]]; then |
186 export ANDROID_SDK_VERSION=19 | 186 export ANDROID_SDK_VERSION=19 |
187 else | 187 else |
188 sdk_defines+=" android_sdk_version=${ANDROID_SDK_VERSION}" | 188 sdk_defines+=" android_sdk_version=${ANDROID_SDK_VERSION}" |
189 fi | 189 fi |
190 local sdk_suffix=platforms/android-${ANDROID_SDK_VERSION} | 190 if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then |
191 if [[ -z "${ANDROID_SDK_ROOT}" || \ | |
192 ! -d "${ANDROID_SDK_ROOT}/${sdk_suffix}" ]]; then | |
193 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" | 191 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
194 else | 192 else |
195 sdk_defines+=" android_sdk_root=${ANDROID_SDK_ROOT}" | 193 sdk_defines+=" android_sdk_root=${ANDROID_SDK_ROOT}" |
196 fi | 194 fi |
197 if [[ -z "${ANDROID_SDK_BUILD_TOOLS_VERSION}" ]]; then | 195 if [[ -z "${ANDROID_SDK_BUILD_TOOLS_VERSION}" ]]; then |
198 export ANDROID_SDK_BUILD_TOOLS_VERSION=19.0.0 | 196 export ANDROID_SDK_BUILD_TOOLS_VERSION=19.0.0 |
199 fi | 197 fi |
200 | 198 |
201 # Unset toolchain. This makes it easy to switch between architectures. | 199 # Unset toolchain. This makes it easy to switch between architectures. |
202 unset ANDROID_TOOLCHAIN | 200 unset ANDROID_TOOLCHAIN |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 fi | 273 fi |
276 export GYP_DEFINES="${DEFINES}" | 274 export GYP_DEFINES="${DEFINES}" |
277 | 275 |
278 export GYP_GENERATORS="android" | 276 export GYP_GENERATORS="android" |
279 | 277 |
280 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 278 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
281 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 279 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
282 | 280 |
283 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" | 281 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" |
284 } | 282 } |
OLD | NEW |