OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Sets up environment for building Chromium on Android. It can either be | 6 # Sets up environment for building Chromium on Android. It can either be |
7 # compiled with the Android tree or using the Android SDK/NDK. To build with | 7 # compiled with the Android tree or using the Android SDK/NDK. To build with |
8 # NDK/SDK: ". build/android/envsetup.sh". Environment variable | 8 # NDK/SDK: ". build/android/envsetup.sh". Environment variable |
9 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to | 9 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to |
10 # specifiy build type. | 10 # specifiy build type. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 if [[ -n "$CHROME_ANDROID_VALGRIND_BUILD" ]]; then | 112 if [[ -n "$CHROME_ANDROID_VALGRIND_BUILD" ]]; then |
113 # arm_thumb=0 is a workaround for https://bugs.kde.org/show_bug.cgi?id=270709 | 113 # arm_thumb=0 is a workaround for https://bugs.kde.org/show_bug.cgi?id=270709 |
114 DEFINES+=" arm_thumb=0 release_extra_cflags='-fno-inline\ | 114 DEFINES+=" arm_thumb=0 release_extra_cflags='-fno-inline\ |
115 -fno-omit-frame-pointer -fno-builtin' release_valgrind_build=1\ | 115 -fno-omit-frame-pointer -fno-builtin' release_valgrind_build=1\ |
116 release_optimize=1" | 116 release_optimize=1" |
117 fi | 117 fi |
118 | 118 |
119 # Source a bunch of helper functions | 119 # Source a bunch of helper functions |
120 . ${CHROME_SRC}/build/android/adb_device_functions.sh | 120 . ${CHROME_SRC}/build/android/adb_device_functions.sh |
121 | 121 |
| 122 ANDROID_GOMA_WRAPPER="" |
122 if [[ -d $GOMA_DIR ]]; then | 123 if [[ -d $GOMA_DIR ]]; then |
| 124 ANDROID_GOMA_WRAPPER="$GOMA_DIR/gomacc" |
123 num_cores="$(grep --count ^processor /proc/cpuinfo)" | 125 num_cores="$(grep --count ^processor /proc/cpuinfo)" |
124 # Goma is IO-ish you want more threads than you have cores. | 126 # Goma is IO-ish you want more threads than you have cores. |
125 let "goma_threads=num_cores*2" | 127 let "goma_threads=num_cores*2" |
126 if [ -z "${GOMA_COMPILER_PROXY_THREADS}" -a "${goma_threads}" -gt 16 ]; then | 128 if [ -z "${GOMA_COMPILER_PROXY_THREADS}" -a "${goma_threads}" -gt 16 ]; then |
127 # The default is 16 threads, if the machine has many cores we crank it up a bit | 129 # The default is 16 threads, if the machine has many cores we crank it up a bit |
128 GOMA_COMPILER_PROXY_THREADS="${goma_threads}" | 130 GOMA_COMPILER_PROXY_THREADS="${goma_threads}" |
129 export GOMA_COMPILER_PROXY_THREADS | 131 export GOMA_COMPILER_PROXY_THREADS |
130 fi | 132 fi |
131 fi | 133 fi |
| 134 export ANDROID_GOMA_WRAPPER |
132 | 135 |
133 # Declare Android are cross compile. | 136 # Declare Android are cross compile. |
134 export GYP_CROSSCOMPILE=1 | 137 export GYP_CROSSCOMPILE=1 |
135 | 138 |
136 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 139 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
137 android_gyp() { | 140 android_gyp() { |
138 # This is just a simple wrapper of gyp_chromium, please don't add anything | 141 # This is just a simple wrapper of gyp_chromium, please don't add anything |
139 # in this function. | 142 # in this function. |
140 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" | 143 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
141 ( | 144 ( |
142 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 145 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
143 ) | 146 ) |
144 } | 147 } |
145 | 148 |
146 # FLOCK needs to be null on system that has no flock | 149 # FLOCK needs to be null on system that has no flock |
147 which flock > /dev/null || export FLOCK= | 150 which flock > /dev/null || export FLOCK= |
OLD | NEW |