| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 host_arch=$(uname -m | sed -e \ | 122 host_arch=$(uname -m | sed -e \ |
| 123 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/') | 123 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/') |
| 124 DEFINES+=" host_arch=${host_arch}" | 124 DEFINES+=" host_arch=${host_arch}" |
| 125 DEFINES+=" target_arch=ia32" | 125 DEFINES+=" target_arch=ia32" |
| 126 ;; | 126 ;; |
| 127 *) | 127 *) |
| 128 echo "TARGET_ARCH: ${TARGET_ARCH} is not supported." >& 2 | 128 echo "TARGET_ARCH: ${TARGET_ARCH} is not supported." >& 2 |
| 129 print_usage | 129 print_usage |
| 130 return 1 | 130 return 1 |
| 131 esac | 131 esac |
| 132 | |
| 133 DEFINES+=" android_gdbserver=${ANDROID_NDK_ROOT}/prebuilt/\ | |
| 134 android-${TARGET_ARCH}/gdbserver/gdbserver" | |
| 135 } | 132 } |
| 136 | 133 |
| 137 | 134 |
| 138 ################################################################################ | 135 ################################################################################ |
| 139 # Exports common GYP variables based on variable DEFINES and CHROME_SRC. | 136 # Exports common GYP variables based on variable DEFINES and CHROME_SRC. |
| 140 ################################################################################ | 137 ################################################################################ |
| 141 common_gyp_vars() { | 138 common_gyp_vars() { |
| 142 export GYP_DEFINES="${DEFINES}" | 139 export GYP_DEFINES="${DEFINES}" |
| 143 | 140 |
| 144 # Set GYP_GENERATORS to make-android if it's currently unset or null. | 141 # Set GYP_GENERATORS to make-android if it's currently unset or null. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 unset ANDROID_BUILD_TOP | 222 unset ANDROID_BUILD_TOP |
| 226 | 223 |
| 227 # Set default target. | 224 # Set default target. |
| 228 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" | 225 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" |
| 229 | 226 |
| 230 # Unset toolchain so that it can be set based on TARGET_PRODUCT. | 227 # Unset toolchain so that it can be set based on TARGET_PRODUCT. |
| 231 # This makes it easy to switch between architectures. | 228 # This makes it easy to switch between architectures. |
| 232 unset ANDROID_TOOLCHAIN | 229 unset ANDROID_TOOLCHAIN |
| 233 | 230 |
| 234 common_vars_defines | 231 common_vars_defines |
| 235 | |
| 236 # Sets android specific directories to NOT_SDK_COMPLIANT. This will allow | |
| 237 # android_gyp to generate make files, but will cause errors when (and only | |
| 238 # when) building targets that depend on these directories. | |
| 239 DEFINES+=" android_sdk=${ANDROID_SDK_ROOT}/${sdk_suffix}" | |
| 240 DEFINES+=" android_sdk_root=${ANDROID_SDK_ROOT}" | |
| 241 DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/platform-tools" | |
| 242 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" | |
| 243 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" | |
| 244 | |
| 245 common_gyp_vars | 232 common_gyp_vars |
| 246 | 233 |
| 247 if [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then | 234 if [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then |
| 248 # Can not build WebView with NDK/SDK because it needs the Android build | 235 # Can not build WebView with NDK/SDK because it needs the Android build |
| 249 # system and build inside an Android source tree. | 236 # system and build inside an Android source tree. |
| 250 echo "Can not build WebView with NDK/SDK. Requires android source tree." \ | 237 echo "Can not build WebView with NDK/SDK. Requires android source tree." \ |
| 251 >& 2 | 238 >& 2 |
| 252 echo "Try . build/android/envsetup.sh instead." >& 2 | 239 echo "Try . build/android/envsetup.sh instead." >& 2 |
| 253 return 1 | 240 return 1 |
| 254 fi | 241 fi |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 export GYP_DEFINES="${DEFINES}" | 276 export GYP_DEFINES="${DEFINES}" |
| 290 | 277 |
| 291 export GYP_GENERATORS="android" | 278 export GYP_GENERATORS="android" |
| 292 | 279 |
| 293 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 280 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
| 294 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" |
| 295 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 282 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
| 296 | 283 |
| 297 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" | 284 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" |
| 298 } | 285 } |
| OLD | NEW |