Port sqlite to arm-linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. I have always wanted to write a sqlite paper, but I have to drag it on. Today I finally made another decision. First, we can solve the problem of porting sqlite to arm-linux. I found a batch of articles online. Thanks to ybc and yeshi for their articles. However, the sqlite versions they use are relatively old, and many of them are not practical.
First, download sqlite-3.3.13.tar.gz at http://www.sqlite.org/download.html.
$ Tar-zxvf sqlite-3.3.13.tar.gz ~ /Sqliteforuclinux/
$ Cd sqliteforuclinux/sqlite-3.3.13
View readme. The content is:
For example:
Tar xzf sqlite.tar.gz; # Unpack the source tree into "sqlite"
Mkdir bld; # Build will occur in a sibling directory
Cd bld; # Change to the build directory
../Sqlite/configure; # Run the configure script
Make; # Run the makefile.
Make install; # (Optional) Install the build products
What we need to do now is cross-compile. If it is compiled for the local machine, you can just do it.
Modify part of the configure file in the bld/directory
20420 rows {(exit 1); exit 1 ;};}changed to {(echo 1); echo 1 ;};}
20446 rows {(exit 1); exit 1 ;};}changed to {(echo 1); echo 1 ;};}
Run the following statement in the/bld/Makefile file:
BCC = arm-linux-gcc-g-O2
Changed:
BCC = gcc-g-O2 // The red font is pasted on the top. I don't need to change it. It's already BCC = gcc-g.
(I do not need to change it)
$ Make
$ Make install
In the bld/lib directory, the library file has been generated. You can use strip to reduce the size of the execution file and remove the debugging information.
Arm-linux-strip libsqlit3.so. 0
In this process, I first encountered a problem that I don't know the compiler and solved the problem by modifying the environment variables. This article does not mention the link tag problem. I need to modify the makefile file, put -- tag = arm-linux behind the link segment of the libtool field, remove $ (TCC), or leave a space before $ (TCC) and add -- tag = CC.
After compilation, copy the file to the Development Board for testing.
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.