| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 # If current directory is not in $CHROME_SRC, it might be set for other | 59 # If current directory is not in $CHROME_SRC, it might be set for other |
| 60 # source tree. If $CHROME_SRC was set correctly and we are in the correct | 60 # source tree. If $CHROME_SRC was set correctly and we are in the correct |
| 61 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". | 61 # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". |
| 62 # Otherwise, it will equal to "${CURRENT_DIR}" | 62 # Otherwise, it will equal to "${CURRENT_DIR}" |
| 63 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ | 63 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ |
| 64 the one you want." | 64 the one you want." |
| 65 echo "${CHROME_SRC}" | 65 echo "${CHROME_SRC}" |
| 66 fi | 66 fi |
| 67 | 67 |
| 68 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then | 68 if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then |
| 69 if [[ -z "${TARGET_ARCH}" ]]; then | |
| 70 return 1 | |
| 71 fi | |
| 72 sdk_build_init | 69 sdk_build_init |
| 73 # Sets up environment for building Chromium for Android with source. Expects | 70 # Sets up environment for building Chromium for Android with source. Expects |
| 74 # android environment setup and lunch. | 71 # android environment setup and lunch. |
| 75 elif [[ -z "$ANDROID_BUILD_TOP" || \ | 72 elif [[ -z "$ANDROID_BUILD_TOP" || \ |
| 76 -z "$ANDROID_TOOLCHAIN" || \ | 73 -z "$ANDROID_TOOLCHAIN" || \ |
| 77 -z "$ANDROID_PRODUCT_OUT" ]]; then | 74 -z "$ANDROID_PRODUCT_OUT" ]]; then |
| 78 echo "Android build environment variables must be set." | 75 echo "Android build environment variables must be set." |
| 79 echo "Please cd to the root of your Android tree and do: " | 76 echo "Please cd to the root of your Android tree and do: " |
| 80 echo " . build/envsetup.sh" | 77 echo " . build/envsetup.sh" |
| 81 echo " lunch" | 78 echo " lunch" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 93 export GYP_CROSSCOMPILE=1 | 90 export GYP_CROSSCOMPILE=1 |
| 94 | 91 |
| 95 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 92 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
| 96 android_gyp() { | 93 android_gyp() { |
| 97 # This is just a simple wrapper of gyp_chromium, please don't add anything | 94 # This is just a simple wrapper of gyp_chromium, please don't add anything |
| 98 # in this function. | 95 # in this function. |
| 99 ( | 96 ( |
| 100 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 97 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
| 101 ) | 98 ) |
| 102 } | 99 } |
| OLD | NEW |