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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 # ANDROID_SDK_ROOT only needs to be set to override the default SDK which is in | 139 # ANDROID_SDK_ROOT only needs to be set to override the default SDK which is in |
140 # the tree under $ROOT/src/third_party/android_tools/sdk. | 140 # the tree under $ROOT/src/third_party/android_tools/sdk. |
141 # TODO(navabi): Add NDK to $ROOT/src/third_party/android_tools/ndk. | 141 # TODO(navabi): Add NDK to $ROOT/src/third_party/android_tools/ndk. |
142 # To build Chromium for Android with NDK/SDK follow the steps below: | 142 # To build Chromium for Android with NDK/SDK follow the steps below: |
143 # > export ANDROID_NDK_ROOT=<android ndk root> | 143 # > export ANDROID_NDK_ROOT=<android ndk root> |
144 # > export ANDROID_SDK_ROOT=<android sdk root> # to override the default sdk | 144 # > export ANDROID_SDK_ROOT=<android sdk root> # to override the default sdk |
145 # > . build/android/envsetup.sh --sdk | 145 # > . build/android/envsetup.sh --sdk |
146 # > make | 146 # > make |
147 ################################################################################ | 147 ################################################################################ |
148 sdk_build_init() { | 148 sdk_build_init() { |
| 149 # If ANDROID_NDK_ROOT is set when envsetup is run, use the ndk pointed to by |
| 150 # the environment variable. Otherwise, use the default ndk from the tree. |
149 if [ ! -d "${ANDROID_NDK_ROOT}" ]; then | 151 if [ ! -d "${ANDROID_NDK_ROOT}" ]; then |
150 echo "ANDROID_NDK_ROOT must be set to the path of Android NDK." >& 2 | 152 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" |
151 echo "which could be installed by" >& 2 | |
152 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 | |
153 return 1 | |
154 fi | 153 fi |
155 | 154 |
156 # If ANDROID_SDK_ROOT is set when envsetup is run, use the sdk pointed to by | 155 # If ANDROID_SDK_ROOT is set when envsetup is run, use the sdk pointed to by |
157 # the environment variable. Otherwise, use the default sdk from the tree. | 156 # the environment variable. Otherwise, use the default sdk from the tree. |
158 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then | 157 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then |
159 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" | 158 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
160 fi | 159 fi |
161 | 160 |
162 # Makes sure ANDROID_BUILD_TOP is unset if build has option --sdk | 161 # Makes sure ANDROID_BUILD_TOP is unset if build has option --sdk |
163 unset ANDROID_BUILD_TOP | 162 unset ANDROID_BUILD_TOP |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 276 |
278 export GYP_GENERATORS="android" | 277 export GYP_GENERATORS="android" |
279 | 278 |
280 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 279 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
281 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 280 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
282 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 281 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
283 | 282 |
284 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. | 283 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. |
285 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" | 284 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" |
286 } | 285 } |
OLD | NEW |