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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 # Set default target. | 227 # Set default target. |
228 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" | 228 export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" |
229 | 229 |
230 # Unset toolchain so that it can be set based on TARGET_PRODUCT. | 230 # Unset toolchain so that it can be set based on TARGET_PRODUCT. |
231 # This makes it easy to switch between architectures. | 231 # This makes it easy to switch between architectures. |
232 unset ANDROID_TOOLCHAIN | 232 unset ANDROID_TOOLCHAIN |
233 | 233 |
234 common_vars_defines | 234 common_vars_defines |
235 | 235 |
236 DEFINES+=" sdk_build=1" | |
237 | |
238 # Sets android specific directories to NOT_SDK_COMPLIANT. This will allow | 236 # Sets android specific directories to NOT_SDK_COMPLIANT. This will allow |
239 # android_gyp to generate make files, but will cause errors when (and only | 237 # android_gyp to generate make files, but will cause errors when (and only |
240 # when) building targets that depend on these directories. | 238 # when) building targets that depend on these directories. |
241 DEFINES+=" android_src='NOT_SDK_COMPLIANT'" | |
242 DEFINES+=" android_product_out=${CHROME_SRC}/out/android" | |
243 DEFINES+=" android_lib='NOT_SDK_COMPLIANT'" | |
244 DEFINES+=" android_static_lib='NOT_SDK_COMPLIANT'" | |
245 DEFINES+=" android_sdk=${ANDROID_SDK_ROOT}/${sdk_suffix}" | 239 DEFINES+=" android_sdk=${ANDROID_SDK_ROOT}/${sdk_suffix}" |
246 DEFINES+=" android_sdk_root=${ANDROID_SDK_ROOT}" | 240 DEFINES+=" android_sdk_root=${ANDROID_SDK_ROOT}" |
247 DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/platform-tools" | 241 DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/platform-tools" |
248 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" | 242 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" |
249 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" | 243 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" |
250 | 244 |
251 common_gyp_vars | 245 common_gyp_vars |
252 | 246 |
253 if [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then | 247 if [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then |
254 # Can not build WebView with NDK/SDK because it needs the Android build | 248 # Can not build WebView with NDK/SDK because it needs the Android build |
(...skipping 24 matching lines...) Expand all Loading... |
279 # sure the generated Android makefiles are portable, as they will be checked | 273 # sure the generated Android makefiles are portable, as they will be checked |
280 # into the Android tree. | 274 # into the Android tree. |
281 ANDROID_SDK=$(python -c \ | 275 ANDROID_SDK=$(python -c \ |
282 "import os.path; print os.path.relpath('${ANDROID_SDK_ROOT}', \ | 276 "import os.path; print os.path.relpath('${ANDROID_SDK_ROOT}', \ |
283 '${ANDROID_BUILD_TOP}')") | 277 '${ANDROID_BUILD_TOP}')") |
284 ANDROID_SDK_TOOLS=$(python -c \ | 278 ANDROID_SDK_TOOLS=$(python -c \ |
285 "import os.path; \ | 279 "import os.path; \ |
286 print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/linux', \ | 280 print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/linux', \ |
287 '${ANDROID_BUILD_TOP}')") | 281 '${ANDROID_BUILD_TOP}')") |
288 DEFINES+=" android_build_type=1" | 282 DEFINES+=" android_build_type=1" |
289 DEFINES+=" sdk_build=0" | |
290 DEFINES+=" android_src=\$(GYP_ABS_ANDROID_TOP_DIR)" | 283 DEFINES+=" android_src=\$(GYP_ABS_ANDROID_TOP_DIR)" |
291 DEFINES+=" android_product_out=NOT_USED_ON_WEBVIEW" | |
292 DEFINES+=" android_sdk=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK}" | 284 DEFINES+=" android_sdk=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK}" |
293 DEFINES+=" android_sdk_root=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK}" | 285 DEFINES+=" android_sdk_root=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK}" |
294 DEFINES+=" android_sdk_tools=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK_TOOLS}" | 286 DEFINES+=" android_sdk_tools=\$(GYP_ABS_ANDROID_TOP_DIR)/${ANDROID_SDK_TOOLS}" |
295 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" | 287 DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" |
296 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" | 288 DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" |
297 export GYP_DEFINES="${DEFINES}" | 289 export GYP_DEFINES="${DEFINES}" |
298 | 290 |
299 export GYP_GENERATORS="android" | 291 export GYP_GENERATORS="android" |
300 | 292 |
301 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 293 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
302 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" | 294 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" |
303 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" | 295 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" |
304 | 296 |
305 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" | 297 export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" |
306 } | 298 } |
OLD | NEW |