1. 去sqlite官网下载最新的版本 http://www.sqlite.org/download.HTML,
2.进入到我的 root@x-desktop:/work/Work_Sorce_Code# 目录下用 mkdir sqlite 命令新建一个文件夹。
3. 复制下载的源码文件到sqlite目录下,然后解压:
root@x-desktop:/work/Work_Sorce_Code/sqlite# lssqlite-autoconf-3210000.tar.gzroot@x-desktop:/work/Work_Sorce_Code/sqlite# tar xvf sqlite-autoconf-3210000.tar.gz sqlite-autoconf-3210000/sqlite-autoconf-3210000/compilesqlite-autoconf-3210000/config.guesssqlite-autoconf-3210000/configuresqlite-autoconf-3210000/sqlite3ext.hsqlite-autoconf-3210000/aclocal.m4sqlite-autoconf-3210000/install-shsqlite-autoconf-3210000/depcompsqlite-autoconf-3210000/sqlite3.csqlite-autoconf-3210000/INSTALLsqlite-autoconf-3210000/sqlite3.pc.insqlite-autoconf-3210000/missingsqlite-autoconf-3210000/Makefile.amsqlite-autoconf-3210000/config4.解压完成后在 sqlite目录下用命令mkdir install新建一个install目录,用来存放编译之后可执行文件与库,
当前的sqlite目录下有如下文件:
root@x-desktop:/work/Work_Sorce_Code/sqlite# lsinstall sqlite-autoconf-3210000 sqlite-autoconf-3210000.tar.gz5.进入到sqlite-autoconf-3210000 目录下进行配置编译:
root@x-desktop:/work/Work_Sorce_Code/sqlite# cd sqlite-autoconf-3210000root@x-desktop:/work/Work_Sorce_Code/sqlite/sqlite-autoconf-3210000# lsaclocal.m4 config.guess configure depcomp install-sh Makefile.am Makefile.msc README.txt shell.c sqlite3.c sqlite3.h sqlite3.rccompile config.sub configure.ac INSTALL ltmain.sh Makefile.in missing Replace.cs sqlite3.1 sqlite3ext.h sqlite3.pc.in tea
root@x-desktop:/work/Work_Sorce_Code/sqlite/sqlite-autoconf-3210000# ./configure --host=arm-linux CC=/home/pub/arm-linux-gcc-3.4.1/bin/arm-linux-gcc --prefix=/work/Work_Sorce_Code/sqlite/install
root@x-desktop:/work/Work_Sorce_Code/sqlite/sqlite-autoconf-3210000# make
root@x-desktop:/work/Work_Sorce_Code/sqlite/sqlite-autoconf-3210000# make install
root@x-desktop:/work/Work_Sorce_Code/sqlite/sqlite-autoconf-3210000# cd ../install/
root@x-desktop:/work/Work_Sorce_Code/sqlite/install# lsbin include lib shareroot@x-desktop:/work/Work_Sorce_Code/sqlite/install# cd binroot@x-desktop:/work/Work_Sorce_Code/sqlite/install/bin# lssqlite3root@x-desktop:/work/Work_Sorce_Code/sqlite/install/bin# /home/pub/arm-linux-gcc-3.4.1/bin/arm-linux-strip sqlite3 sqlite3
root@x-desktop:/work/Work_Sorce_Code/sqlite/install/bin# cd ../lib/root@x-desktop:/work/Work_Sorce_Code/sqlite/install/lib# lslibsqlite3.a libsqlite3.la libsqlite3.so libsqlite3.so.0 libsqlite3.so.0.8.6 pkgconfigroot@x-desktop:/work/Work_Sorce_Code/sqlite/install/lib# /home/pub/arm-linux-gcc-3.4.1/bin/arm-linux-strip libsqlite3.so.0.8.6 libsqlite3.so.0.8.6
6.最后把bin目录下的sqlite可执行文件复制到linux的 /bin 目录下,把libsqlite3.so.0.8.6 复制到 linux的 /lib目录下,
然后进入arm中的linux的/lib目录下执行以下命令:
# ln -s libsqlite3.so.0.8.6 libsqlite3.so.0## ln -s libsqlite3.so.0.8.6 libsqlite3.so ## ls -l-rwxr-xr-x 1 root root 503337 Jan 29 18:03 gdbserverlrwxrwxrwx 1 root root 19 Jan 30 16:09 libsqlite3.so -> libsqlite3.so.0.8.6lrwxrwxrwx 1 root root 19 Jan 30 16:09 libsqlite3.so.0 -> libsqlite3.so.0.8.6-rwxr-xr-x 1 root root 675460 Jan 30 01:31 libsqlite3.so.0.8.6
然后在arm linux 终端中执行sqlite可执行文件,得到如下结果就证明移植成功了:
# ./sqlite3sqlite version 3.21.0 2017-10-24 18:55:49Enter ".help" for usage hints.Connected to a transIEnt in-memory database.Use ".open filename" to reopen on a persistent database.sqlite>总结
以上是内存溢出为你收集整理的移植 SQLite version 3.21.0 到 ARM, LINUX环境中全部内容,希望文章能够帮你解决移植 SQLite version 3.21.0 到 ARM, LINUX环境中所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)