Sqlite3 porting to arm Linux

Source: Internet
Author: User

1, Environment:

Software: linux:2.6.38

Hardware: 6410

Cross-compilation tool: ARM-LINUX-GCC

Also applies to other Linux platforms.

2, Step:

1 "Download Sqlite3 Source package:

Http://www.sqlite.org/sqlite-amalgamation-3.6.1.tar.gz

2 "Copy to working directory/TMP

CP sqlite-amalgamation-3.6.1.tar.gz/tmp

3 "Extract Source directory

Tar xvzf sqlite-amalgamation-3.6.1.tar.gz

4 "Configuration

Enter the source directory

./configure--prefix=/nfs/sqlite--target=arm-linux--host=arm-linux ld=arm-linux-ld

Note:/nfs is the directory where my board mounts the root file system,

Arm-linux is a cross compiler prefix, for example your cross compiler is ARM-LINUX-GCC, removing the remainder of the-GCC. Both the host and the LD need to be changed.

5 "Compilation

Make

6 "Installation

Make install

After the completion of the/nfs/sqlite directory there will be bin,include,lib three directories.

7. Copy the generated header files and library to the board

cp/nfs/sqlite/bin/*/nfs/usr/bin

cp/nfs/sqlite/lib/*/nfs/lib

8. Writing Test files: test.c

Slightly.

9 "Compilation

Arm-linux-gcc-i/nfs/sqlite/include-l/nfs/sqlite/lib-lsqlite3 Test.c-o Test

10 "If you do not want to add the-l and-i option at compile time, you need to copy the library and executable files to the Lib and bin directory of the cross-compilation environment, which will be found automatically when compiling.

The specific command is slightly.

11 "It is also important to note that if you are using BOA to open the database file, you need to copy the database file to a directory under the root directory of the BOA configuration, and then specify the directory when you call the Sqlite3_open function.

Sqlite3 porting to arm Linux

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.