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