Following the instructions here
http://sourceforge.net/project/shownotes.php?release_id=318305
on how to build the Qt/WinFree sources for Windows using a MinGW
cross-compiler on Linux.

Grab the Mingw X-Compiler rpms from http://mirzam.it.vu.nl/mingw/

Personally, I just wrote a little script to grab the binary rpms
for Fedora Core 3. However, the page also explains how to build
binary rpms from the src rpms.

    $ sh download.sh
    $ cat download.sh
    #! /bin/sh
    
    baseurl=http://mirzam.it.vu.nl/mingw/packages/fc3/
    
    for file in \
    mingw-binutils-2.15.91-7hl.i386.rpm \
    mingw-gcc-core-3.4.2-10hl.i386.rpm \
    mingw-runtime-3.7-11hl.i386.rpm \
    mingw-w32api-3.2-11hl.i386.rpm
    do
    	url=${baseurl}${file}
    	wget ${url}
    done
    
Installing them with:
    $ sh install.sh
    $ cat install.sh
    #! /bin/sh
    
    for file in \
    mingw-binutils-2.15.91-7hl.i386.rpm \
    mingw-gcc-core-3.4.2-10hl.i386.rpm \
    mingw-runtime-3.7-11hl.i386.rpm \
    mingw-w32api-3.2-11hl.i386.rpm
    do
    	rpm -Uvh $file
    done

This installs the MinGW binutils as
    /usr/local/i386-mingw32/bin/
        ar
        as
        dlltool
        ld
        ...
    
The MinGW runtime and w32api are installed as
    /usr/local/i386-mingw32/
        bin/
        include/
        lib/
    
The gcc cross compiler is installed as
    /usr/local/bin/
        i386-mingw32-cpp
        i386-mingw32-gcc
        i386-mingw32-gcc-3.4.2
        i386-mingw32-gccbug
        i386-mingw32-gcov

Bugger. No c++ compiler. I grabbed it from
    http://bitwalk.hp.infoseek.co.jp/src/gcc-mingw32-3.4.2-4.i386.rpm
    
Download the Qt/Win free sources.
Press return when prompted for the password:
    $ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/kde-cygwin \
          login
    $ cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/kde-cygwin \
          checkout -d qt3 -r QT_WIN32_3_3_BRANCH qt-3

Replace the native tools in $QTDIR/mkspecs/win32-g++/qmake.conf with
the equivalent cross compilers.

    $ sed -f xcompile_qmake.sed qt3/mkspecs/win32-g++/qmake.conf > tmp
    $ mv tmp qt3/mkspecs/win32-g++/qmake.conf
    $ cat xcompile_qmake.sed
    /QMAKE_CC/s/= *gcc/= i386-mingw32-gcc/
    /QMAKE_CXX/s/= *g++/= i386-mingw32-g++/
    /QMAKE_LIB/s/= *ar/= i386-mingw32-ar/
    /QMAKE_RC/s/= *windres/= i386-mingw32-windres/
    /QMAKE_STRIP/s/= *strip/= i386-mingw32-strip/

Create .qtwinconfig because otherwise qmake creates exe's with a
dll extension.

    $ echo '
    win32-g++:contains(TEMPLATE,lib) {
        contains(CONFIG,shared) {
        CONFIG += dll
        }
    }' > qt3/.qtwinconfig

Configure:
    $ cd qt3
    $ export QTDIR=$PWD
    $ export QMAKESPEC=win32-g++
    $ export PATH=$PWD/bin:$PATH
    $ make -f Makefile.cvs
    $ ./configure -no-cups -platform win32-g++ -shared
