来源:
ChinaUnix博客 作者:
ChinaUnix博客 发布时间:2008-01-01 09:00:00


前段时间对sqlite进行了交叉编译由于没有及时记录,今天再想做点事情的时候发现忘记了当初是怎么搞定的.这次对sqlite进行了x86和arm的编译,并写成脚本文档方便以后编译,其实主要是arm的编译麻烦一些,sqlite的configure总是无法识别交叉编译器,需要做些更改.源文档是sqlite-3.3.11版本,交叉编译工具为gcc-3.4.2-glibc-2.3.3制作的交叉编译工具.
先做交叉编译对configure的更改对x86下编译没有影响.用make doc生产帮助文档的时候是乱码.
arm下的脚本
#!/bin/bash
# first you must change the configure file, search the keyword
# "test "$cross_compiling" = yes &&", in line 20420 and 20446 you will find the
# {(exit 1);exit 1;};}changed it to {(echo 1);echo 1;};}.At the end you should
# change the Makefile BCC=gcc -g to BCC=gcc -g -O2.Then make and make install.
# Don’t forget to make dir sqlite-armv4l
export PATH=/export PATH=${PATH}:/usr/local/arm/gcc-3.4.2-glibc-2.3.3/bin
export config_BUILD_CC=gcc
export config_TARGET_CC=armv4l-linux-gnu-gcc
./configure --disable-tcl --host=armv4l-linux-gnu --prefix=$PWD/sqlite-armv4l/
make
make install
X86下的脚本
#/bin/bash
./configure --disable-tcl --prefix=$PWD/sqlite-x86/
make
make install
将编译生成的头文档分别放入交叉编译工具的include:/usr/local/arm/gcc-3.4.2-glibc-2.3.3/armv4l-linux-gnu/include
和/usr/include里面内确保在交叉编译和x86编译的时候都能通过,交叉便宜的库文档需要放到研发板的lib目录下
本文来自ChinaUnix博客,假如查看原文请点:http://blog.chinaunix.net/u1/49867/showart_459327.html
|
还没有关于此文章的相关评论!