Android版busybox编译
1下载busybox源码
2解压
tar -xvf busybox-1.23.2.tar.bz2
3 android版的配置脚本
解压后的源码里,configs文件压有android版本的配置脚本:
android2_defconfig android_defconfig android_ndk_defconfig
我选用的是android2_defconfig
4编译arm版busybox
1)export arm的编译工具:
export PATH=$PATH:/xxx/yyy/android_source/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin
2)修改编译工具
打开android2_defconfig
将
CONFIG_CROSS_COMPILER_PREFIX=" arm-eabi-"
改为
CONFIG_CROSS_COMPILER_PREFIX="arm-linux-androideabi-"
3)修改sysroot路径
由于arm-linux-androideabi-4.6目录下没有sysroot目录,因此需要指定,否则编译时会出现找不到一些头文件的错误,如:
include/platform.h:141:20: fatal error:limits.h: No such file or directory
compilation terminated.
make[1]: *** [applets/applets.o]错误1