forked from myaniu/qcn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_android_arm.sh
executable file
·69 lines (57 loc) · 2.08 KB
/
build_android_arm.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#/bin/sh
#
# See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildApp#
#
# Script to compile various BOINC libraries for Android to be used
# by science applications
COMPILEBOINC=
COMPILENTP=
CONFIGURE=yes
MAKECLEAN=yes
export BOINC="../boinc" #BOINC source code
export ANDROIDTC="$HOME/androidarm-tc"
export TCBINARIES="$ANDROIDTC/bin"
export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi"
export TCSYSROOT="$ANDROIDTC/sysroot"
export STDCPPTC="$TCINCLUDES/lib/libstdc++.a"
export PATH="$TCBINARIES:$TCINCLUDES/bin:$PATH"
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++
export LD=arm-linux-androideabi-ld
export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -DDECLARE_TIMEZONE -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer"
export CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -funroll-loops -fexceptions -O3 -fomit-frame-pointer"
export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -llog"
export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
export PKG_CONFIG_SYSROOT_DIR=$TCSYSROOT
# Prepare android toolchain and environment
./build_androidtc_arm.sh
if [ -n "$COMPILEBOINC" ]; then
echo "==================building Libraries from $BOINC=========================="
cd $BOINC
if [ -n "$MAKECLEAN" ]; then
make clean
fi
if [ -n "$CONFIGURE" ]; then
./_autosetup
./configure --host=arm-linux --with-boinc-platform="arm-android-linux-gnu" --disable-client --disable-server --disable-manager --disable-shared --enable-static
fi
make
make stage
echo "=============================BOINC done============================="
fi
if [ -n "$COMPILENTP" ]; then
# NTP
echo "=============================NTP start============================="
cd ntp-4.2.6p5
./configure --host=arm-linux --disable-shared --enable-static
make clean
cd libntp
make clean && make
cd ../ntpdate
make clean && make
echo "=============================NTP done============================="
fi
./_autosetup
./configure --host=arm-linux --with-boinc-platform="arm-android-linux-gnu" --disable-client --disable-server --disable-manager --disable-shared --enable-static
make clean
make