Actions

Difference between revisions of "Sqlite"

From RonWareWiki

Line 7: Line 7:
 
<code language="bash">
 
<code language="bash">
 
#!/bin/sh
 
#!/bin/sh
 
+
# vim: ft=sh :
 +
 
tarfile=`ls -t sqlite*.tar.gz|head -n 1`
 
tarfile=`ls -t sqlite*.tar.gz|head -n 1`
tardir=`echo ${tarfile}|sed -e's/.tar.gz//'`
+
tardir=`echo ${tarfile}|sed -e's/.tar.gz//'|sed -e's/amalgamation-//'`
 
+
 
if [ "$tardir" == "" ]
 
if [ "$tardir" == "" ]
 
then
 
then
Line 22: Line 23:
 
fi
 
fi
  
if  configure --disable-tcl --enable-threadsafe CFLAGS="-O3 -s -mtune=i686 -fomit-frame-pointer -fmerge-all-constants"  
+
(
 +
export PATH=~/mingw/i386-mingw32msvc/bin:$PATH
 +
if  ./configure --host=i386-mingw32msvc --enable-threadsafe CFLAGS="-O3 -s -mtune=i686 -fomit-frame-pointer -fmerge-all-constants"  
 
then
 
then
 
echo "Building SQLITE"
 
echo "Building SQLITE"
if  gmake sqlite3.dll
+
if  make
 
then
 
then
 +
i386-mingw32msvc-gcc -shared -o sqlite3.dll sqlite3.o
 +
i386-mingw32msvc-strip sqlite3.dll
 
upx --best sqlite3.dll
 
upx --best sqlite3.dll
cp sqlite3.dll /c/rw/vim7/bin/sqlite3.dll
 
cp sqlite3.dll /c/rw/reva/bin/sqlite3.dll
 
 
else
 
else
 
echo "Could not build the DLL, sorry."
 
echo "Could not build the DLL, sorry."
Line 36: Line 39:
 
echo "Could not configure, sorry."
 
echo "Could not configure, sorry."
 
fi
 
fi
 +
)
 +
 +
popd
  
popd
 
  
 
</code>
 
</code>

Revision as of 08:33, 28 June 2009


I use the excellent SQLite relational database for all sorts of projects. My vim setup as well as my Reva Forth utilize it.

Here is a script I created to help me rebuild SQLite as new versions are available. The script runs on Windows using the 'MSys' bash shell:

  1. !/bin/sh
  2. vim: ft=sh :

tarfile=`ls -t sqlite*.tar.gz|head -n 1` tardir=`echo ${tarfile}|sed -e's/.tar.gz//'|sed -e's/amalgamation-//'`

if [ "$tardir" == "" ] then # no tar directory echo "We are presumably in the tar directory already" pushd . else # unpack the tar tar xzvf $tarfile pushd $tardir fi

( export PATH=~/mingw/i386-mingw32msvc/bin:$PATH if ./configure --host=i386-mingw32msvc --enable-threadsafe CFLAGS="-O3 -s -mtune=i686 -fomit-frame-pointer -fmerge-all-constants" then echo "Building SQLITE" if make then i386-mingw32msvc-gcc -shared -o sqlite3.dll sqlite3.o i386-mingw32msvc-strip sqlite3.dll upx --best sqlite3.dll else echo "Could not build the DLL, sorry." fi else echo "Could not configure, sorry." fi )

popd