From b96a79f0052526b57f66a3400278322179d0fd36 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 18 Jan 2013 14:41:48 -0500 Subject: [PATCH] android: Fix the example app compile on Android --- samples/example_app/Makefile_android | 11 +++++++++++ samples/example_app/build_android.sh | 14 ++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 samples/example_app/Makefile_android diff --git a/samples/example_app/Makefile_android b/samples/example_app/Makefile_android new file mode 100644 index 0000000000..208f28968e --- /dev/null +++ b/samples/example_app/Makefile_android @@ -0,0 +1,11 @@ +# This should work on Linux. Modify as needed for other platforms. + +PROGS = uc2 + +all: $(PROGS) + +clean: + rm $(PROGS) *.o + +uc2: uc2.o $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o uc2 uc2.o $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc.a $(STDCPPTC) \ No newline at end of file diff --git a/samples/example_app/build_android.sh b/samples/example_app/build_android.sh index 1cd7266d75..41d184f0c5 100644 --- a/samples/example_app/build_android.sh +++ b/samples/example_app/build_android.sh @@ -1,22 +1,24 @@ #/bin/sh -#script to compile Uppercase for Android +#script to compile Wrapper for Android export ANDROIDTC="$HOME/android-tc" export TCBINARIES="$ANDROIDTC/bin" export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi" export TCSYSROOT="$ANDROIDTC/sysroot" export STDCPPTC="$TCINCLUDES/lib/libstdc++.a" +export BOINC_DIR="../.." +export BOINC_API_DIR="$BOINC_DIR/api" +export BOINC_LIB_DIR="$BOINC_DIR/lib" +export BOINC_ZIP_DIR="$BOINC_DIR/zip" export PATH="$PATH:$TCBINARIES:$TCINCLUDES/bin" -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 CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -funroll-loops -fexceptions -O3 -fomit-frame-pointer -I$TCINCLUDES/include -I$BOINC_DIR -I$BOINC_LIB_DIR -I$BOINC_API_DIR -I$BOINC_ZIP_DIR" +export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -L$BOINC_DIR -L$BOINC_LIB_DIR -L$BOINC_API_DIR -L$BOINC_ZIP_DIR -llog" export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include" # Prepare android toolchain and environment ../../android/build_androidtc.sh -make +make -f Makefile_android