NDK的扩展

#!/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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值