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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 # define a special variable for bringup purposes. | 66 # define a special variable for bringup purposes. |
67 case "${ANDROID_BUILD_TOP-undefined}" in | 67 case "${ANDROID_BUILD_TOP-undefined}" in |
68 "undefined") | 68 "undefined") |
69 DEFINES+=" android_upstream_bringup=1" | 69 DEFINES+=" android_upstream_bringup=1" |
70 ;; | 70 ;; |
71 esac | 71 esac |
72 | 72 |
73 toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}/prebuilt/" | 73 toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}/prebuilt/" |
74 export ANDROID_TOOLCHAIN="${toolchain_path}/${toolchain_dir}/bin/" | 74 export ANDROID_TOOLCHAIN="${toolchain_path}/${toolchain_dir}/bin/" |
75 | 75 |
| 76 if [ ! -d "${ANDROID_TOOLCHAIN}" ]; then |
| 77 echo "Can not find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2 |
| 78 echo "The NDK version might be wrong." >& 2 |
| 79 return 1 |
| 80 fi |
| 81 |
76 export ANDROID_SDK_VERSION="15" | 82 export ANDROID_SDK_VERSION="15" |
77 | 83 |
78 # Needed by android antfiles when creating apks. | 84 # Needed by android antfiles when creating apks. |
79 export ANDROID_SDK_HOME=${ANDROID_SDK_ROOT} | 85 export ANDROID_SDK_HOME=${ANDROID_SDK_ROOT} |
80 | 86 |
81 # Add Android SDK/NDK tools to system path. | 87 # Add Android SDK/NDK tools to system path. |
82 export PATH=$PATH:${ANDROID_NDK_ROOT} | 88 export PATH=$PATH:${ANDROID_NDK_ROOT} |
83 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools | 89 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools |
84 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools | 90 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools |
85 | 91 # Must have tools like arm-linux-androideabi-gcc on the path for ninja |
86 if [ ! -d "${ANDROID_TOOLCHAIN}" ]; then | 92 export PATH=$PATH:${ANDROID_TOOLCHAIN} |
87 echo "Can not find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2 | |
88 echo "The NDK version might be wrong." >& 2 | |
89 return 1 | |
90 fi | |
91 | 93 |
92 if [ -z "${CHROME_SRC}" ]; then | 94 if [ -z "${CHROME_SRC}" ]; then |
93 # 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. |
94 export CHROME_SRC=$(readlink -f .) | 96 export CHROME_SRC=$(readlink -f .) |
95 fi | 97 fi |
96 | 98 |
97 if [ ! -d "${CHROME_SRC}" ]; then | 99 if [ ! -d "${CHROME_SRC}" ]; then |
98 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 100 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
99 return 1 | 101 return 1 |
100 fi | 102 fi |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 export GYP_DEFINES="${DEFINES}" | 144 export GYP_DEFINES="${DEFINES}" |
143 | 145 |
144 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 146 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
145 export GYP_GENERATORS="make-android" | 147 export GYP_GENERATORS="make-android" |
146 | 148 |
147 # Use our All target as the default | 149 # Use our All target as the default |
148 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 150 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
149 | 151 |
150 # We want to use our version of "all" targets. | 152 # We want to use our version of "all" targets. |
151 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 153 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |