Preliminary instructions for (cross-)compiling nget with mingw32.

It is assumed here that you are using a cross compiler.  If not, ignore the
--host and --build args and the CC,CXX,etc setting, and install whatever
software you need to run the configure script (sh, rm, etc). (Or create a
config.h by hand.)

mingw32 doesn't have many libraries, so at the bare minimum you must use popt
and pcre (and nget+uulib).

see http://nget.sourceforge.net/patches/ for the mentioned patches

POPT:
patch -p1 < popt-1.6.4-mingw32cross.patch
autoconf && autoheader
CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ ./configure --build=i386-linux --host=i586-mingw32msvc --prefix=/somedir/mingw32/popt1.6.4
make install

PCRE:
CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ ./configure --build=i386-linux --host=i586-mingw32msvc --disable-shared --prefix=/somedir/mingw32/pcre3.9
patch -p0 < pcre-3.9-mingw32cross.patch
make CC=gcc ./chartables.c
make install

ZLIB:
AR="i586-mingw32msvc-ar rc" RANLIB=i586-mingw32msvc-ranlib CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ ./configure --prefix=/somedir/mingw32/zlib1.1.4
mkdir /somedir/mingw32/zlib1.1.4
make install

NGET:
cd uulib
patch -p0 < uulib-0.5.18-mingw32cross.patch
autoconf && autoheader
AR=i586-mingw32msvc-ar RANLIB=i586-mingw32msvc-ranlib CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ ./configure --build=i386-linux --host=i586-mingw32msvc
make
cd ..

./configure --build=i386-linux --host=i586-mingw32msvc --with-popt-prefix=/somedir/mingw32/popt1.6.4/ --with-pcre-prefix=/somedir/mingw32/pcre3.9 --with-zlib-prefix=/somedir/mingw32/zlib1.1.4
make

all done!
