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 if [ -z "${CHROME_SRC}" ]; then | 66 if [ -z "${CHROME_SRC}" ]; then |
67 # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. | 67 # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. |
68 export CHROME_SRC=$(readlink -f .) | 68 export CHROME_SRC=$(readlink -f .) |
69 fi | 69 fi |
70 | 70 |
71 if [ ! -d "${CHROME_SRC}" ]; then | 71 if [ ! -d "${CHROME_SRC}" ]; then |
72 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 72 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
73 return 1 | 73 return 1 |
74 fi | 74 fi |
75 | 75 |
| 76 # Add Chromium Android development scripts to system path. |
| 77 # Must be after CHROME_SRC is set. |
| 78 export PATH=$PATH:${CHROME_SRC}/build/android |
| 79 |
76 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 80 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
77 android_gyp() { | 81 android_gyp() { |
78 GOMA_WRAPPER="" | 82 GOMA_WRAPPER="" |
79 if [[ -d $GOMA_DIR ]]; then | 83 if [[ -d $GOMA_DIR ]]; then |
80 GOMA_WRAPPER="$GOMA_DIR/gomacc" | 84 GOMA_WRAPPER="$GOMA_DIR/gomacc" |
81 fi | 85 fi |
82 # Ninja requires "*_target" for target builds. | 86 # Ninja requires "*_target" for target builds. |
83 GOMA_WRAPPER=${GOMA_WRAPPER} \ | 87 GOMA_WRAPPER=${GOMA_WRAPPER} \ |
84 CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) \ | 88 CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) \ |
85 CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) \ | 89 CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) \ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 export GYP_DEFINES="${DEFINES}" | 136 export GYP_DEFINES="${DEFINES}" |
133 | 137 |
134 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 138 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
135 export GYP_GENERATORS="make-android" | 139 export GYP_GENERATORS="make-android" |
136 | 140 |
137 # Use our All target as the default | 141 # Use our All target as the default |
138 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 142 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
139 | 143 |
140 # We want to use our version of "all" targets. | 144 # We want to use our version of "all" targets. |
141 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 145 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |