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 |
11 # to Android NDK's root path. | 11 # to Android NDK's root path. |
12 # | 12 # |
13 # TODO(michaelbai): Develop a standard for NDK/SDK integration. | |
14 # | |
15 # If current path isn't the Chrome's src directory, CHROME_SRC must be set | 13 # If current path isn't the Chrome's src directory, CHROME_SRC must be set |
16 # to the Chrome's src directory. | 14 # to the Chrome's src directory. |
17 | 15 |
18 if [ ! -d "${ANDROID_NDK_ROOT}" ]; then | 16 if [[ -z $ANDROID_NDK_ROOT || -z $ANDROID_SDK_ROOT \ |
John Grabowski
2012/07/17 18:38:15
If you don't quote these, then you will get the OP
Isaac (away)
2012/07/18 09:45:05
I thought quotes were unnecessary in double bracke
John Grabowski
2012/07/18 20:48:43
You tell me. Run the script below for a hint.
#
| |
19 echo "ANDROID_NDK_ROOT must be set to the path of Android NDK, Revision 6b." \ | 17 || ! -d $ANDROID_NDK_ROOT || ! -d $ANDROID_SDK_ROOT ]]; then |
20 >& 2 | 18 echo "SDK / NDK paths not set or not installed." >&2 |
21 echo "which could be installed by" >& 2 | 19 echo "To install: set ANDROID_SDK_ROOT and ANDROID_NDK_ROOT and run" >&2 |
22 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 | 20 echo "<chromium>/build/install_android_sdk_ndk.py" >&2 |
23 return 1 | 21 return 1 |
24 fi | 22 fi |
25 | 23 |
26 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then | |
27 echo "ANDROID_SDK_ROOT must be set to the path of Android SDK, Android 3.2." \ | |
28 >& 2 | |
29 echo "which could be installed by" >& 2 | |
30 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 | |
31 return 1 | |
32 fi | |
33 | |
34 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') | 24 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') |
35 | 25 |
36 case "${host_os}" in | 26 case "${host_os}" in |
37 "linux") | 27 "linux") |
38 toolchain_dir="linux-x86" | 28 toolchain_dir="linux-x86" |
39 ;; | 29 ;; |
40 "mac") | 30 "mac") |
41 toolchain_dir="darwin-x86" | 31 toolchain_dir="darwin-x86" |
42 ;; | 32 ;; |
43 *) | 33 *) |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 export GYP_DEFINES="${DEFINES}" | 148 export GYP_DEFINES="${DEFINES}" |
159 | 149 |
160 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 150 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
161 export GYP_GENERATORS="make-android" | 151 export GYP_GENERATORS="make-android" |
162 | 152 |
163 # Use our All target as the default | 153 # Use our All target as the default |
164 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 154 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
165 | 155 |
166 # We want to use our version of "all" targets. | 156 # We want to use our version of "all" targets. |
167 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 157 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |