How to compile and build the SQLite library on Linux (Ubuntu)


The SQLitePass library uses specific SQLite functions to retrieve schema information on an SQL statement.

These functions are :

    • sqlite3_column_database_name
    • sqlite3_column_database_name16
    • sqlite3_column_table_name
    • sqlite3_column_table_name16
    • sqlite3_column_origin_name
    • sqlite3_column_origin_name16
    • sqlite3_table_column_metadata

Unfortunately, they are not always available in the precompiled library available on the SQLite webpage or in the sqlite package dedicated to your Linux distribution.

In order to get these functions in our sqlite3.so library, we need to compile the SQLite source code with the [SQLITE_ENABLE_COLUMN_METADATA] compiler directive.

This tutorial shows one simple way to achieve the library compilation and installation on linux (ubuntu). Feel free to post your comments if you are aware of a better "HowTo".

Now, If you want to compile your own SQLite library, follow this step by step tutorial :


Step 1 : Download the required SQLite files

Go to the SQLite webpage at http://www.sqlite.org/download.html and download the latest sqlite_amalgamation.x.x.xx.tar.gz file :

SQLite amalgation

Open the file with your favorite archive manager

Open With


Unzip the file in a new folder (/home/myname/sqlite3 for instance).

Open With











Step 2 : Edit the sqlite3.c file

Go to the Unzipped directory.

Open, edit and save the sqlite3.c file to add the line #define SQLITE_ENABLE_COLUMN_METADATA

Change SQLite code

















Open and read the INSTALL file instruction.


Open Install File Instructions



Step 3 : compile and install the library

Follow the INSTALL file instructions :


Open a console window and enter :

cd /home/luc/Documents/Developpement/sqlite-3.6.23.1  (in our example) to go to the directory where the sqlite3.c is located

Then type the following sentences :

./configure

make

make check

sudo make install You need to run 'make install' as root or with sudo...

Finally, sudo make clean

Your are ready to use the SQLitePassDbo components !
Have fun and feel free to post your comments or tips on the forum.