| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 # Sets android specific directories to NOT_SDK_COMPLIANT. This will allow | 185 # Sets android specific directories to NOT_SDK_COMPLIANT. This will allow |
| 186 # android_gyp to generate make files, but will cause errors when (and only | 186 # android_gyp to generate make files, but will cause errors when (and only |
| 187 # when) building targets that depend on these directories. | 187 # when) building targets that depend on these directories. |
| 188 DEFINES+=" android_src='NOT_SDK_COMPLIANT'" | 188 DEFINES+=" android_src='NOT_SDK_COMPLIANT'" |
| 189 DEFINES+=" android_product_out=${CHROME_SRC}/out/android" | 189 DEFINES+=" android_product_out=${CHROME_SRC}/out/android" |
| 190 DEFINES+=" android_lib='NOT_SDK_COMPLIANT'" | 190 DEFINES+=" android_lib='NOT_SDK_COMPLIANT'" |
| 191 DEFINES+=" android_static_lib='NOT_SDK_COMPLIANT'" | 191 DEFINES+=" android_static_lib='NOT_SDK_COMPLIANT'" |
| 192 DEFINES+=\ | 192 DEFINES+=\ |
| 193 " android_sdk=${ANDROID_SDK_ROOT}/platforms/android-${ANDROID_SDK_VERSION}" | 193 " android_sdk=${ANDROID_SDK_ROOT}/platforms/android-${ANDROID_SDK_VERSION}" |
| 194 DEFINES+=" android_sdk_root=${ANDROID_SDK_ROOT}" |
| 194 DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/platform-tools" | 195 DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/platform-tools" |
| 196 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" |
| 197 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" |
| 195 | 198 |
| 196 common_gyp_vars | 199 common_gyp_vars |
| 197 | 200 |
| 198 if [ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]; then | 201 if [ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]; then |
| 199 # Can not build WebView with NDK/SDK because it needs the Android build | 202 # Can not build WebView with NDK/SDK because it needs the Android build |
| 200 # system and build inside an Android source tree. | 203 # system and build inside an Android source tree. |
| 201 echo "Can not build WebView with NDK/SDK. Requires android source tree." \ | 204 echo "Can not build WebView with NDK/SDK. Requires android source tree." \ |
| 202 >& 2 | 205 >& 2 |
| 203 echo "Try . build/android/envsetup.sh instead." >& 2 | 206 echo "Try . build/android/envsetup.sh instead." >& 2 |
| 204 return 1 | 207 return 1 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 DEFINES+=" android_product_out=${ANDROID_PRODUCT_OUT}" | 241 DEFINES+=" android_product_out=${ANDROID_PRODUCT_OUT}" |
| 239 | 242 |
| 240 if [ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]; then | 243 if [ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]; then |
| 241 webview_build_init | 244 webview_build_init |
| 242 return | 245 return |
| 243 fi | 246 fi |
| 244 | 247 |
| 245 # The non-SDK build currently requires the SDK path to build the framework | 248 # The non-SDK build currently requires the SDK path to build the framework |
| 246 # Java aidl files. TODO(steveblock): Investigate avoiding this requirement. | 249 # Java aidl files. TODO(steveblock): Investigate avoiding this requirement. |
| 247 DEFINES+=" android_sdk=${ANDROID_SDK_ROOT}" | 250 DEFINES+=" android_sdk=${ANDROID_SDK_ROOT}" |
| 251 DEFINES+=" android_sdk_root=${ANDROID_SDK_ROOT}" |
| 248 DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/../tools/linux" | 252 DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/../tools/linux" |
| 253 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" |
| 254 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" |
| 249 | 255 |
| 250 common_gyp_vars | 256 common_gyp_vars |
| 251 } | 257 } |
| 252 | 258 |
| 253 ################################################################################ | 259 ################################################################################ |
| 254 # To build WebView, we use the Android build system and build inside an Android | 260 # To build WebView, we use the Android build system and build inside an Android |
| 255 # source tree. This method is called from non_sdk_build_init() and adds to the | 261 # source tree. This method is called from non_sdk_build_init() and adds to the |
| 256 # settings specified there. | 262 # settings specified there. |
| 257 ############################################################################# | 263 ############################################################################# |
| 258 webview_build_init() { | 264 webview_build_init() { |
| 259 # We need to supply SDK paths relative to the top of the Android tree to make | 265 # We need to supply SDK paths relative to the top of the Android tree to make |
| 260 # sure the generated Android makefiles are portable, as they will be checked | 266 # sure the generated Android makefiles are portable, as they will be checked |
| 261 # into the Android tree. | 267 # into the Android tree. |
| 262 ANDROID_SDK=$(python -c \ | 268 ANDROID_SDK=$(python -c \ |
| 263 "import os.path; print os.path.relpath('${ANDROID_SDK_ROOT}', '${TOP}')") | 269 "import os.path; print os.path.relpath('${ANDROID_SDK_ROOT}', '${TOP}')") |
| 264 ANDROID_SDK_TOOLS=$(python -c \ | 270 ANDROID_SDK_TOOLS=$(python -c \ |
| 265 "import os.path; \ | 271 "import os.path; \ |
| 266 print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/linux', \ | 272 print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/linux', \ |
| 267 '${TOP}')") | 273 '${TOP}')") |
| 268 DEFINES+=" android_build_type=1" | 274 DEFINES+=" android_build_type=1" |
| 269 DEFINES+=" android_upstream_bringup=1" | 275 DEFINES+=" android_upstream_bringup=1" |
| 270 DEFINES+=" android_sdk=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK}" | 276 DEFINES+=" android_sdk=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK}" |
| 277 DEFINES+=" android_sdk_root=${ANDROID_SDK_ROOT}" |
| 271 DEFINES+=" android_sdk_tools=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK_TOOLS}" | 278 DEFINES+=" android_sdk_tools=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK_TOOLS}" |
| 279 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" |
| 280 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" |
| 272 export GYP_DEFINES="${DEFINES}" | 281 export GYP_DEFINES="${DEFINES}" |
| 273 | 282 |
| 274 export GYP_GENERATORS="android" | 283 export GYP_GENERATORS="android" |
| 275 | 284 |
| 276 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 285 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
| 277 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 286 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
| 278 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 287 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
| 279 | 288 |
| 280 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. | 289 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. |
| 281 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" | 290 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" |
| 282 } | 291 } |
| OLD | NEW |