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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 fi | 121 fi |
122 export ANDROID_GOMA_WRAPPER | 122 export ANDROID_GOMA_WRAPPER |
123 | 123 |
124 export CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) | 124 export CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) |
125 export CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) | 125 export CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) |
126 export LINK_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) | 126 export LINK_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) |
127 export AR_target=$(basename ${ANDROID_TOOLCHAIN}/*-ar) | 127 export AR_target=$(basename ${ANDROID_TOOLCHAIN}/*-ar) |
128 | 128 |
129 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 129 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
130 android_gyp() { | 130 android_gyp() { |
| 131 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
131 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" "$@" | 132 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" "$@" |
132 } | 133 } |
133 | 134 |
134 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) | 135 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) |
135 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) | 136 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) |
136 | 137 |
137 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories | 138 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories |
138 # to canonicalize them (remove double '/', remove trailing '/', etc). | 139 # to canonicalize them (remove double '/', remove trailing '/', etc). |
139 DEFINES+=" OS=android" | 140 DEFINES+=" OS=android" |
140 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. | 141 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. |
141 DEFINES+=" host_os=${host_os}" | 142 DEFINES+=" host_os=${host_os}" |
142 DEFINES+=" linux_fpic=1" | 143 DEFINES+=" linux_fpic=1" |
143 DEFINES+=" release_optimize=s" | 144 DEFINES+=" release_optimize=s" |
144 DEFINES+=" linux_use_tcmalloc=0" | 145 DEFINES+=" linux_use_tcmalloc=0" |
145 DEFINES+=" disable_nacl=1" | 146 DEFINES+=" disable_nacl=1" |
146 DEFINES+=" remoting=0" | 147 DEFINES+=" remoting=0" |
147 DEFINES+=" p2p_apis=0" | 148 DEFINES+=" p2p_apis=0" |
148 DEFINES+=" enable_touch_events=1" | 149 DEFINES+=" enable_touch_events=1" |
149 DEFINES+=" build_ffmpegsumo=0" | 150 DEFINES+=" build_ffmpegsumo=0" |
150 # TODO(bulach): use "shared_libraries" once the transition from executable | 151 # TODO(bulach): use "shared_library" once the transition from executable |
151 # is over. | 152 # is over. |
152 DEFINES+=" gtest_target_type=executable" | 153 DEFINES+=" gtest_target_type=executable" |
153 DEFINES+=" branding=Chromium" | 154 DEFINES+=" branding=Chromium" |
154 | 155 |
155 export GYP_DEFINES="${DEFINES}" | 156 export GYP_DEFINES="${DEFINES}" |
156 | 157 |
157 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 158 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
158 export GYP_GENERATORS="make-android" | 159 export GYP_GENERATORS="make-android" |
159 | 160 |
160 # Use our All target as the default | 161 # Use our All target as the default |
161 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 162 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
162 | 163 |
163 # We want to use our version of "all" targets. | 164 # We want to use our version of "all" targets. |
164 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 165 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |