aboutsummaryrefslogtreecommitdiff
path: root/build-scripts/build-android
blob: cc7f5d3ea3b527f6c69eda013550129aa2313e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
###############################################################################
# Copyright (c) 2011 Linaro
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
###############################################################################

source "${BUILD_SCRIPT_ROOT}"/helpers

repo-sync-from-mirror "${1}"

. build/envsetup.sh

# We evaluate the configuration again because envsetup.sh might well
# have stomped on some of the values in it.

set -a
eval $CONFIGURATION
set +a

export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.22/
export ANDROID_JAVA_HOME=$JAVA_HOME

cpuc=`cat /proc/cpuinfo  | grep processor | wc -l`
threads=$(($cpuc * 4))

if test -n "$TOOLCHAIN_URL"; then
	wget $TOOLCHAIN_URL
	filename=`echo $TOOLCHAIN_URL | sed -e 's/.*\/\([^/]*\)$/\1/'`
	mkdir toolchain
	tar -C toolchain --strip-components 1 -xf $filename
	p=`find $PWD/toolchain/bin/*-gcc`
	export TARGET_TOOLS_PREFIX=`echo $p | sed -e 's/-gcc$/-/'`
fi

if test -z "$TARGET_ARCH_VARIANT"; then
	TARGET_ARCH_VARIANT=armv7-a-neon
fi

time -p make -j${threads} boottarball systemtarball userdatatarball CC=gcc-4.5 CXX=g++-4.5 CPP=cpp-4.5