If you want to talk less, go straight to the topic. Here is the procedure for porting:
1. Transplantation
First download SQLite 3.3.8 from here. The following example shows how to store data in the/root directory.
# Cd/root
# Tar zxvf sqlite-3.3.8.tar.gz
After decompression, A sqlite-3.3.8/subdirectory is generated under the/root directory that contains all the source files and configuration scripts required for compilation. All SQLite3 source code files are located under the sqlite-3.3.8/src/directory. Compiling SQLite3 in a PC environment cannot generate a Makefile file by using the configure script in the sqlite-3.3.8/directory. Instead, you must manually modify the Makefile file. There is a Makefile sample file Makefile. linux-gcc in the sqlite-3.3.8/directory. First, run the following command to copy the file and rename it as Makefile:
# Cp Makefile. linux-gcc Makefile
Next, use vim to open the Makefile file and manually modify the content of the Makefile. First, find the following line in the Makefile file:
TOP = ../sqlite
Modify it:
TOP =.
Find the following line:
TCC = gcc-O6
Modify it:
TCC = arm-linux-gcc-O6
Find the following line:
AR = ar cr
Modify it:
AR = arm-linux-ar cr
Find the following line:
RANLIB = ranlib
Modify it:
RANLIB = arm-linux-ranlib
Find the following line:
MKSHLIB = gcc-shared
Modify it:
MKSHLIB = arm-linux-gcc-shared
Comment out the following line:
TCL_FLAGS =-I/home/drh/tcltk/8.4 linux
Comment out the following line:
LIBTCL =/home/drh/tcltk/8.4 linux/libtcl8.4g. a-lm-ldl
In principle, modifications to Makefile mainly include two aspects: first, replace the compiler and archive tools with the corresponding tools in the Cross tool chain, for example, replacing gcc with arm-linux-gcc, replace ar with ar-linux-ar, and replace ranlib with arm-linux-ranlib. Second, remove the TCL-related compilation options, because by default, bind the Tcl language that will compile SQLite3, but it is not required when porting it to ARM-Linux. Therefore, comment out two lines related to TCL.