|
Packit Service |
e31a56 |
#!/bin/sh
|
|
Packit Service |
e31a56 |
#
|
|
Packit Service |
e31a56 |
# This script is used to compile SQLite into a shared library on Linux.
|
|
Packit Service |
e31a56 |
#
|
|
Packit Service |
e31a56 |
# Two separate shared libraries are generated. "sqlite3.so" is the core
|
|
Packit Service |
e31a56 |
# library. "tclsqlite3.so" contains the TCL bindings and is the
|
|
Packit Service |
e31a56 |
# library that is loaded into TCL in order to run SQLite.
|
|
Packit Service |
e31a56 |
#
|
|
Packit Service |
e31a56 |
make target_source
|
|
Packit Service |
e31a56 |
cd tsrc
|
|
Packit Service |
e31a56 |
rm shell.c
|
|
Packit Service |
e31a56 |
TCLDIR=/home/drh/tcltk/846/linux/846linux
|
|
Packit Service |
e31a56 |
TCLSTUBLIB=$TCLDIR/libtclstub8.4g.a
|
|
Packit Service |
e31a56 |
OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DHAVE_DLOPEN=1'
|
|
Packit Service |
e31a56 |
OPTS="$OPTS -DSQLITE_THREADSAFE=1"
|
|
Packit Service |
e31a56 |
OPTS="$OPTS -DSQLITE_ENABLE_FTS3=1"
|
|
Packit Service |
e31a56 |
OPTS="$OPTS -DSQLITE_ENABLE_COLUMN_METADATA=1"
|
|
Packit Service |
e31a56 |
for i in *.c; do
|
|
Packit Service |
e31a56 |
if test $i != 'keywordhash.c'; then
|
|
Packit Service |
e31a56 |
CMD="cc -fPIC $OPTS -O2 -I. -I$TCLDIR -c $i"
|
|
Packit Service |
e31a56 |
echo $CMD
|
|
Packit Service |
e31a56 |
$CMD
|
|
Packit Service |
e31a56 |
fi
|
|
Packit Service |
e31a56 |
done
|
|
Packit Service |
e31a56 |
echo gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
|
|
Packit Service |
e31a56 |
gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
|
|
Packit Service |
e31a56 |
strip tclsqlite3.so
|
|
Packit Service |
e31a56 |
rm tclsqlite.c tclsqlite.o
|
|
Packit Service |
e31a56 |
echo gcc -shared *.o -o sqlite3.so
|
|
Packit Service |
e31a56 |
gcc -shared *.o -o sqlite3.so
|
|
Packit Service |
e31a56 |
strip sqlite3.so
|
|
Packit Service |
e31a56 |
cd ..
|