SQLite-3.3.13在ARM2410s 开发板上的移植

SQLite-3.3.13在ARM2410s 开发板上的移植

Compile SQLite using the cross-compiler such as arm-linux-gcc

first, get sqlite-3.3.13.tar.gz from www.sqlite.org unzip it,
#tar -zxvf sqlite-3.3.13.tar.gz
change into the sqlite-3.3.13 directory
cd sqlite-3.3.13
make a new directory such as 'build' under sqlite-3.3.13 directory,
open the configure-script using your favorite text-editor ,such as:
#vi configure
I recomamnd that you make a copy of configure before editing the configure file
cp configure configure.old
and edit the configure.
Comment out the following commands by putting a '#' in front of them(looks like):

#if test "$cross_compiling" = "yes"; then

# { { echo "$as_me:$LINENO:: error: unable to find a compiler for building build tools" >&5

#echo "$as_me: error: unable to find a compiler for building build tools" >&2;}

# { (exit 1); exit 1; }; }

#fi

. . .

#else

# test "$cross_compiling" = yes &&

# { { echo "$as_me:$LINENO:: error: cannot check for file existence when cross compiling" >&5

#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}

# { (exit 1); exit 1; }; }

. . .

#else

# test "$cross_compiling" = yes &&

# { { echo "$as_me:$LINENO:: error: cannot check for file existence when cross compiling" >&5

#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}

# { (exit 1); exit 1; }; }



Save the configure script, change into the build directory you created and call the edited configure script from the sqlite

directory by using the following option:

../sqlite/configure --disable-tcl --host=arm-linux

After that configure should have created a Makefile and a libtool script in your build directory.
Open the Makefile using your favorite text editor and find the following lines:
BCC = arm-linux-gcc -g -O2
change to
BCC = gcc -g -O2

The reason for these changes is that the created files have to be executed on the PC during the compilation, so we have to

compile them with the standard gcc and not the arm-linux-gcc.

if you want compile static library version of sqlite3(only one execute file for distribution) on ARM, edit Makefile ,
find
sqlite3$(TEXE): $(TOP)/src/shell.c .libs/libsqlite3.la sqlite3.h
change to
sqlite3$(TEXE): $(TOP)/src/shell.c .libs/libsqlite3.a sqlite3.h

find
-o $@ $(TOP)/src/shell.c .libs/libsqlite3.la
change to
-o $@ $(TOP)/src/shell.c .libs/libsqlite3.a

save and quit editor
run 'make' command to create the sqlite3 execute file, after a successful compile,Now you should find a hiden “.libs”

directory in your build directory containing sqlite shared object files, like libsqlite.so or static libray files like

libsqlite3.a .
run 'arm-linux-strip sqlite3' to decrease the execute file size.
upload the sqlite3 to target ARM9 board by any FTP client and make it executive:
on ARM9 board with terminal or telnet ,run
chmod 775 sqlite3
and then run sqlite3 like this
sqlite3 ex2
,if you see the following messages:
SQLite version 3.3.13
Enter ".help" for instructions
sqlite>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值