blob: 6f2e8e25edf4d00fdc28084458c6a62c35f96faf [file] [log] [blame]
drh4aec8b62004-08-28 16:19:00 +00001#!/bin/sh
2#
3# This script is used to compile SQLite into a shared library on Linux.
4#
5# Two separate shared libraries are generated. "sqlite3.so" is the core
6# library. "tclsqlite3.so" contains the TCL bindings and is the
7# library that is loaded into TCL in order to run SQLite.
8#
9make target_source
10cd tsrc
11rm shell.c
12TCLDIR=/home/drh/tcltk/846/linux/846linux
13TCLSTUBLIB=$TCLDIR/libtclstub8.4g.a
drh383736b2006-10-08 18:56:57 +000014OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DHAVE_DLOPEN=1'
drh66f9de02008-08-05 21:42:37 +000015OPTS="$OPTS -DSQLITE_THREADSAFE=1"
16OPTS="$OPTS -DSQLITE_ENABLE_FTS3=1"
17OPTS="$OPTS -DSQLITE_ENABLE_COLUMN_METADATA=1"
drh4aec8b62004-08-28 16:19:00 +000018for i in *.c; do
drh49766d62005-01-08 18:42:28 +000019 if test $i != 'keywordhash.c'; then
20 CMD="cc -fPIC $OPTS -O2 -I. -I$TCLDIR -c $i"
21 echo $CMD
22 $CMD
23 fi
drh4aec8b62004-08-28 16:19:00 +000024done
25echo gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
26gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
27strip tclsqlite3.so
28rm tclsqlite.c tclsqlite.o
29echo gcc -shared *.o -o sqlite3.so
30gcc -shared *.o -o sqlite3.so
31strip sqlite3.so
32cd ..