SQLite for uClinux(一个可以在嵌入式系统中使用的小型数据库)

本文详细介绍了在uClinux环境下SQLite的移植过程,包括所需开发工具、具体步骤及编译测试方法。通过使用Armsys44b0x开发板进行实践,成功将SQLite 2.8.15版本移植并进行了功能验证。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SQLite for uClinux

SQLite  for uClinux
1. Development Tools Need

hardware: Armsys44b0x development board
software: uclinux_armsys_051111.tgz , sqlite 2.8.15, sqlite-2.8.13-uc0 patch

2. Steps

2.1 Download

Download SQLite 2.8.15 from SQLite home page
Download sqlite patch for uclinux sqlite-2.8.13-uc0 patch, no patch for version 2.8.15 found , so we use sqlite-2.8.13-uc0 patch instead and it works well. The URL for the patch is:
http://www.menie.org/georges/uClinux/sqlite-2.8.13-uc0.patch.gz

 2.2 Installation
  Extract the sqlite-2.8.15 tarball into your uClinux-dist/user directory:
   tar -zxvf sqlite-2.8.15.tar.gz
  Change the current working path to sqlite source directory and apply the patch
   zcat sqlite-2.8.13-uc0.patch.gz |patch -p1
  
 2.3  Compliation

  In uClinux-dist/user/makefile add the sqlite directory in the list of directories to compile:
  dir_y += sqlite    # this is the line to add
  
  compile  and copy the generated sqlite binary to  romfs/bin
  make user_only

 3. Test

# cd /var
# sqlite ex1.db
SQLite version 2.8.12
Enter “.help” for instructions
sqlite> create table tbl1(one varchar(10), two smallint);
sqlite> insert into tbl1 values(’hello!’,10);
sqlite> insert into tbl1 values(’goodbye’, 20);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite> .databases
0           main        /var/ex1.db
1           temp        /var/tmp/sq
sqlite> .schema
create table tbl1(one varchar(10), two smallint);
sqlite> .exit
#
#  echo “select * from tbl1;”  | sqlite ex1.db
hello!|10
goodbye|20
#

Tags: SQLite, uClinux

参考了外文资料而成。 
我的blog: www.info-life.cn
本文在我的blog的地址: http://www.info-life.cn/?p=7
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值