| 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 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 139 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
| 140 | 140 |
| 141 # We want to use our version of "all" targets. | 141 # We want to use our version of "all" targets. |
| 142 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 142 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
| 143 } | 143 } |
| 144 | 144 |
| 145 | 145 |
| 146 ################################################################################ | 146 ################################################################################ |
| 147 # Initializes environment variables for NDK/SDK build. Only Android NDK Revision | 147 # Initializes environment variables for NDK/SDK build. Only Android NDK Revision |
| 148 # 7 on Linux or Mac is offically supported. To run this script, the system | 148 # 7 on Linux or Mac is offically supported. To run this script, the system |
| 149 # environment ANDROID_NDK_ROOT must be set to Android NDK's root path as well as | 149 # environment ANDROID_NDK_ROOT must be set to Android NDK's root path. The |
| 150 # ANDROID_SDK_ROOT to the SDK root. | 150 # ANDROID_SDK_ROOT only needs to be set to override the default SDK which is in |
| 151 # the tree under $ROOT/src/third_party/android_tools/sdk. |
| 152 # TODO(navabi): Add NDK to $ROOT/src/third_party/android_tools/ndk. |
| 151 # To build Chromium for Android with NDK/SDK follow the steps below: | 153 # To build Chromium for Android with NDK/SDK follow the steps below: |
| 152 # > export ANDROID_NDK_ROOT=<android ndk root> | 154 # > export ANDROID_NDK_ROOT=<android ndk root> |
| 153 # > export ANDROID_SDK_ROOT=<android sdk root> | 155 # > export ANDROID_SDK_ROOT=<android sdk root> # to override the default sdk |
| 154 # > . build/android/envsetup.sh --sdk | 156 # > . build/android/envsetup.sh --sdk |
| 155 # > make | 157 # > make |
| 156 ############################################################################# | 158 ################################################################################ |
| 157 sdk_build_init() { | 159 sdk_build_init() { |
| 158 if [ ! -d "${ANDROID_NDK_ROOT}" ]; then | 160 if [ ! -d "${ANDROID_NDK_ROOT}" ]; then |
| 159 echo "ANDROID_NDK_ROOT must be set to the path of Android NDK." >& 2 | 161 echo "ANDROID_NDK_ROOT must be set to the path of Android NDK." >& 2 |
| 160 echo "which could be installed by" >& 2 | 162 echo "which could be installed by" >& 2 |
| 161 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 | 163 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 |
| 162 return 1 | 164 return 1 |
| 163 fi | 165 fi |
| 164 | 166 |
| 167 # If ANDROID_SDK_ROOT is set when envsetup is run, use the sdk pointed to by |
| 168 # the environment variable. Otherwise, use the default sdk from the tree. |
| 165 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then | 169 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then |
| 166 echo "ANDROID_SDK_ROOT must be set to the path of Android SDK." >& 2 | 170 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
| 167 echo "which could be installed by" >& 2 | |
| 168 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 | |
| 169 return 1 | |
| 170 fi | 171 fi |
| 171 | 172 |
| 172 # Makes sure ANDROID_BUILD_TOP is unset if build has option --sdk | 173 # Makes sure ANDROID_BUILD_TOP is unset if build has option --sdk |
| 173 unset ANDROID_BUILD_TOP | 174 unset ANDROID_BUILD_TOP |
| 174 | 175 |
| 175 # Set default target. | 176 # Set default target. |
| 176 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" | 177 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" |
| 177 | 178 |
| 178 # Android sdk platform version to use | 179 # Android sdk platform version to use |
| 179 export ANDROID_SDK_VERSION=15 | 180 export ANDROID_SDK_VERSION=15 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 284 |
| 284 export GYP_GENERATORS="android" | 285 export GYP_GENERATORS="android" |
| 285 | 286 |
| 286 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 287 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
| 287 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 288 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
| 288 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 289 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
| 289 | 290 |
| 290 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. | 291 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. |
| 291 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" | 292 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" |
| 292 } | 293 } |
| OLD | NEW |