Debian Linux Cross-compile build of sqlite3 3.5.9 for Win32

Here is how to cross-compile sqlite3 3.5.9 for use on a Win32 platform.
download sqlite3 3.5.9 for win32 here or you can try building it yourself.
Included in the download is the libraries and header files, as well as
the sqlite3.exe binary and the pkgconfig file, for developers.  

I successfully cross-compiled sqlite3 from a debian/amd64 system by installing
a 32-bit chroot environment.  "apt-get install mingw32-* build-essential"
will get you the bare minimum requirements.  You cannot cross-compile from
a 64-bit environment because the build process bitches at you about being
on 64 bit.

I got the source code with "apt-get source libsqlite3-dev" - again, in
the chrooted environment (remember to add deb-src to /etc/apt/sources.list)

Create a "hints" file - config_mingw - with the following entries:
export config_BUILD_EXEEXT=""
export config_TARGET_EXEEXT=".exe"
export config_BUILD_CC="gcc"

Then, run this configure command:
    ./configure  --host=i586-mingw32msvc --with-hints=config_mingw 
                 --prefix=/home/lkcl/.wine/drive_c/MinGW/

If you prefer, create a symlink to /mingw on your root and set
--prefix=/mingw - somewhat excessive but you will get a pkgconfig
file that you won't have to edit by hand (like what has already been
done in the downloadable version, above).

Then run make and make install, then edit the sqlite3.pc that ended
up in your target's /mingw/lib/pkgconfig/ directory to point to
/mingw instead of the prefix specified above, and you're done.

Congratulations and hurrah.