Successfully ported SQLite3 to arm Linux Development Board

Source: Internet
Author: User
Tags sqlite

SQLite, a lightweight database that adheres to the acid-related database management system, is designed to be embedded and is now used in many embedded products
It occupies very low resources, in the embedded device, may only need hundreds of K of memory is enough. It can support Windows/linux/unix and so on mainstream operating system, and can be combined with many programming languages, such as TCL, C #, PHP, Java, and ODBC interface, also compared to MySQL, PostgreSQL, the two open source world-renowned database management system, is processing faster than they do.

Before we start, we need to confirm that there are
    • SQLite3 source package;
    • Have cross-compiling environment;
    • There is a development board;

1. Download SQLite3 Source code
Address: http://www.sqlite.org/download.html
<ignore_js_op>
Choose a stable version of the source code

2. Copy the source package to the host working directory
As my user is the Gary,sqlite version is 3.8. The 5 version of the SQLite version is 3.8.5 version
123456 cdmkdir sqlite3                #在主机(如Ubuntu)创建工作目录cd sqlite3                #进入工作目录中cp /media/sda1/sqlite-autoconf-3080500.tar.gz ./        #复制SQLite源码到主机tar zxvf sqlite-autoconf-3080500.tar.gz                        #解压cd sqlite-autoconf-3080500                                #进入解压后的目录


3. Configure compilation Options
123 mkdir../install                                        #创建安装目录export PATH=$PATH:/usr/local/arm-2010q1/bin                #交叉编译工具路径加入系统环境变量./configure--host=arm-none-linux-gnueabi --prefix=/home/gary/sqlite3/install

which
    • --host: Specify the cross-compilation tool, generally Arm-linux, ARM-LINUX-GNUEABIHF, Arm-none-linux-gnueabi, etc., specifically to the board with the cross-compilation tool corresponding.
    • --prefix: Specifies the installation directory, and the compiled files are all placed in the installation directory. Must be an absolute path

4. Compile and install
12 makemakeinstall


5. Compress and copy
Compress and copy sqlite3 files to USB drive
123 cd../install/binarm-none-linux-gnueabi-strip sqlite3cp libsqlite3.so.0.8.6 /media/sda1#U盘目录

Compress and copy the dynamic library libsqlite3.so.0.8.6 file to the USB drive
123 cd../libarm-none-linux-gnueabi-strip libsqlite3.so.0.8.6cplibsqlite3.so.0.8.6 /media/sda1


6. Copying Files
Make a link on the Development Board to insert the USB drive into the board, copy the sqlite3 to the/usr/local/bin directory, copy the dynamic library file to the/usr/local/lib directory, and link the dynamic library.
12345 cp/media/sda1/sqlite3 /usr/locl/bincp /media/sda1 libsqlite3.so.0.8.6 /usr/local/libcd /usr/local/libln -s libsqlite3.so.0.8.6 libsqlite3.so.0ln-s libsqlite3.so.0.8.6 libsqlite3.so


7. Run SQLite
Execute the sqlite3 command on the Development Board and see the following message stating that the sqlite3 transplant was successful!
1234567 sqlite3SQLite version 3.8.5 2014-06-04 14:06:34Enter ".help" for usage hints.Connected to a transient in-memory database.Use ".open FILENAME"to reopen on a persistent database.sqlite>

Use the. Help to view assistance and use. Quit to exit the SQLite command.

Finally, the Arm-2010q1-202-arm-none-linux-gnueabi compiled sqlite3 image is attached and tested to work correctly on the myd-am335x:
<ignore_js_op>sqlite3.zip (444.45 KB, download number: 1528)

Successfully ported SQLite3 to arm Linux Development Board

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.