Chromium Code Reviews| 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 # Defines functions for envsetup.sh which sets up environment for building | 7 # Defines functions for envsetup.sh which sets up environment for building |
| 8 # Chromium on Android. The build can be either use the Android NDK/SDK or | 8 # Chromium on Android. The build can be either use the Android NDK/SDK or |
| 9 # android source tree. Each has a unique init function which calls functions | 9 # android source tree. Each has a unique init function which calls functions |
| 10 # prefixed with "common_" that is common for both environment setups. | 10 # prefixed with "common_" that is common for both environment setups. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 export CHROME_VERSION_EXTRA="beta" | 81 export CHROME_VERSION_EXTRA="beta" |
| 82 fi | 82 fi |
| 83 | 83 |
| 84 # The order file specifies the order of symbols in the .text section of the | 84 # The order file specifies the order of symbols in the .text section of the |
| 85 # shared library, libchromeview.so. The file is an order list of section | 85 # shared library, libchromeview.so. The file is an order list of section |
| 86 # names and the library is linked with option | 86 # names and the library is linked with option |
| 87 # --section-ordering-file=<orderfile>. The order file is updated by profiling | 87 # --section-ordering-file=<orderfile>. The order file is updated by profiling |
| 88 # startup after compiling with the order_profiling=1 GYP_DEFINES flag. | 88 # startup after compiling with the order_profiling=1 GYP_DEFINES flag. |
| 89 ORDER_DEFINES="order_text_section=${CHROME_SRC}/orderfiles/orderfile.out" | 89 ORDER_DEFINES="order_text_section=${CHROME_SRC}/orderfiles/orderfile.out" |
| 90 | 90 |
| 91 # The following defines will affect ARM code generation of both C/C++ compiler | 91 # Target architecture to be used. Should be overridden for x86 builds. |
| 92 # and V8 mksnapshot. | 92 local target_ach="arm" |
| 93 | |
| 94 # The following defines will affect platform-specific code generation of both | |
| 95 # the C/C++ compiler and V8 mksnapshot. | |
| 93 case "${TARGET_PRODUCT}" in | 96 case "${TARGET_PRODUCT}" in |
| 94 "passion"|"soju"|"sojua"|"sojus"|"yakju"|"mysid"|"nakasi") | 97 "passion"|"soju"|"sojua"|"sojus"|"yakju"|"mysid"|"nakasi") |
| 95 DEFINES+=" target_arch=arm" | 98 DEFINES+=" target_arch=arm" |
|
michaelbai
2012/08/30 16:38:40
We also need to get ride of the duplicated target_
Peter Beverloo
2012/08/30 20:17:24
It's a nice-to-have, but by no means required. I d
| |
| 96 DEFINES+=" arm_neon=1 armv7=1 arm_thumb=1" | 99 DEFINES+=" arm_neon=1 armv7=1 arm_thumb=1" |
| 97 DEFINES+=" ${ORDER_DEFINES}" | 100 DEFINES+=" ${ORDER_DEFINES}" |
| 98 ;; | 101 ;; |
| 99 "trygon"|"tervigon") | 102 "trygon"|"tervigon") |
| 100 DEFINES+=" target_arch=arm" | 103 DEFINES+=" target_arch=arm" |
| 101 DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16" | 104 DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16" |
| 102 DEFINES+=" ${ORDER_DEFINES}" | 105 DEFINES+=" ${ORDER_DEFINES}" |
| 103 ;; | 106 ;; |
| 104 "full") | 107 "full") |
| 105 DEFINES+=" target_arch=arm" | 108 DEFINES+=" target_arch=arm" |
| 106 DEFINES+=" arm_neon=0 armv7=0 arm_thumb=1 arm_fpu=vfp" | 109 DEFINES+=" arm_neon=0 armv7=0 arm_thumb=1 arm_fpu=vfp" |
| 107 ;; | 110 ;; |
| 108 *x86*) | 111 *x86*) |
| 109 # TODO(tedbo): The ia32 build fails on ffmpeg, so we disable it here. | 112 # TODO(tedbo): The ia32 build fails on ffmpeg, so we disable it here. |
| 110 DEFINES+=" target_arch=ia32 use_libffmpeg=0" | 113 DEFINES+=" target_arch=ia32 use_libffmpeg=0" |
| 111 | 114 |
| 112 host_arch=$(uname -m | sed -e \ | 115 host_arch=$(uname -m | sed -e \ |
| 113 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/') | 116 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/') |
| 114 DEFINES+=" host_arch=${host_arch}" | 117 DEFINES+=" host_arch=${host_arch}" |
| 118 target_arch="ia32" | |
| 115 ;; | 119 ;; |
| 116 *) | 120 *) |
| 117 echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2 | 121 echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2 |
| 118 return 1 | 122 return 1 |
| 119 esac | 123 esac |
| 124 | |
| 125 DEFINES+=" android_gdbserver=${ANDROID_NDK_ROOT}/prebuilt/\ | |
| 126 android-${target_arch}/gdbserver/gdbserver" | |
|
michaelbai
2012/08/30 16:38:40
For x86 case,
We need set
target_arch=ia32
andro
Peter Beverloo
2012/08/30 20:17:24
line 118 should read "target_arch="x86"".
| |
| 120 } | 127 } |
| 121 | 128 |
| 122 | 129 |
| 123 ################################################################################ | 130 ################################################################################ |
| 124 # Exports common GYP variables based on variable DEFINES and CHROME_SRC. | 131 # Exports common GYP variables based on variable DEFINES and CHROME_SRC. |
| 125 ################################################################################ | 132 ################################################################################ |
| 126 common_gyp_vars() { | 133 common_gyp_vars() { |
| 127 export GYP_DEFINES="${DEFINES}" | 134 export GYP_DEFINES="${DEFINES}" |
| 128 | 135 |
| 129 # Set GYP_GENERATORS to make-android if it's currently unset or null. | 136 # Set GYP_GENERATORS to make-android if it's currently unset or null. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 | 297 |
| 291 export GYP_GENERATORS="android" | 298 export GYP_GENERATORS="android" |
| 292 | 299 |
| 293 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 300 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
| 294 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 301 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
| 295 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 302 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
| 296 | 303 |
| 297 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. | 304 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. |
| 298 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" | 305 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" |
| 299 } | 306 } |
| OLD | NEW |