| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Sets up environment for building Chromium on Android. It can either be | 6 # Sets up environment for building Chromium on Android. It can either be |
| 7 # compiled with the Android tree or using the Android SDK/NDK. To build with | 7 # compiled with the Android tree or using the Android SDK/NDK. To build with |
| 8 # NDK/SDK: ". build/android/envsetup.sh". Environment variable | 8 # NDK/SDK: ". build/android/envsetup.sh". Environment variable |
| 9 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to | 9 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to |
| 10 # specifiy build type. | 10 # specifiy build type. |
| 11 | 11 |
| 12 if [ "$_" == "$0" ]; then | 12 if [ "$_" == "$0" ]; then |
| 13 echo "ERROR: envsetup must be sourced." | 13 echo "ERROR: envsetup must be sourced." |
| 14 exit 1 | 14 exit 1 |
| 15 fi | 15 fi |
| 16 | 16 |
| 17 # Source functions script. The file is in the same directory as this script. | 17 # Source functions script. The file is in the same directory as this script. |
| 18 . "$(dirname $BASH_SOURCE)"/envsetup_functions.sh | 18 . "$(dirname $BASH_SOURCE)"/envsetup_functions.sh |
| 19 | 19 |
| 20 export ANDROID_SDK_BUILD=1 # Default to SDK build. | 20 export ANDROID_SDK_BUILD=1 # Default to SDK build. |
| 21 | 21 |
| 22 process_options "$@" | 22 process_options "$@" |
| 23 | 23 |
| 24 # When building WebView as part of Android we can't use the SDK. Other builds | 24 # When building WebView as part of Android we can't use the SDK. Other builds |
| 25 # default to using the SDK. | 25 # default to using the SDK. |
| 26 if [[ "${CHROME_ANDROID_BUILD_WEBVIEW}" -eq 1 ]]; then | 26 if [[ "${CHROME_ANDROID_BUILD_WEBVIEW}" -eq 1 ]]; then |
| 27 export ANDROID_SDK_BUILD=0 | 27 export ANDROID_SDK_BUILD=0 |
| 28 fi | 28 fi |
| 29 | 29 |
| 30 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then | 30 if [[ "${ANDROID_SDK_BUILD}" -ne 1 ]]; then |
| 31 echo "Using SDK build" | 31 echo "Initializing for non-SDK build." |
| 32 fi | 32 fi |
| 33 | 33 |
| 34 # Get host architecture, and abort if it is 32-bit, unless --try-32 | 34 # Get host architecture, and abort if it is 32-bit, unless --try-32 |
| 35 # is also used. | 35 # is also used. |
| 36 host_arch=$(uname -m) | 36 host_arch=$(uname -m) |
| 37 case "${host_arch}" in | 37 case "${host_arch}" in |
| 38 x86_64) # pass | 38 x86_64) # pass |
| 39 ;; | 39 ;; |
| 40 i?86) | 40 i?86) |
| 41 if [[ -z "${try_32bit_host_build}" ]]; then | 41 if [[ -z "${try_32bit_host_build}" ]]; then |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 # This is just a simple wrapper of gyp_chromium, please don't add anything | 155 # This is just a simple wrapper of gyp_chromium, please don't add anything |
| 156 # in this function. | 156 # in this function. |
| 157 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" | 157 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
| 158 ( | 158 ( |
| 159 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 159 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
| 160 ) | 160 ) |
| 161 } | 161 } |
| 162 | 162 |
| 163 # FLOCK needs to be null on system that has no flock | 163 # FLOCK needs to be null on system that has no flock |
| 164 which flock > /dev/null || export FLOCK= | 164 which flock > /dev/null || export FLOCK= |
| OLD | NEW |