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>

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7271077/viewspace-906539/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7271077/viewspace-906539/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SQLite-jdbc是一个用于在Java中访问SQLite数据库的驱动程序。它是一个纯Java实现的驱动程序,意味着它可以在任何支持Java的平台上运行。由于SQLite本身是一个轻量级的嵌入式数据库,它不需要像其他数据库那样运行一个独立的服务器进程。 SQLite-jdbc ARM版是专门为ARM架构的设备(如树莓派)而设计的版本。在ARM架构下,硬件资源受限,因此需要优化的驱动程序来提高性能和资源利用率。ARM版的SQLite-jdbc针对这些ARM设备进行了优化,以获得更好的性能和更低的资源消耗。 在使用SQLite-jdbc ARM版时,我们需要下载适用于ARM架构的驱动程序,并在项目中引入它。然后,我们可以像使用任何其他版本的SQLite-jdbc一样,通过Java代码来连接、查询和操作SQLite数据库。 例如,我们可以使用以下代码片段连接到SQLite数据库并执行查询: ```java import java.sql.*; public class Main { public static void main(String[] args) { Connection connection = null; Statement statement = null; ResultSet resultSet = null; try { // 加载SQLite JDBC驱动 Class.forName("org.sqlite.JDBC"); // 创建连接 connection = DriverManager.getConnection("jdbc:sqlite:/path/to/database.db"); // 创建语句对象 statement = connection.createStatement(); // 执行查询 resultSet = statement.executeQuery("SELECT * FROM table"); // 处理结果集 while (resultSet.next()) { // 处理每一行的数据 } } catch (Exception e) { e.printStackTrace(); } finally { // 关闭连接、语句和结果集 try { resultSet.close(); } catch (Exception e) {} try { statement.close(); } catch (Exception e) {} try { connection.close(); } catch (Exception e) {} } } } ``` 通过这样的方式,我们可以在ARM架构的设备上使用SQLite-jdbc ARM版来操作SQLite数据库。这使得我们可以在资源受限的环境中进行数据存储和查询操作,而无需额外的服务器和复杂的配置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值