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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 export CHROME_SRC=$(readlink -f .) | 63 export CHROME_SRC=$(readlink -f .) |
64 fi | 64 fi |
65 | 65 |
66 if [ ! -d "${CHROME_SRC}" ]; then | 66 if [ ! -d "${CHROME_SRC}" ]; then |
67 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 | 67 echo "CHROME_SRC must be set to the path of Chrome source code." >& 2 |
68 return 1 | 68 return 1 |
69 fi | 69 fi |
70 | 70 |
71 # Performs a gyp_chromium run to convert gyp->Makefile for android code. | 71 # Performs a gyp_chromium run to convert gyp->Makefile for android code. |
72 android_gyp() { | 72 android_gyp() { |
73 GOMA_WRAPPER="" | |
74 if [[ -d $GOMA_DIR ]]; then | |
75 GOMA_WRAPPER="$GOMA_DIR/gomacc" | |
76 fi | |
77 # Ninja requires "*_target" for target builds. | |
78 GOMA_WRAPPER=${GOMA_WRAPPER} \ | |
79 CC_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) \ | |
80 CXX_target=$(basename ${ANDROID_TOOLCHAIN}/*-g++) \ | |
81 LINK_target=$(basename ${ANDROID_TOOLCHAIN}/*-gcc) \ | |
82 AR_target=$(basename ${ANDROID_TOOLCHAIN}/*-ar) \ | |
73 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" | 83 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" |
74 } | 84 } |
75 | 85 |
76 firstword() { | 86 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) |
77 echo "${1}" | 87 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) |
Peter Beverloo
2012/03/16 17:31:33
nit: you use "echo" here while using "basename" ab
| |
78 } | |
79 | |
80 export CROSS_AR="$(firstword "${ANDROID_TOOLCHAIN}"/*-ar)" | |
81 export CROSS_CC="$(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" | |
82 export CROSS_CXX="$(firstword "${ANDROID_TOOLCHAIN}"/*-g++)" | |
83 export CROSS_LINK="$(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" | |
84 export CROSS_RANLIB="$(firstword "${ANDROID_TOOLCHAIN}"/*-ranlib)" | |
85 export OBJCOPY="$(firstword "${ANDROID_TOOLCHAIN}"/*-objcopy)" | |
86 export STRIP="$(firstword "${ANDROID_TOOLCHAIN}"/*-strip)" | |
87 | 88 |
88 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories | 89 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories |
89 # to canonicalize them (remove double '/', remove trailing '/', etc). | 90 # to canonicalize them (remove double '/', remove trailing '/', etc). |
90 DEFINES="OS=android" | 91 DEFINES="OS=android" |
91 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. | 92 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. |
92 DEFINES+=" host_os=${host_os}" | 93 DEFINES+=" host_os=${host_os}" |
93 DEFINES+=" linux_fpic=1" | 94 DEFINES+=" linux_fpic=1" |
94 DEFINES+=" release_optimize=s" | 95 DEFINES+=" release_optimize=s" |
95 DEFINES+=" linux_use_tcmalloc=0" | 96 DEFINES+=" linux_use_tcmalloc=0" |
96 DEFINES+=" disable_nacl=1" | 97 DEFINES+=" disable_nacl=1" |
(...skipping 29 matching lines...) Expand all Loading... | |
126 export GYP_DEFINES="${DEFINES}" | 127 export GYP_DEFINES="${DEFINES}" |
127 | 128 |
128 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 129 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
129 export GYP_GENERATORS="make-android" | 130 export GYP_GENERATORS="make-android" |
130 | 131 |
131 # Use our All target as the default | 132 # Use our All target as the default |
132 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" | 133 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" |
133 | 134 |
134 # We want to use our version of "all" targets. | 135 # We want to use our version of "all" targets. |
135 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" | 136 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" |
OLD | NEW |