boinc/android/build_libraries_armv6.sh

67 lines
2.5 KiB
Bash
Executable File

#!/bin/sh
set -e
#
# See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildApp#
#
# Script to compile various BOINC libraries for Android to be used
# by science applications
STDOUT_TARGET="${STDOUT_TARGET:-/dev/stdout}"
COMPILEBOINC="yes"
CONFIGURE="yes"
MAKECLEAN="yes"
VERBOSE="${VERBOSE:-no}"
export BOINC=".." #BOINC source code
export ANDROID_TC="${ANDROID_TC:-$HOME/android-tc}"
export ANDROIDTC="${ANDROID_TC_ARMV6:-$ANDROID_TC/armv6}"
export TCBINARIES="$ANDROIDTC/bin"
export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi"
export TCSYSROOT="$ANDROIDTC/sysroot"
export PATH="$TCBINARIES:$TCINCLUDES/bin:$PATH"
export CC=arm-linux-androideabi-clang
export CXX=arm-linux-androideabi-clang++
export LD=arm-linux-androideabi-ld
export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -DDECLARE_TIMEZONE -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer -fPIE -march=armv6 -mfloat-abi=softfp -mfpu=vfp -D__ANDROID_API__=16 -DARMV6"
export CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -funroll-loops -fexceptions -O3 -fomit-frame-pointer -fPIE -march=armv6 -mfloat-abi=softfp -mfpu=vfp -D__ANDROID_API__=16 -DARMV6"
export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -llog -fPIE -pie -latomic -static-libstdc++ -march=armv6"
export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
export PKG_CONFIG_SYSROOT_DIR="$TCSYSROOT"
# Prepare android toolchain and environment
./build_androidtc_armv6.sh
if [ -n "$COMPILEBOINC" ]; then
cd "$BOINC"
echo "===== building BOINC Libraries for armv6 from $PWD ====="
if [ -n "$MAKECLEAN" ] && [ -f "Makefile" ]; then
if [ "$VERBOSE" = "no" ]; then
make distclean 1>$STDOUT_TARGET 2>&1
else
make distclean SHELL="/bin/bash -x"
fi
fi
if [ -n "$CONFIGURE" ]; then
./_autosetup
./configure --host=arm-linux --with-boinc-platform="arm-android-linux-gnu" --prefix="$TCINCLUDES" --libdir="$TCINCLUDES/lib" --with-ssl="$TCINCLUDES" --disable-server --disable-manager --disable-client --disable-shared --enable-static --disable-largefile --enable-boinczip
sed -e "s%^CLIENTLIBS *= *.*$%CLIENTLIBS = -lm $STDCPPTC%g" client/Makefile > client/Makefile.out
mv client/Makefile.out client/Makefile
fi
if [ "$VERBOSE" = "no" ]; then
make --silent
make stage --silent
make install --silent
else
make SHELL="/bin/bash -x"
make stage SHELL="/bin/bash -x"
make install SHELL="/bin/bash -x"
fi
echo "===== building BOINC Libraries for armv6 done ====="
fi