xref: /sqlite-3.40.0/mkso.sh (revision 66f9de03)
14aec8b65Sdrh#!/bin/sh
24aec8b65Sdrh#
34aec8b65Sdrh# This script is used to compile SQLite into a shared library on Linux.
44aec8b65Sdrh#
54aec8b65Sdrh# Two separate shared libraries are generated.  "sqlite3.so" is the core
64aec8b65Sdrh# library.  "tclsqlite3.so" contains the TCL bindings and is the
74aec8b65Sdrh# library that is loaded into TCL in order to run SQLite.
84aec8b65Sdrh#
94aec8b65Sdrhmake target_source
104aec8b65Sdrhcd tsrc
114aec8b65Sdrhrm shell.c
124aec8b65SdrhTCLDIR=/home/drh/tcltk/846/linux/846linux
134aec8b65SdrhTCLSTUBLIB=$TCLDIR/libtclstub8.4g.a
14383736b7SdrhOPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DHAVE_DLOPEN=1'
15*66f9de03SdrhOPTS="$OPTS -DSQLITE_THREADSAFE=1"
16*66f9de03SdrhOPTS="$OPTS -DSQLITE_ENABLE_FTS3=1"
17*66f9de03SdrhOPTS="$OPTS -DSQLITE_ENABLE_COLUMN_METADATA=1"
184aec8b65Sdrhfor i in *.c; do
1949766d6cSdrh  if test $i != 'keywordhash.c'; then
204aec8b65Sdrh    CMD="cc -fPIC $OPTS -O2 -I. -I$TCLDIR -c $i"
214aec8b65Sdrh    echo $CMD
224aec8b65Sdrh    $CMD
2349766d6cSdrh  fi
244aec8b65Sdrhdone
254aec8b65Sdrhecho gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
264aec8b65Sdrhgcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
274aec8b65Sdrhstrip tclsqlite3.so
284aec8b65Sdrhrm tclsqlite.c tclsqlite.o
294aec8b65Sdrhecho gcc -shared *.o -o sqlite3.so
304aec8b65Sdrhgcc -shared *.o -o sqlite3.so
314aec8b65Sdrhstrip sqlite3.so
324aec8b65Sdrhcd ..
33