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 | |
John Grabowski
2012/05/25 16:27:19
Sorry I didn't mention this the first time, but...
Wei James(wistoch)
2012/05/26 05:01:47
if we are in the correct directory and CHROME_SRC
John Grabowski
2012/05/29 17:50:23
OK... it's a little cryptic.
Can you add this comm
Wei James(wistoch)
2012/05/30 03:00:15
fixed. thanks
| |
100 # If current directory is not in $CHROME_SRC, it might be set for other | |
101 # source tree. | |
102 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ | |
103 the one you want." | |
104 echo "${CHROME_SRC}" | |
97 fi | 105 fi |
98 | 106 |
99 if [ ! -d "${CHROME_SRC}" ]; then | 107 if [ ! -d "${CHROME_SRC}" ]; then |
100 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 108 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
101 return 1 | 109 return 1 |
102 fi | 110 fi |
103 | 111 |
104 # Add Chromium Android development scripts to system path. | 112 # Add Chromium Android development scripts to system path. |
105 # Must be after CHROME_SRC is set. | 113 # Must be after CHROME_SRC is set. |
106 export PATH=$PATH:${CHROME_SRC}/build/android | 114 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}" | 152 export GYP_DEFINES="${DEFINES}" |
145 | 153 |
146 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 154 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
147 export GYP_GENERATORS="make-android" | 155 export GYP_GENERATORS="make-android" |
148 | 156 |
149 # Use our All target as the default | 157 # Use our All target as the default |
150 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 158 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
151 | 159 |
152 # We want to use our version of "all" targets. | 160 # We want to use our version of "all" targets. |
153 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 161 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |