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. | 13 # TODO(michaelbai): Develop a standard for NDK/SDK integration. |
14 # | 14 # |
15 # If current path isn't the Chrome's src directory, CHROME_SRC must be set | 15 # If current path isn't the Chrome's src directory, CHROME_SRC must be set |
16 # to the Chrome's src directory. | 16 # to the Chrome's src directory. |
17 | 17 |
18 if [ ! -d "${ANDROID_NDK_ROOT}" ]; then | 18 if [ ! -d "${ANDROID_NDK_ROOT}" ]; then |
19 echo "ANDROID_NDK_ROOT must be set to the path of Android NDK, Revision 6b." \ | 19 echo "ANDROID_NDK_ROOT must be set to the path of Android NDK, Revision 6b." \ |
20 >& 2 | 20 >& 2 |
21 echo "which could be installed by" >& 2 | 21 echo "which could be installed by" >& 2 |
22 echo "<chromium_tree>/src/build/install-build-deps-android.sh" >& 2 | 22 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 |
23 return 1 | 23 return 1 |
24 fi | 24 fi |
25 | 25 |
26 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then | 26 if [ ! -d "${ANDROID_SDK_ROOT}" ]; then |
27 echo "ANDROID_SDK_ROOT must be set to the path of Android SDK, Android 3.2." \ | 27 echo "ANDROID_SDK_ROOT must be set to the path of Android SDK, Android 3.2." \ |
28 >& 2 | 28 >& 2 |
29 echo "which could be installed by" >& 2 | 29 echo "which could be installed by" >& 2 |
30 echo "<chromium_tree>/src/build/install-build-deps-android.sh" >& 2 | 30 echo "<chromium_tree>/src/build/install-build-deps-android-sdk.sh" >& 2 |
31 return 1 | 31 return 1 |
32 fi | 32 fi |
33 | 33 |
34 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') | 34 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') |
35 | 35 |
36 case "${host_os}" in | 36 case "${host_os}" in |
37 "linux") | 37 "linux") |
38 toolchain_dir="linux-x86" | 38 toolchain_dir="linux-x86" |
39 ;; | 39 ;; |
40 "mac") | 40 "mac") |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 export GYP_DEFINES="${DEFINES}" | 124 export GYP_DEFINES="${DEFINES}" |
125 | 125 |
126 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 126 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
127 export GYP_GENERATORS="make-android" | 127 export GYP_GENERATORS="make-android" |
128 | 128 |
129 # Use our All target as the default | 129 # Use our All target as the default |
130 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 130 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
131 | 131 |
132 # We want to use our version of "all" targets. | 132 # We want to use our version of "all" targets. |
133 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 133 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |