Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: build/android/envsetup.sh

Issue 9693042: Chrome on Android: fix cross-compilation setup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix expansion Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 CROSS_CC="${ANDROID_TOOLCHAIN}/*-gcc" \
74 CROSS_CXX="${ANDROID_TOOLCHAIN}/*-g++" \
75 CROSS_LINK="${ANDROID_TOOLCHAIN}/*-gcc" \
76 HOST_CC=$(which gcc) \
77 HOST_CXX=$(which g++) \
78 HOST_LINK=$(which g++) \
79 LIBGCC_FILE_NAME=$(${CROSS_CC} -print-libgcc-file-name) \
73 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" 80 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}"
74 } 81 }
75 82
76 firstword() { 83 android_goma_gyp() {
77 echo "${1}" 84 CROSS_CC="$GOMA_DIR/gomacc ${ANDROID_TOOLCHAIN}/*-gcc" \
Ami GONE FROM CHROMIUM 2012/03/14 17:13:18 This is the wrong way to do this. goma/not-goma sh
bulach 2012/03/14 17:36:43 I think there are a few issues in play in here, le
Ami GONE FROM CHROMIUM 2012/03/14 17:57:54 I believe this is the core of your problem. Why a
bulach 2012/03/14 18:28:31 torne can explain in more details.. going forward
85 CROSS_CXX="$GOMA_DIR/gomacc ${ANDROID_TOOLCHAIN}/*-g++" \
86 CROSS_LINK="$GOMA_DIR/gomacc ${ANDROID_TOOLCHAIN}/*-gcc" \
87 HOST_CC=$GOMA_DIR/gcc \
88 HOST_CXX=$GOMA_DIR/g++ \
89 HOST_LINK=$GOMA_DIR/g++\
90 LIBGCC_FILE_NAME=$(${CROSS_CC} -print-libgcc-file-name) \
91 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}"
78 } 92 }
79 93
80 export CROSS_AR="$(firstword "${ANDROID_TOOLCHAIN}"/*-ar)" 94 export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy)
81 export CROSS_CC="$(firstword "${ANDROID_TOOLCHAIN}"/*-gcc)" 95 export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip)
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 96
88 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories 97 # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories
89 # to canonicalize them (remove double '/', remove trailing '/', etc). 98 # to canonicalize them (remove double '/', remove trailing '/', etc).
90 DEFINES="OS=android" 99 DEFINES="OS=android"
91 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted. 100 DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted.
92 DEFINES+=" host_os=${host_os}" 101 DEFINES+=" host_os=${host_os}"
93 DEFINES+=" linux_fpic=1" 102 DEFINES+=" linux_fpic=1"
94 DEFINES+=" release_optimize=s" 103 DEFINES+=" release_optimize=s"
95 DEFINES+=" linux_use_tcmalloc=0" 104 DEFINES+=" linux_use_tcmalloc=0"
96 DEFINES+=" disable_nacl=1" 105 DEFINES+=" disable_nacl=1"
(...skipping 29 matching lines...) Expand all
126 export GYP_DEFINES="${DEFINES}" 135 export GYP_DEFINES="${DEFINES}"
127 136
128 # Use the "android" flavor of the Makefile generator for both Linux and OS X. 137 # Use the "android" flavor of the Makefile generator for both Linux and OS X.
129 export GYP_GENERATORS="make-android" 138 export GYP_GENERATORS="make-android"
130 139
131 # Use our All target as the default 140 # Use our All target as the default
132 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" 141 export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All"
133 142
134 # We want to use our version of "all" targets. 143 # We want to use our version of "all" targets.
135 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" 144 export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698