| 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 # Sets up environment for building Chromium on Android. It can either be | 7 # Sets up environment for building Chromium on Android. It can either be |
| 8 # compiled with the Android tree or using the Android SDK/NDK. To build with | 8 # compiled with the Android tree or using the Android SDK/NDK. To build with |
| 9 # NDK/SDK: ". build/android/envsetup.sh". Environment variable | 9 # NDK/SDK: ". build/android/envsetup.sh". Environment variable |
| 10 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to | 10 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to |
| 11 # specifiy build type. | 11 # specifiy build type. |
| 12 | 12 |
| 13 # Source functions script. The file is in the same directory as this script. |
| 14 . "$(dirname $BASH_SOURCE)"/envsetup_functions.sh |
| 15 |
| 16 export ANDROID_SDK_BUILD=1 # Default to SDK build. |
| 17 |
| 18 process_options "$@" |
| 19 |
| 13 # When building WebView as part of Android we can't use the SDK. Other builds | 20 # When building WebView as part of Android we can't use the SDK. Other builds |
| 14 # default to using the SDK. | 21 # default to using the SDK. |
| 15 if [[ "${CHROME_ANDROID_BUILD_WEBVIEW}" -eq 1 ]]; then | 22 if [[ "${CHROME_ANDROID_BUILD_WEBVIEW}" -eq 1 ]]; then |
| 16 export ANDROID_SDK_BUILD=0 | 23 export ANDROID_SDK_BUILD=0 |
| 17 else | |
| 18 export ANDROID_SDK_BUILD=1 | |
| 19 fi | 24 fi |
| 20 | 25 |
| 21 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then | 26 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then |
| 22 echo "Using SDK build" | 27 echo "Using SDK build" |
| 23 fi | 28 fi |
| 24 | 29 |
| 25 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') | 30 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') |
| 26 | 31 |
| 27 case "${host_os}" in | 32 case "${host_os}" in |
| 28 "linux") | 33 "linux") |
| (...skipping 19 matching lines...) Expand all Loading... |
| 48 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". | 53 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". |
| 49 # Otherwise, it will equal to "${CURRENT_DIR}" | 54 # Otherwise, it will equal to "${CURRENT_DIR}" |
| 50 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ | 55 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ |
| 51 the one you want." | 56 the one you want." |
| 52 echo "${CHROME_SRC}" | 57 echo "${CHROME_SRC}" |
| 53 fi | 58 fi |
| 54 | 59 |
| 55 # Android sdk platform version to use | 60 # Android sdk platform version to use |
| 56 export ANDROID_SDK_VERSION=16 | 61 export ANDROID_SDK_VERSION=16 |
| 57 | 62 |
| 58 # Source functions script. The file is in the same directory as this script. | |
| 59 . "$(dirname $BASH_SOURCE)"/envsetup_functions.sh | |
| 60 | |
| 61 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then | 63 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then |
| 62 process_options "$@" | |
| 63 if [[ -z "${TARGET_ARCH}" ]]; then | 64 if [[ -z "${TARGET_ARCH}" ]]; then |
| 64 return 1 | 65 return 1 |
| 65 fi | 66 fi |
| 66 sdk_build_init | 67 sdk_build_init |
| 67 # Sets up environment for building Chromium for Android with source. Expects | 68 # Sets up environment for building Chromium for Android with source. Expects |
| 68 # android environment setup and lunch. | 69 # android environment setup and lunch. |
| 69 elif [[ -z "$ANDROID_BUILD_TOP" || \ | 70 elif [[ -z "$ANDROID_BUILD_TOP" || \ |
| 70 -z "$ANDROID_TOOLCHAIN" || \ | 71 -z "$ANDROID_TOOLCHAIN" || \ |
| 71 -z "$ANDROID_PRODUCT_OUT" ]]; then | 72 -z "$ANDROID_PRODUCT_OUT" ]]; then |
| 72 echo "Android build environment variables must be set." | 73 echo "Android build environment variables must be set." |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 # This is just a simple wrapper of gyp_chromium, please don't add anything | 106 # This is just a simple wrapper of gyp_chromium, please don't add anything |
| 106 # in this function. | 107 # in this function. |
| 107 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" | 108 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
| 108 ( | 109 ( |
| 109 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 110 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
| 110 ) | 111 ) |
| 111 } | 112 } |
| 112 | 113 |
| 113 # FLOCK needs to be null on system that has no flock | 114 # FLOCK needs to be null on system that has no flock |
| 114 which flock > /dev/null || export FLOCK= | 115 which flock > /dev/null || export FLOCK= |
| OLD | NEW |