How to port embedded database SQLite to S3C2410

Source: Internet
Author: User

The following is my working directory, which can be adjusted according to your own situation.

1. Cross-compiling environment establishment: used for cross-compiling SQLite

Install cross-2.95.3.tar.bz2 to the/usr/local/ARM directory.

Unzip the sqlite-3.3.8 to/usr/localsqlite-arm/sqlite-3.3.8 and create a folder

CD/usr/localsqlite-arm/sqlite-3.3.8

Mkdir SQLite-arm-Linux (this folder path can be customized)

2. Modify VI configure or open the file through gedit.

20420 rows {(Exit 1); Exit 1 ;};}changed to {(Echo 1); Echo 1 ;};}

20446 rows {(Exit 1); Exit 1 ;};}changed to {(Echo 1); Echo 1 ;};}

Next, run./configure -- disable-TCL -- prefix =/usr/local/SQLite-arm/SQLite-plant/-- Host = arm-Linux.

The following error is returned:

Configure: Error: unable to find a compiler for building build tools
Previously, we checked that arm-Linux-GCC had passed. why didn't we find the compiler? It took some time to read the configure script, which was too complicated. I also checked it with Configure. ac. The environment variables config_target_cc and config_build_cc were originally set. Config_target_cc is a cross compiler, and config_build_cc is a host compiler.

Redo:
[Root @ Linux sqlite-3.3.4] # export config_build_cc = gcc
[Root @ Linux sqlite-3.3.4] # export config_target_cc = arm-Linux-gcc
Compile it again. This is normal.

./Configure -- disable-TCL -- prefix =/usr/local/SQLite-arm/SQLite-plant/-- Host = arm-Linux

Make

Make install

Then you can

/Usr/local/SQLite-arm/SQLite-plant/

The directory contains three folders: Bin lib include. This is the best file to be transplanted to the Development Board.

The library file has been generated. You can use strip to reduce the execution file size and remove the debugging information.
Arm-Linux-strip libsqlit3.so. 0.8.6
Arm-Linux-strip sqlite3
Port
Note:
To copy a file, you must add the-Arn option because libsqlite3.so and libsqlite3.so. 0 are linked to libsqlite3.so. 0.8.6.
CD/usr/local/SQLite-arm/SQLite-plant/lib
CP-ASON libsqlite3.so libsqlite3.so. 0. libsqlite3.so. 0.8.6/SQLite-for-Plant
CD/usr/local/SQLite-arm/SQLite-plant/bin
CP sqlite3/SQLite-for-Plant
I have saved all the files to be transplanted to the SQLite-for-plant directory. Here, we can use it as needed.

Then, port the library files under sqlite3 and lib to the arm.

Run SQLite on the arm Board

Download the qlite3 file to your arm board,

There are many methods, you need to choose according to your own situation. Such as FTP, NFS, and serial port. OK, start running

Chmod + wx SQLite

[Root@www.linuxidc.com] #./sqlite3 zieckey. DB

./Sqlite3: Error while loading shared libraries: libsqlite3.so. 0: cannot open shared object file: no such file or directory

This is because the library is compiled in the form of dynamic connection, and all the library files are downloaded to the arm board.

Download all files in the/usr/local/ARM-Linux/SQLite-arm-Linux/lib directory to the arm board. Run again,

[Root@www.linuxidc.com] #./sqlite3 zieckey. DB

./Sqlite3: Error while loading shared libraries: libsqlite3.so. 0: cannot open shared object file: no such file or directory

An error occurred. Oh, we didn't set the environment variable,

I mounted them to the Development Board through NFS. All the files to be transplanted are mounted to the SQLite-for-plant directory in the/etc directory.

Assume that the library file is in the directory SQLite-for-plant under/etc on the arm board,

Set the environment as follows:

[Root@www.linuxidc.com] # export LD_LIBRARY_PATH =/etc/SQLite-for-plant: $ LD_LIBRARY_PATH is okay so you can run:

Root@www.linuxidc.com #./sqlite3

SQLite version 3.3.8

Enter ". Help" for instructions

SQLite>

OK.

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.