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 # Source functions script. The file is in the same directory as this script. | |
16 SCRIPT_DIR="$(dirname "${BASH_SOURCE:-$0}")" | 15 SCRIPT_DIR="$(dirname "${BASH_SOURCE:-$0}")" |
17 | 16 |
18 # Get host architecture, and abort if it is 32-bit. | 17 # Get host architecture, and abort if it is 32-bit. |
19 host_arch=$(uname -m) | 18 host_arch=$(uname -m) |
20 case "${host_arch}" in | 19 case "${host_arch}" in |
21 x86_64) # pass | 20 x86_64) # pass |
22 ;; | 21 ;; |
23 i?86) | 22 i?86) |
24 echo "ERROR: Android build requires a 64-bit host build machine." | 23 echo "ERROR: Android build requires a 64-bit host build machine." |
25 return 1 | 24 return 1 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 fi | 56 fi |
58 | 57 |
59 # Add Android SDK tools to system path. | 58 # Add Android SDK tools to system path. |
60 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools | 59 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools |
61 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools | 60 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools |
62 | 61 |
63 # Add Chromium Android development scripts to system path. | 62 # Add Chromium Android development scripts to system path. |
64 # Must be after CHROME_SRC is set. | 63 # Must be after CHROME_SRC is set. |
65 export PATH=$PATH:${CHROME_SRC}/build/android | 64 export PATH=$PATH:${CHROME_SRC}/build/android |
66 | 65 |
67 # The set of GYP_DEFINES to pass to gyp. | |
68 DEFINES="OS=android" | |
69 | |
70 if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then | 66 if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then |
71 # These defines are used by various chrome build scripts to tag the binary's | 67 # These defines are used by various chrome build scripts to tag the binary's |
72 # version string as 'official' in linux builds (e.g. in | 68 # version string as 'official' in linux builds (e.g. in |
73 # chrome/trunk/src/chrome/tools/build/version.py). | 69 # chrome/trunk/src/chrome/tools/build/version.py). |
74 export OFFICIAL_BUILD=1 | 70 export OFFICIAL_BUILD=1 |
75 export CHROMIUM_BUILD="_google_chrome" | 71 export CHROMIUM_BUILD="_google_chrome" |
76 export CHROME_BUILD_TYPE="_official" | 72 export CHROME_BUILD_TYPE="_official" |
77 fi | 73 fi |
78 | 74 |
79 # TODO(thakis), Jan 18 2014: Remove this after two weeks or so, after telling | |
80 # everyone to set use_goma in GYP_DEFINES instead of a GOMA_DIR env var. | |
81 if [[ -d $GOMA_DIR ]]; then | |
82 DEFINES+=" use_goma=1 gomadir=$GOMA_DIR" | |
83 fi | |
84 | |
85 export GYP_DEFINES="${DEFINES}" | |
86 | |
87 # Source a bunch of helper functions | 75 # Source a bunch of helper functions |
88 . ${CHROME_SRC}/build/android/adb_device_functions.sh | 76 . ${CHROME_SRC}/build/android/adb_device_functions.sh |
89 | 77 |
90 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 78 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
91 android_gyp() { | 79 android_gyp() { |
92 # This is just a simple wrapper of gyp_chromium, please don't add anything | 80 # This is just a simple wrapper of gyp_chromium, please don't add anything |
93 # in this function. | 81 # in this function. |
94 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 82 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
95 } | 83 } |
OLD | NEW |