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 # Sets up environment for building Chromium on Android. It can either be | 7 # Sets up environment for building Chromium on Android. It can either be |
8 # compiled with the Android tree or using the Android SDK/NDK. To build with | 8 # compiled with the Android tree or using the Android SDK/NDK. To build with |
9 # NDK/SDK: ". build/android/envsetup.sh --sdk". Environment variable | 9 # NDK/SDK: ". build/android/envsetup.sh". Environment variable |
10 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to | 10 # ANDROID_SDK_BUILD=1 will then be defined and used in the rest of the setup to |
11 # specifiy build type. | 11 # specifiy build type. |
12 | 12 |
13 # When building WebView as part of Android we can't use the SDK. Other builds | 13 # When building WebView as part of Android we can't use the SDK. Other builds |
14 # default to using the SDK. | 14 # default to using the SDK. |
15 # NOTE(yfriedman): This looks unnecessary but downstream the default value | 15 # NOTE(yfriedman): This looks unnecessary but downstream the default value |
Yaron
2012/10/15 22:47:01
Please remove this NOTE
| |
16 # should be 0 until all builds switch to SDK/NDK. | 16 # should be 0 until all builds switch to SDK/NDK. |
17 if [[ "${CHROME_ANDROID_BUILD_WEBVIEW}" -eq 1 ]]; then | 17 if [[ "${CHROME_ANDROID_BUILD_WEBVIEW}" -eq 1 ]]; then |
18 export ANDROID_SDK_BUILD=0 | 18 export ANDROID_SDK_BUILD=0 |
19 else | 19 else |
20 export ANDROID_SDK_BUILD=1 | 20 export ANDROID_SDK_BUILD=1 |
21 fi | 21 fi |
22 # Loop over args in case we add more arguments in the future. | 22 # Loop over args in case we add more arguments in the future. |
23 while [ "$1" != "" ]; do | 23 while [ "$1" != "" ]; do |
24 case $1 in | 24 case $1 in |
25 -s | --sdk ) export ANDROID_SDK_BUILD=1 ; shift ;; | |
shashi
2012/10/15 22:29:20
Just thought that I can remove the above while loo
Yaron
2012/10/15 22:47:01
Yes, I'd prefer to remove this entirely.
| |
26 * ) shift ; break ;; | 25 * ) shift ; break ;; |
27 esac | 26 esac |
28 done | 27 done |
29 | 28 |
30 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then | 29 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then |
31 echo "Using SDK build" | 30 echo "Using SDK build" |
32 fi | 31 fi |
33 | 32 |
34 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') | 33 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') |
35 | 34 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 # Sets up environment for building Chromium for Android with source. Expects | 71 # Sets up environment for building Chromium for Android with source. Expects |
73 # android environment setup and lunch. | 72 # android environment setup and lunch. |
74 elif [[ -z "$ANDROID_BUILD_TOP" || \ | 73 elif [[ -z "$ANDROID_BUILD_TOP" || \ |
75 -z "$ANDROID_TOOLCHAIN" || \ | 74 -z "$ANDROID_TOOLCHAIN" || \ |
76 -z "$ANDROID_PRODUCT_OUT" ]]; then | 75 -z "$ANDROID_PRODUCT_OUT" ]]; then |
77 echo "Android build environment variables must be set." | 76 echo "Android build environment variables must be set." |
78 echo "Please cd to the root of your Android tree and do: " | 77 echo "Please cd to the root of your Android tree and do: " |
79 echo " . build/envsetup.sh" | 78 echo " . build/envsetup.sh" |
80 echo " lunch" | 79 echo " lunch" |
81 echo "Then try this again." | 80 echo "Then try this again." |
82 echo "Or did you mean NDK/SDK build. Run envsetup.sh with --sdk argument." | 81 echo "Or did you mean NDK/SDK build. Run envsetup.sh without any arguments." |
83 return 1 | 82 return 1 |
84 elif [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then | 83 elif [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then |
85 webview_build_init | 84 webview_build_init |
86 else | 85 else |
87 non_sdk_build_init | 86 non_sdk_build_init |
88 fi | 87 fi |
89 | 88 |
90 # Workaround for valgrind build | 89 # Workaround for valgrind build |
91 if [[ -n "$CHROME_ANDROID_VALGRIND_BUILD" ]]; then | 90 if [[ -n "$CHROME_ANDROID_VALGRIND_BUILD" ]]; then |
92 # arm_thumb=0 is a workaround for https://bugs.kde.org/show_bug.cgi?id=270709 | 91 # arm_thumb=0 is a workaround for https://bugs.kde.org/show_bug.cgi?id=270709 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 if echo "$CXX_target" | grep -q g++; then | 123 if echo "$CXX_target" | grep -q g++; then |
125 unset CXX_target | 124 unset CXX_target |
126 fi | 125 fi |
127 fi | 126 fi |
128 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 127 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
129 ) | 128 ) |
130 } | 129 } |
131 | 130 |
132 # FLOCK needs to be null on system that has no flock | 131 # FLOCK needs to be null on system that has no flock |
133 which flock > /dev/null || export FLOCK= | 132 which flock > /dev/null || export FLOCK= |
OLD | NEW |