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 15 matching lines...) Expand all Loading... |
26 ################################################################################ | 26 ################################################################################ |
27 common_vars_defines() { | 27 common_vars_defines() { |
28 | 28 |
29 # Set toolchain path according to product architecture. | 29 # Set toolchain path according to product architecture. |
30 toolchain_arch="arm-linux-androideabi" | 30 toolchain_arch="arm-linux-androideabi" |
31 if [[ "${TARGET_PRODUCT}" =~ .*x86.* ]]; then | 31 if [[ "${TARGET_PRODUCT}" =~ .*x86.* ]]; then |
32 toolchain_arch="x86" | 32 toolchain_arch="x86" |
33 fi | 33 fi |
34 | 34 |
35 toolchain_version="4.6" | 35 toolchain_version="4.6" |
| 36 # We directly set the gcc_version since we know what we use, and it should |
| 37 # be set to xx instead of x.x. Refer the output of compiler_version.py. |
| 38 gcc_version="46" |
36 toolchain_target=$(basename \ | 39 toolchain_target=$(basename \ |
37 ${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}-${toolchain_version}) | 40 ${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}-${toolchain_version}) |
38 toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_target}"\ | 41 toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_target}"\ |
39 "/prebuilt/${toolchain_dir}/bin/" | 42 "/prebuilt/${toolchain_dir}/bin/" |
40 | 43 |
41 # Set only if not already set. | 44 # Set only if not already set. |
42 # Don't override ANDROID_TOOLCHAIN if set by Android configuration env. | 45 # Don't override ANDROID_TOOLCHAIN if set by Android configuration env. |
43 export ANDROID_TOOLCHAIN=${ANDROID_TOOLCHAIN:-${toolchain_path}} | 46 export ANDROID_TOOLCHAIN=${ANDROID_TOOLCHAIN:-${toolchain_path}} |
44 | 47 |
45 common_check_toolchain | 48 common_check_toolchain |
(...skipping 17 matching lines...) Expand all Loading... |
63 export PATH=$PATH:${CHROME_SRC}/build/android | 66 export PATH=$PATH:${CHROME_SRC}/build/android |
64 | 67 |
65 # TODO(beverloo): Remove these once all consumers updated to --strip-binary. | 68 # TODO(beverloo): Remove these once all consumers updated to --strip-binary. |
66 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) | 69 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) |
67 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) | 70 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) |
68 | 71 |
69 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories | 72 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories |
70 # to canonicalize them (remove double '/', remove trailing '/', etc). | 73 # to canonicalize them (remove double '/', remove trailing '/', etc). |
71 DEFINES="OS=android" | 74 DEFINES="OS=android" |
72 DEFINES+=" host_os=${host_os}" | 75 DEFINES+=" host_os=${host_os}" |
| 76 DEFINES+=" gcc_version=${gcc_version}" |
73 | 77 |
74 if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then | 78 if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then |
75 DEFINES+=" branding=Chrome" | 79 DEFINES+=" branding=Chrome" |
76 DEFINES+=" buildtype=Official" | 80 DEFINES+=" buildtype=Official" |
77 | 81 |
78 # These defines are used by various chrome build scripts to tag the binary's | 82 # These defines are used by various chrome build scripts to tag the binary's |
79 # version string as 'official' in linux builds (e.g. in | 83 # version string as 'official' in linux builds (e.g. in |
80 # chrome/trunk/src/chrome/tools/build/version.py). | 84 # chrome/trunk/src/chrome/tools/build/version.py). |
81 export OFFICIAL_BUILD=1 | 85 export OFFICIAL_BUILD=1 |
82 export CHROMIUM_BUILD="_google_chrome" | 86 export CHROMIUM_BUILD="_google_chrome" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 export GYP_DEFINES="${DEFINES}" | 329 export GYP_DEFINES="${DEFINES}" |
326 | 330 |
327 export GYP_GENERATORS="android" | 331 export GYP_GENERATORS="android" |
328 | 332 |
329 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 333 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
330 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 334 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
331 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 335 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
332 | 336 |
333 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" | 337 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" |
334 } | 338 } |
OLD | NEW |