| 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 |
| 11 echo "ERROR: envsetup must be sourced." | 11 echo "ERROR: envsetup must be sourced." |
| 12 exit 1 | 12 exit 1 |
| 13 fi | 13 fi |
| 14 | 14 |
| 15 # This only exists to set local variables. Don't call this manually. | 15 # This only exists to set local variables. Don't call this manually. |
| 16 android_envsetup_main() { | 16 android_envsetup_main() { |
| 17 local SCRIPT_PATH="$1" | 17 local SCRIPT_PATH="$1" |
| 18 local SCRIPT_DIR="$(dirname "$SCRIPT_PATH")" | 18 local SCRIPT_DIR="$(dirname "$SCRIPT_PATH")" |
| 19 | 19 |
| 20 local CURRENT_DIR="$(readlink -f "${SCRIPT_DIR}/../../")" | 20 #local CURRENT_DIR="$(readlink -f "${SCRIPT_DIR}/../../")" |
| 21 local CURRENT_DIR="${PWD}/${SCRIPT_DIR}/../../" |
| 21 if [[ -z "${CHROME_SRC}" ]]; then | 22 if [[ -z "${CHROME_SRC}" ]]; then |
| 22 # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. | 23 # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. |
| 23 local CHROME_SRC="${CURRENT_DIR}" | 24 local CHROME_SRC="${CURRENT_DIR}" |
| 24 fi | 25 fi |
| 25 | 26 |
| 26 if [[ "${CURRENT_DIR/"${CHROME_SRC}"/}" == "${CURRENT_DIR}" ]]; then | 27 if [[ "${CURRENT_DIR/"${CHROME_SRC}"/}" == "${CURRENT_DIR}" ]]; then |
| 27 # If current directory is not in $CHROME_SRC, it might be set for other | 28 # If current directory is not in $CHROME_SRC, it might be set for other |
| 28 # source tree. If $CHROME_SRC was set correctly and we are in the correct | 29 # source tree. If $CHROME_SRC was set correctly and we are in the correct |
| 29 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". | 30 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". |
| 30 # Otherwise, it will equal to "${CURRENT_DIR}" | 31 # Otherwise, it will equal to "${CURRENT_DIR}" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 50 export ENVSETUP_GYP_CHROME_SRC=${CHROME_SRC} # TODO(thakis): Remove. | 51 export ENVSETUP_GYP_CHROME_SRC=${CHROME_SRC} # TODO(thakis): Remove. |
| 51 } | 52 } |
| 52 # In zsh, $0 is the name of the file being sourced. | 53 # In zsh, $0 is the name of the file being sourced. |
| 53 android_envsetup_main "${BASH_SOURCE:-$0}" | 54 android_envsetup_main "${BASH_SOURCE:-$0}" |
| 54 unset -f android_envsetup_main | 55 unset -f android_envsetup_main |
| 55 | 56 |
| 56 android_gyp() { | 57 android_gyp() { |
| 57 echo "Please call build/gyp_chromium instead. android_gyp is going away." | 58 echo "Please call build/gyp_chromium instead. android_gyp is going away." |
| 58 "${ENVSETUP_GYP_CHROME_SRC}/build/gyp_chromium" --depth="${ENVSETUP_GYP_CHROME
_SRC}" --check "$@" | 59 "${ENVSETUP_GYP_CHROME_SRC}/build/gyp_chromium" --depth="${ENVSETUP_GYP_CHROME
_SRC}" --check "$@" |
| 59 } | 60 } |
| OLD | NEW |