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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 # Add Android SDK's platform-tools to system path. | 50 # Add Android SDK's platform-tools to system path. |
51 export PATH="${PATH}:${ANDROID_SDK_ROOT}/platform-tools/" | 51 export PATH="${PATH}:${ANDROID_SDK_ROOT}/platform-tools/" |
52 | 52 |
53 if [ ! -d "${ANDROID_TOOLCHAIN}" ]; then | 53 if [ ! -d "${ANDROID_TOOLCHAIN}" ]; then |
54 echo "Can not find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2 | 54 echo "Can not find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2 |
55 echo "The NDK version might be wrong." >& 2 | 55 echo "The NDK version might be wrong." >& 2 |
56 return 1 | 56 return 1 |
57 fi | 57 fi |
58 | 58 |
59 if [ -z "${CHROME_SRC}" ]; then | 59 if [ -z "${CHROME_SRC}" ]; then |
60 # if $CHROME_SRC was not set, assume current directory is CHROME_SRC. | 60 # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. |
61 export CHROME_SRC=$(pwd) | 61 export CHROME_SRC=$(readlink -f .) |
62 fi | 62 fi |
63 | 63 |
64 if [ ! -d "${CHROME_SRC}" ]; then | 64 if [ ! -d "${CHROME_SRC}" ]; then |
65 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 65 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
66 return 1 | 66 return 1 |
67 fi | 67 fi |
68 | 68 |
69 make() { | 69 make() { |
70 # TODO(michaelbai): how to use ccache in NDK. | 70 # TODO(michaelbai): how to use ccache in NDK. |
71 if [ -n "${USE_CCACHE}" ]; then | 71 if [ -n "${USE_CCACHE}" ]; then |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 export GYP_DEFINES="${DEFINES}" | 146 export GYP_DEFINES="${DEFINES}" |
147 | 147 |
148 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 148 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
149 export GYP_GENERATORS="make-android" | 149 export GYP_GENERATORS="make-android" |
150 | 150 |
151 # Use our All target as the default | 151 # Use our All target as the default |
152 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 152 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
153 | 153 |
154 # We want to use our version of "all" targets. | 154 # We want to use our version of "all" targets. |
155 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 155 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |