2004-06-01 05:45:11 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-08-28 20:19:00 +04:00
|
|
|
# This script is used to compile SQLite into a DLL.
|
2004-06-01 05:45:11 +04:00
|
|
|
#
|
2004-08-28 20:19:00 +04:00
|
|
|
# Two separate DLLs are generated. "sqlite3.dll" is the core
|
|
|
|
# library. "tclsqlite3.dll" contains the TCL bindings and is the
|
|
|
|
# library that is loaded into TCL in order to run SQLite.
|
2004-06-01 05:45:11 +04:00
|
|
|
#
|
|
|
|
make target_source
|
|
|
|
cd tsrc
|
|
|
|
PATH=$PATH:/opt/mingw/bin
|
2004-08-28 20:19:00 +04:00
|
|
|
TCLDIR=/home/drh/tcltk/846/win/846win
|
|
|
|
TCLSTUBLIB=$TCLDIR/libtcl84stub.a
|
2004-06-01 05:45:11 +04:00
|
|
|
OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DTHREADSAFE=1'
|
2004-08-28 20:19:00 +04:00
|
|
|
CC="i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR"
|
2004-06-01 05:45:11 +04:00
|
|
|
rm shell.c
|
|
|
|
for i in *.c; do
|
|
|
|
CMD="$CC -c $i"
|
|
|
|
echo $CMD
|
|
|
|
$CMD
|
|
|
|
done
|
2004-08-28 20:19:00 +04:00
|
|
|
echo 'EXPORTS' >tclsqlite3.def
|
|
|
|
echo 'Tclsqlite3_Init' >>tclsqlite3.def
|
2005-02-23 03:26:12 +03:00
|
|
|
echo 'Tclsqlite_Init' >>tclsqlite3.def
|
2004-08-28 20:19:00 +04:00
|
|
|
echo 'Sqlite3_Init' >>tclsqlite3.def
|
2005-02-23 03:26:12 +03:00
|
|
|
echo 'Sqlite_Init' >>tclsqlite3.def
|
2004-08-28 20:19:00 +04:00
|
|
|
i386-mingw32msvc-dllwrap \
|
|
|
|
--def tclsqlite3.def -v --export-all \
|
|
|
|
--driver-name i386-mingw32msvc-gcc \
|
|
|
|
--dlltool-name i386-mingw32msvc-dlltool \
|
|
|
|
--as i386-mingw32msvc-as \
|
|
|
|
--target i386-mingw32 \
|
|
|
|
-dllname tclsqlite3.dll -lmsvcrt *.o $TCLSTUBLIB
|
|
|
|
i386-mingw32msvc-strip tclsqlite3.dll
|
|
|
|
rm tclsqlite.o
|
2004-06-01 05:45:11 +04:00
|
|
|
i386-mingw32msvc-dllwrap \
|
|
|
|
--def sqlite3.def -v --export-all \
|
|
|
|
--driver-name i386-mingw32msvc-gcc \
|
|
|
|
--dlltool-name i386-mingw32msvc-dlltool \
|
|
|
|
--as i386-mingw32msvc-as \
|
|
|
|
--target i386-mingw32 \
|
|
|
|
-dllname sqlite3.dll -lmsvcrt *.o
|
|
|
|
i386-mingw32msvc-strip sqlite3.dll
|
|
|
|
cd ..
|