| 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 # TODO(thakis), Jan 18 2014: Remove this after two weeks or so, after telling |
| 123 # everyone to set use_goma in GYP_DEFINES instead of a GOMA_DIR env var. |
| 122 if [[ -d $GOMA_DIR ]]; then | 124 if [[ -d $GOMA_DIR ]]; then |
| 123 num_cores="$(grep --count ^processor /proc/cpuinfo)" | 125 DEFINES+=" use_goma=1 gomadir=$GOMA_DIR" |
| 124 # Goma is IO-ish you want more threads than you have cores. | |
| 125 let "goma_threads=num_cores*2" | |
| 126 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 | |
| 128 GOMA_COMPILER_PROXY_THREADS="${goma_threads}" | |
| 129 export GOMA_COMPILER_PROXY_THREADS | |
| 130 fi | |
| 131 fi | 126 fi |
| 132 | 127 |
| 133 # Declare Android are cross compile. | 128 # Declare Android are cross compile. |
| 134 export GYP_CROSSCOMPILE=1 | 129 export GYP_CROSSCOMPILE=1 |
| 135 | 130 |
| 136 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 131 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
| 137 android_gyp() { | 132 android_gyp() { |
| 138 # This is just a simple wrapper of gyp_chromium, please don't add anything | 133 # This is just a simple wrapper of gyp_chromium, please don't add anything |
| 139 # in this function. | 134 # in this function. |
| 140 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" | 135 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
| 141 ( | 136 ( |
| 142 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 137 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
| 143 ) | 138 ) |
| 144 } | 139 } |
| OLD | NEW |