OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
72 if [ -e "${PREBUILT_CCACHE_PATH}" ]; then | 72 if [ -e "${PREBUILT_CCACHE_PATH}" ]; then |
73 use_ccache_var="$PREBUILT_CCACHE_PATH " | 73 use_ccache_var="$PREBUILT_CCACHE_PATH " |
74 else | 74 else |
75 use_ccache_var="" | 75 use_ccache_var="" |
76 fi | 76 fi |
77 fi | 77 fi |
78 if [ -f "$PWD/build/android/envsetup.sh" ]; then | 78 # Only cross-compile if the build is being done either from Chromium's src/ |
| 79 # directory, or through WebKit, in which case the WEBKIT_ANDROID_BUILD |
| 80 # environment variable will be defined. WebKit uses a different directory. |
| 81 if [ -f "$PWD/build/android/envsetup.sh" ] || |
| 82 [ -n "${WEBKIT_ANDROID_BUILD}" ]; then |
79 CC="${use_ccache_var}${CROSS_CC}" CXX="${use_ccache_var}${CROSS_CXX}" \ | 83 CC="${use_ccache_var}${CROSS_CC}" CXX="${use_ccache_var}${CROSS_CXX}" \ |
80 LINK="${CROSS_LINK}" AR="${CROSS_AR}" RANLIB="${CROSS_RANLIB}" \ | 84 LINK="${CROSS_LINK}" AR="${CROSS_AR}" RANLIB="${CROSS_RANLIB}" \ |
81 command make $* | 85 command make $* |
82 else | 86 else |
83 command make $* | 87 command make $* |
84 fi | 88 fi |
85 } | 89 } |
86 | 90 |
87 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 91 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
88 android_gyp() { | 92 android_gyp() { |
(...skipping 17 matching lines...) Expand all Loading... |
106 DEFINES="OS=android" | 110 DEFINES="OS=android" |
107 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. | 111 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. |
108 DEFINES+=" host_os=${host_os}" | 112 DEFINES+=" host_os=${host_os}" |
109 DEFINES+=" linux_fpic=1" | 113 DEFINES+=" linux_fpic=1" |
110 DEFINES+=" release_optimize=s" | 114 DEFINES+=" release_optimize=s" |
111 DEFINES+=" linux_use_tcmalloc=0" | 115 DEFINES+=" linux_use_tcmalloc=0" |
112 DEFINES+=" disable_nacl=1" | 116 DEFINES+=" disable_nacl=1" |
113 DEFINES+=" remoting=0" | 117 DEFINES+=" remoting=0" |
114 DEFINES+=" p2p_apis=0" | 118 DEFINES+=" p2p_apis=0" |
115 DEFINES+=" enable_touch_events=1" | 119 DEFINES+=" enable_touch_events=1" |
| 120 DEFINES+=" build_ffmpegsumo=0" |
116 # TODO(bulach): use "shared_libraries" once the transition from executable | 121 # TODO(bulach): use "shared_libraries" once the transition from executable |
117 # is over. | 122 # is over. |
118 DEFINES+=" gtest_target_type=executable" | 123 DEFINES+=" gtest_target_type=executable" |
119 DEFINES+=" branding=Chromium" | 124 DEFINES+=" branding=Chromium" |
120 | 125 |
121 # If the TARGET_PRODUCT wasn't set, use 'full' by default. | 126 # If the TARGET_PRODUCT wasn't set, use 'full' by default. |
122 if [ -z "${TARGET_PRODUCT}" ]; then | 127 if [ -z "${TARGET_PRODUCT}" ]; then |
123 TARGET_PRODUCT="full" | 128 TARGET_PRODUCT="full" |
124 fi | 129 fi |
125 | 130 |
(...skipping 12 matching lines...) Expand all Loading... |
138 return 1 | 143 return 1 |
139 esac | 144 esac |
140 | 145 |
141 export GYP_DEFINES="${DEFINES}" | 146 export GYP_DEFINES="${DEFINES}" |
142 | 147 |
143 # 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. |
144 export GYP_GENERATORS="make-android" | 149 export GYP_GENERATORS="make-android" |
145 | 150 |
146 # We want to use our version of "all" targets. | 151 # We want to use our version of "all" targets. |
147 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 152 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |