#!/bin/bash
#############################################
# Android Stuff
#############################################
HOME=/home/jinl
JAVA_HOME=/usr/java/jdk1.6.0_16/
SYS_ROOT=$HOME/tmp/android/system
SYS_DEV=/home/app/myDonut/donut
#Tool chain
TOOLCHAIN_ROOT=$HOME/arm-eabi-4.3.1
# Includes
BASE=$SYS_DEV/frameworks/base
LIBC=$SYS_DEV/bionic/libc
LIBCPP=$SYS_DEV/bionic/libstdc++
LIBM=${SYS_DEV}/bionic/libm
TC=${SYS_DEV}/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/lib/gcc/arm-eabi/4.3.1
KERNEL=${SYS_DEV}/kernel
HARDWARE=${SYS_DEV}/hardware/libhardware
LIBZ=${SYS_DEV}/external/zlib
EXPAT=${SYS_DEV}/external/expat/lib
SKIALIB=${SYS_DEV}/external/skia/include
OPENGLESLIB=${SYS_DEV}/frameworks/base/opengl/include
ANDROIDRUNTIME=${SYS_DEV}/frameworks/base/include
AND_INC="-Iinclude -I$JAVA_HOME/include"
AND_INC+=" -I${JAVA_HOME}/include/linux"
AND_INC+=" -I${LIBC}/include"
AND_INC+=" -I${LIBC}/arch-arm/include"
AND_INC+=" -I${LIBC}/kernel/common"
AND_INC+=" -I${LIBC}/kernel/arch-arm"
AND_INC+=" -I${LIBCPP}/include"
AND_INC+=" -I${LIBM}/include"
AND_INC+=" -I${BASE}/include"
AND_INC+=" -I${TC}/include"
AND_INC+=" -I${KERNEL}/include"
AND_INC+=" -I${KERNEL}/arch/arm/include -I${KERNEL}/arch/arm/mach-ebsa110/include"
AND_INC+=" -I${SYS_DEV}/system/core/include"
AND_INC+=" -I${LIBZ}"
AND_INC+=" -I${HARDWARE}/include"
AND_INC+=" -I${EXPAT}"
AND_INC+=" -I${SKIALIB}"
AND_INC+=" -I${OPENGLESLIB}"
AND_INC+=" -I${ANDROIDRUNTIME}"
#EXTRA_INC="${KERNEL}/include/linux/soundcard.h"
#AND_INC+=" -I${KERNEL}/include/linux"
#AND_INC+=" -I${LIBC}/kernel/common/linux"
LIBDIR=${TOOLCHAIN_ROOT}/lib/gcc/arm-eabi/4.3.1
LIBRARIES=${LIBDIR}/libgcc.a
#############################################
# End Android Stuff
#############################################
CROSS=${HOME}/arm-eabi-4.3.1/bin/arm-eabi-
GCC=${CROSS}gcc
echo ${GCC} -nostdinc $AND_INC $@
echo "456"
#${GCC} -nostdinc ${AND_INC} -DINLINE='static __inline__' $@
${GCC} -nostdinc ${AND_INC} "$@"
#!/bin/bash
#############################################
# Android Stuff
#############################################
HOME=/home/jinl
JAVA_HOME=/usr/java/jdk1.6.0_16/
SYS_ROOT=$HOME/tmp/android/system
SYS_DEV=/home/app/myDonut/donut
# Tool chain Root
TOOLCHAIN_ROOT=$HOME/arm-eabi-4.3.1
# Android Toolchain
LIBGCC=${SYS_DEV}/prebuilt/darwin-x86/toolchain/arm-eabi-4.3.1/lib/gcc/arm-eabi/4.3.1/libgcc.a
# Code Sourcery
#LIBGCC=${TOOLCHAIN_ROOT}/lib/gcc/arm-eabi/4.3.1/libgcc.a
LIBRARIES="-lc -lm ${LIBGCC}"
LIB_PATHS="-rpath /system/lib /
-rpath ${SYS_ROOT}/lib /
-L${SYS_ROOT}/lib /
-L. /
-L${JAVA_HOME}/jre/lib/i386"
# When compiling statically remove -nostdlib
LD_FLAGS="--dynamic-linker=/system/bin/linker -nostdlib"
#############################################
# End Android Stuff
#############################################
CROSS=${HOME}/arm-eabi-4.3.1/bin/arm-eabi-
GCC=${CROSS}ld
#echo "${GCC} $LD_FLAGS $LIB_PATHS $@ $LIBRARIES"
${GCC} $LD_FLAGS $LIB_PATHS $@ $LIBRARIES