| 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. | 6 # Sets up environment for building Chromium on Android. |
| 7 | 7 |
| 8 # Make sure we're being sourced (possibly by another script). Check for bash | 8 # Make sure we're being sourced (possibly by another script). Check for bash |
| 9 # since zsh sets $0 when sourcing. | 9 # since zsh sets $0 when sourcing. |
| 10 if [[ -n "$BASH_VERSION" && "${BASH_SOURCE:-$0}" == "$0" ]]; then | 10 if [[ -n "$BASH_VERSION" && "${BASH_SOURCE:-$0}" == "$0" ]]; then |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". | 41 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". |
| 42 # Otherwise, it will equal to "${CURRENT_DIR}" | 42 # Otherwise, it will equal to "${CURRENT_DIR}" |
| 43 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ | 43 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ |
| 44 the one you want." | 44 the one you want." |
| 45 echo "${CHROME_SRC}" | 45 echo "${CHROME_SRC}" |
| 46 fi | 46 fi |
| 47 | 47 |
| 48 # Allow the caller to override a few environment variables. If any of them is | 48 # Allow the caller to override a few environment variables. If any of them is |
| 49 # unset, we default to a sane value that's known to work. This allows for | 49 # unset, we default to a sane value that's known to work. This allows for |
| 50 # experimentation with a custom SDK. | 50 # experimentation with a custom SDK. |
| 51 if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then | |
| 52 export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" | |
| 53 fi | |
| 54 if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then | 51 if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then |
| 55 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" | 52 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
| 56 fi | 53 fi |
| 57 | 54 |
| 58 # Add Android SDK tools to system path. | 55 # Add Android SDK tools to system path. |
| 59 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools | 56 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools |
| 60 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools | 57 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools |
| 61 | 58 |
| 62 # Add Chromium Android development scripts to system path. | 59 # Add Chromium Android development scripts to system path. |
| 63 # Must be after CHROME_SRC is set. | 60 # Must be after CHROME_SRC is set. |
| 64 export PATH=$PATH:${CHROME_SRC}/build/android | 61 export PATH=$PATH:${CHROME_SRC}/build/android |
| 65 | 62 |
| 66 if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then | 63 if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then |
| 67 # These defines are used by various chrome build scripts to tag the binary's | 64 # These defines are used by various chrome build scripts to tag the binary's |
| 68 # version string as 'official' in linux builds (e.g. in | 65 # version string as 'official' in linux builds (e.g. in |
| 69 # chrome/trunk/src/chrome/tools/build/version.py). | 66 # chrome/trunk/src/chrome/tools/build/version.py). |
| 70 export OFFICIAL_BUILD=1 | 67 export OFFICIAL_BUILD=1 |
| 71 export CHROMIUM_BUILD="_google_chrome" | 68 export CHROMIUM_BUILD="_google_chrome" |
| 72 export CHROME_BUILD_TYPE="_official" | 69 export CHROME_BUILD_TYPE="_official" |
| 73 fi | 70 fi |
| 74 | 71 |
| 75 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 72 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
| 76 android_gyp() { | 73 android_gyp() { |
| 77 # This is just a simple wrapper of gyp_chromium, please don't add anything | 74 # This is just a simple wrapper of gyp_chromium, please don't add anything |
| 78 # in this function. | 75 # in this function. |
| 79 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 76 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
| 80 } | 77 } |
| OLD | NEW |