We are going to cross-compile SQLite3 database for ARM architecture.
Download source code
SQLite download page: (This page needs JavaScript enabled)
http://www.sqlite.org/download.html
We download tar.gz source code.
$ wget http://www.sqlite.org/2017/sqlite-autoconf-3160200.tar.gz
$ tar xvzf sqlite-autoconf-3160200.tar.gz
$ cd sqlite-autoconf-3160200/
Configure for cross-compilation
When executing configure script we indicate:
- arm-linux in host option
- the location of the C cross-compiler from our toolchain in CC option
- Set prefix option to a place where you want to install SQLite3
$ ./configure --host=arm-linux --prefix=devel/Libs CC=/opt/compiler/glibc-oabi-toolchain-arm-generic/bin/arm-unknown-linux-gnu-gcc
Build and Install
The process to compile is straight forward
$ make
A binary sqlite3 appears and libraries are placed in .libs directory:
$ ls -l .libs total 8364 -rw-r--r--. 1 root root 2926316 Jan 23 21:23 libsqlite3.a lrwxrwxrwx. 1 root root 16 Jan 23 21:23 libsqlite3.la -> ../libsqlite3.la -rw-r--r--. 1 root root 958 Jan 23 21:23 libsqlite3.lai lrwxrwxrwx. 1 root root 19 Jan 23 21:23 libsqlite3.so -> libsqlite3.so.0.8.6 lrwxrwxrwx. 1 root root 19 Jan 23 21:23 libsqlite3.so.0 -> libsqlite3.so.0.8.6 -rwxr-xr-x. 1 root root 2655892 Jan 23 21:23 libsqlite3.so.0.8.6 -rw-r--r--. 1 root root 2969604 Jan 23 21:22 sqlite3.o
To install them:
$ make install
sqlite3 and libsqlite3 binaries can now be used in an ARM platform.