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. Only Android NDK, | 7 # Sets up environment for building Chromium on Android. Only Android NDK, |
8 # Revision 6b on Linux or Mac is offically supported. | 8 # Revision 6b on Linux or Mac is offically supported. |
9 # | 9 # |
10 # To run this script, the system environment ANDROID_NDK_ROOT must be set | 10 # To run this script, the system environment ANDROID_NDK_ROOT must be set |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 # Add Android SDK/NDK tools to system path. | 87 # Add Android SDK/NDK tools to system path. |
88 export PATH=$PATH:${ANDROID_NDK_ROOT} | 88 export PATH=$PATH:${ANDROID_NDK_ROOT} |
89 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools | 89 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools |
90 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools | 90 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools |
91 # Must have tools like arm-linux-androideabi-gcc on the path for ninja | 91 # Must have tools like arm-linux-androideabi-gcc on the path for ninja |
92 export PATH=$PATH:${ANDROID_TOOLCHAIN} | 92 export PATH=$PATH:${ANDROID_TOOLCHAIN} |
93 | 93 |
94 if [ -z "${CHROME_SRC}" ]; then | 94 if [ -z "${CHROME_SRC}" ]; then |
95 # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. | 95 # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. |
96 export CHROME_SRC=$(readlink -f .) | 96 export CHROME_SRC="${PWD}" |
| 97 fi |
| 98 |
| 99 if [ "${PWD/"${CHROME_SRC}"/}" == "${PWD}" ]; then |
| 100 # If current directory is not in $CHROME_SRC, it might be set for other |
| 101 # source tree. If $CHROME_SRC was set correctly and we are in the correct |
| 102 # directory, "${PWD/"${CHROME_SRC}"/}" will be "". |
| 103 # Otherwise, it will equal to "${PWD}" |
| 104 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ |
| 105 the one you want." |
| 106 echo "${CHROME_SRC}" |
97 fi | 107 fi |
98 | 108 |
99 if [ ! -d "${CHROME_SRC}" ]; then | 109 if [ ! -d "${CHROME_SRC}" ]; then |
100 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 110 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
101 return 1 | 111 return 1 |
102 fi | 112 fi |
103 | 113 |
104 # Add Chromium Android development scripts to system path. | 114 # Add Chromium Android development scripts to system path. |
105 # Must be after CHROME_SRC is set. | 115 # Must be after CHROME_SRC is set. |
106 export PATH=$PATH:${CHROME_SRC}/build/android | 116 export PATH=$PATH:${CHROME_SRC}/build/android |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 export GYP_DEFINES="${DEFINES}" | 154 export GYP_DEFINES="${DEFINES}" |
145 | 155 |
146 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 156 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
147 export GYP_GENERATORS="make-android" | 157 export GYP_GENERATORS="make-android" |
148 | 158 |
149 # Use our All target as the default | 159 # Use our All target as the default |
150 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 160 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
151 | 161 |
152 # We want to use our version of "all" targets. | 162 # We want to use our version of "all" targets. |
153 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 163 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |