| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 # The following defines will affect ARM code generation of both C/C++ compiler |
| 92 # and V8 mksnapshot. | 92 # and V8 mksnapshot. |
| 93 case "${TARGET_PRODUCT}" in | 93 case "${TARGET_PRODUCT}" in |
| 94 "passion"|"soju"|"sojua"|"sojus"|"yakju"|"mysid"|"nakasi") | 94 "passion"|"soju"|"sojua"|"sojus"|"yakju"|"mysid"|"nakasi") |
| 95 DEFINES+=" target_arch=arm" | |
| 96 DEFINES+=" arm_neon=1 armv7=1 arm_thumb=1" | 95 DEFINES+=" arm_neon=1 armv7=1 arm_thumb=1" |
| 97 DEFINES+=" ${ORDER_DEFINES}" | 96 DEFINES+=" ${ORDER_DEFINES}" |
| 97 TARGET_ARCH="arm" |
| 98 ;; | 98 ;; |
| 99 "trygon"|"tervigon") | 99 "trygon"|"tervigon") |
| 100 DEFINES+=" target_arch=arm" | |
| 101 DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16" | 100 DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16" |
| 102 DEFINES+=" ${ORDER_DEFINES}" | 101 DEFINES+=" ${ORDER_DEFINES}" |
| 102 TARGET_ARCH="arm" |
| 103 ;; | 103 ;; |
| 104 "full") | 104 "full") |
| 105 DEFINES+=" target_arch=arm" | |
| 106 DEFINES+=" arm_neon=0 armv7=0 arm_thumb=1 arm_fpu=vfp" | 105 DEFINES+=" arm_neon=0 armv7=0 arm_thumb=1 arm_fpu=vfp" |
| 106 TARGET_ARCH="arm" |
| 107 ;; | 107 ;; |
| 108 *x86*) | 108 *x86*) |
| 109 # TODO(tedbo): The ia32 build fails on ffmpeg, so we disable it here. | 109 # TODO(tedbo): The ia32 build fails on ffmpeg, so we disable it here. |
| 110 DEFINES+=" target_arch=ia32 use_libffmpeg=0" | 110 DEFINES+=" use_libffmpeg=0" |
| 111 | 111 |
| 112 host_arch=$(uname -m | sed -e \ | 112 host_arch=$(uname -m | sed -e \ |
| 113 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/') | 113 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/') |
| 114 DEFINES+=" host_arch=${host_arch}" | 114 DEFINES+=" host_arch=${host_arch}" |
| 115 TARGET_ARCH="x86" |
| 115 ;; | 116 ;; |
| 116 *) | 117 *) |
| 117 echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2 | 118 echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2 |
| 118 return 1 | 119 return 1 |
| 119 esac | 120 esac |
| 121 |
| 122 case "${TARGET_ARCH}" in |
| 123 "arm") |
| 124 DEFINES+=" target_arch=arm" |
| 125 ;; |
| 126 "x86") |
| 127 DEFINES+=" target_arch=ia32" |
| 128 ;; |
| 129 *) |
| 130 echo "TARGET_ARCH: ${TARGET_ARCH} is not supported." >& 2 |
| 131 return 1 |
| 132 esac |
| 133 |
| 134 DEFINES+=" android_gdbserver=${ANDROID_NDK_ROOT}/prebuilt/\ |
| 135 android-${TARGET_ARCH}/gdbserver/gdbserver" |
| 120 } | 136 } |
| 121 | 137 |
| 122 | 138 |
| 123 ################################################################################ | 139 ################################################################################ |
| 124 # Exports common GYP variables based on variable DEFINES and CHROME_SRC. | 140 # Exports common GYP variables based on variable DEFINES and CHROME_SRC. |
| 125 ################################################################################ | 141 ################################################################################ |
| 126 common_gyp_vars() { | 142 common_gyp_vars() { |
| 127 export GYP_DEFINES="${DEFINES}" | 143 export GYP_DEFINES="${DEFINES}" |
| 128 | 144 |
| 129 # Set GYP_GENERATORS to make-android if it's currently unset or null. | 145 # 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 | 306 |
| 291 export GYP_GENERATORS="android" | 307 export GYP_GENERATORS="android" |
| 292 | 308 |
| 293 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 309 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
| 294 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 310 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
| 295 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 311 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
| 296 | 312 |
| 297 # TODO(torne): This isn't upstream yet. Upstream it or remove this setting. | 313 # 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" | 314 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android_webview.gyp" |
| 299 } | 315 } |
| OLD | NEW |