Actions

Sqlite

From RonWareWiki


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 :
  3. PATH includes $(HOME)/mingw/bin

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

die() { echo "$2" exit $1 }

oldpwd=`pwd`

if [ "$tardir" != "" ] then # unpack the tar tar xzvf $tarfile cd $tardir fi

if [ ! -f "sqlite3.pc.in" ] then die 3 "This doesn't appear to be a SQLite distribution directory" fi

( export PATH=~/mingw/i686-pc-mingw32/bin:$PATH ./configure --host=i686-pc-mingw32 --enable-threadsafe CFLAGS="-O3 -s -mtune=i686 -fomit-frame-pointer -fmerge-all-constants" \ || die 1 "Could not configure, sorry."

echo "Building SQLITE"

make || die 2 "Could not build the DLL, sorry."

i686-pc-mingw32-gcc -shared -o sqlite3.dll sqlite3.o i686-pc-mingw32-strip sqlite3.dll upx --best sqlite3.dll )

cd $oldpwd