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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 echo "Please cd to the root of your Android tree and do: " | 102 echo "Please cd to the root of your Android tree and do: " |
103 echo " . build/envsetup.sh" | 103 echo " . build/envsetup.sh" |
104 echo " lunch" | 104 echo " lunch" |
105 echo "Then try this again." | 105 echo "Then try this again." |
106 echo "Or did you mean NDK/SDK build. Run envsetup.sh without any arguments." | 106 echo "Or did you mean NDK/SDK build. Run envsetup.sh without any arguments." |
107 return 1 | 107 return 1 |
108 elif [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then | 108 elif [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then |
109 webview_build_init | 109 webview_build_init |
110 fi | 110 fi |
111 | 111 |
112 java -version 2>&1 | grep -qs "Java HotSpot" | |
113 if [ $? -ne 0 ]; then | |
114 echo "Please check and make sure you are using the Oracle Java SDK, and it" | |
115 echo "appears before other Java SDKs in your path." | |
116 echo "Refer to the \"Install prerequisites\" section here:" | |
117 echo "https://code.google.com/p/chromium/wiki/AndroidBuildInstructions" | |
118 return 1 | |
119 fi | |
120 | |
121 if [[ -n "$JAVA_HOME" && -x "$JAVA_HOME/bin/java" ]]; then | |
122 "$JAVA_HOME/bin/java" -version 2>&1 | grep -qs "Java HotSpot" | |
123 if [ $? -ne 0 ]; then | |
124 echo "If JAVA_HOME is defined then it must refer to the install location" | |
125 echo "of the Oracle Java SDK." | |
126 echo "Refer to the \"Install prerequisites\" section here:" | |
127 echo "https://code.google.com/p/chromium/wiki/AndroidBuildInstructions" | |
128 return 1 | |
129 fi | |
130 fi | |
131 | |
132 # Workaround for valgrind build | 112 # Workaround for valgrind build |
133 if [[ -n "$CHROME_ANDROID_VALGRIND_BUILD" ]]; then | 113 if [[ -n "$CHROME_ANDROID_VALGRIND_BUILD" ]]; then |
134 # arm_thumb=0 is a workaround for https://bugs.kde.org/show_bug.cgi?id=270709 | 114 # arm_thumb=0 is a workaround for https://bugs.kde.org/show_bug.cgi?id=270709 |
135 DEFINES+=" arm_thumb=0 release_extra_cflags='-fno-inline\ | 115 DEFINES+=" arm_thumb=0 release_extra_cflags='-fno-inline\ |
136 -fno-omit-frame-pointer -fno-builtin' release_valgrind_build=1\ | 116 -fno-omit-frame-pointer -fno-builtin' release_valgrind_build=1\ |
137 release_optimize=1" | 117 release_optimize=1" |
138 fi | 118 fi |
139 | 119 |
140 # Source a bunch of helper functions | 120 # Source a bunch of helper functions |
141 . ${CHROME_SRC}/build/android/adb_device_functions.sh | 121 . ${CHROME_SRC}/build/android/adb_device_functions.sh |
(...skipping 20 matching lines...) Expand all Loading... |
162 # This is just a simple wrapper of gyp_chromium, please don't add anything | 142 # This is just a simple wrapper of gyp_chromium, please don't add anything |
163 # in this function. | 143 # in this function. |
164 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" | 144 echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
165 ( | 145 ( |
166 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 146 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
167 ) | 147 ) |
168 } | 148 } |
169 | 149 |
170 # FLOCK needs to be null on system that has no flock | 150 # FLOCK needs to be null on system that has no flock |
171 which flock > /dev/null || export FLOCK= | 151 which flock > /dev/null || export FLOCK= |
OLD | NEW |