Chromium Code Reviews| 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. Only Android NDK, | 7 # Sets up environment for building Chromium on Android. Only Android NDK, |
| 8 # Revision 6b on Linux or Mac is offically supported. | 8 # Revision 6b on Linux or Mac is offically supported. |
| 9 # | 9 # |
| 10 # To run this script, the system environment ANDROID_NDK_ROOT must be set | 10 # To run this script, the system environment ANDROID_NDK_ROOT must be set |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 export CHROME_SRC=$(readlink -f .) | 61 export CHROME_SRC=$(readlink -f .) |
| 62 fi | 62 fi |
| 63 | 63 |
| 64 if [ ! -d "${CHROME_SRC}" ]; then | 64 if [ ! -d "${CHROME_SRC}" ]; then |
| 65 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 65 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
| 66 return 1 | 66 return 1 |
| 67 fi | 67 fi |
| 68 | 68 |
| 69 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 69 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
| 70 android_gyp() { | 70 android_gyp() { |
| 71 CROSS_CC="$(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" \ | |
|
Ami GONE FROM CHROMIUM
2012/03/13 19:18:31
What's the deal w/ firstword (here & below)?
l.53
bulach
2012/03/14 12:59:40
good point, thanks! :)
probably some legacy leftov
| |
| 72 CROSS_CXX="$(firstword "${ANDROID_TOOLCHAIN}"/*-g++)" \ | |
| 73 CROSS_LINK="$(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" \ | |
| 74 HOST_CC=`which gcc` \ | |
| 75 HOST_CXX=`which g++` \ | |
| 76 HOST_LINK=`which g++` \ | |
| 77 LIBGCC_FILE_NAME=`${CROSS_CC} -print-libgcc-file-name` \ | |
| 71 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" | 78 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" |
| 72 } | 79 } |
| 73 | 80 |
| 81 android_goma_gyp() { | |
| 82 CROSS_CC="$GOMA_DIR/gomacc $(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" \ | |
| 83 CROSS_CXX="$GOMA_DIR/gomacc $(firstword "${ANDROID_TOOLCHAIN}"/*-g++)" \ | |
| 84 CROSS_LINK="$GOMA_DIR/gomacc $(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" \ | |
| 85 HOST_CC=$GOMA_DIR/gcc \ | |
| 86 HOST_CXX=$GOMA_DIR/g++ \ | |
| 87 HOST_LINK=$GOMA_DIR/g++\ | |
| 88 LIBGCC_FILE_NAME=`${CROSS_CC} -print-libgcc-file-name` \ | |
| 89 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" | |
| 90 } | |
| 91 | |
| 74 firstword() { | 92 firstword() { |
|
Peter Beverloo
2012/03/13 16:23:09
minor readability nit: maybe define firstword() be
bulach
2012/03/14 12:59:40
removed.
| |
| 75 echo "${1}" | 93 echo "${1}" |
| 76 } | 94 } |
| 77 | 95 |
| 78 export CROSS_AR="$(firstword "${ANDROID_TOOLCHAIN}"/*-ar)" | |
| 79 export CROSS_CC="$(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" | |
| 80 export CROSS_CXX="$(firstword "${ANDROID_TOOLCHAIN}"/*-g++)" | |
| 81 export CROSS_LINK="$(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" | |
| 82 export CROSS_RANLIB="$(firstword "${ANDROID_TOOLCHAIN}"/*-ranlib)" | |
| 83 export OBJCOPY="$(firstword "${ANDROID_TOOLCHAIN}"/*-objcopy)" | 96 export OBJCOPY="$(firstword "${ANDROID_TOOLCHAIN}"/*-objcopy)" |
| 84 export STRIP="$(firstword "${ANDROID_TOOLCHAIN}"/*-strip)" | 97 export STRIP="$(firstword "${ANDROID_TOOLCHAIN}"/*-strip)" |
| 85 | 98 |
| 86 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories | 99 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories |
| 87 # to canonicalize them (remove double '/', remove trailing '/', etc). | 100 # to canonicalize them (remove double '/', remove trailing '/', etc). |
| 88 DEFINES="OS=android" | 101 DEFINES="OS=android" |
| 89 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. | 102 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. |
| 90 DEFINES+=" host_os=${host_os}" | 103 DEFINES+=" host_os=${host_os}" |
| 91 DEFINES+=" linux_fpic=1" | 104 DEFINES+=" linux_fpic=1" |
| 92 DEFINES+=" release_optimize=s" | 105 DEFINES+=" release_optimize=s" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 export GYP_DEFINES="${DEFINES}" | 137 export GYP_DEFINES="${DEFINES}" |
| 125 | 138 |
| 126 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 139 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
| 127 export GYP_GENERATORS="make-android" | 140 export GYP_GENERATORS="make-android" |
| 128 | 141 |
| 129 # Use our All target as the default | 142 # Use our All target as the default |
| 130 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 143 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
| 131 | 144 |
| 132 # We want to use our version of "all" targets. | 145 # We want to use our version of "all" targets. |
| 133 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 146 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
| OLD | NEW |