
  COMPILATION INSTRUCTIONS

** Getting sources **

First get required sources and extract them in a build directory. We use
separated compilers environments for 32 and 64-bit builds (multiarch is
not supported), so these instructions use out-of-tree builds. Note that
we use mingw-w64 project headers and libraries (SVN version) for both
32 and 64-bit builds because even on win32 they are far better.

$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.bz2
$ tar -jxf binutils-2.20.1.tar.bz2
$ wget http://gcc.fyxm.net/releases/gcc-4.5.1/gcc-4.5.1.tar.bz2
$ tar -jxf gcc-4.5.1.tar.bz2

SVN version of mingw-w64 is required:
$ svn co https://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64 mingw-w64-svn


** 32-bit environment **

* binutils

$ mkdir binutils-2.20.1-mingw32 && cd binutils-2.20.1-mingw32
$ ../binutils-2.20.1/configure --prefix=/usr/local/ --target=i686-mingw32
$ make
$ make install
$ ln -s /usr/local/i686-mingw32/ /usr/local/i686-pc-mingw32
$ ln -s /usr/local/i686-mingw32/ /usr/local/i686-w64-mingw32

* mingw-w64 headers

$ mkdir mingw-w64-headers32 && cd mingw-w64-headers32
$ ../mingw-w64-svn/mingw-w64-headers/configure --host=i686-mingw32 --prefix=/usr/local/ --enable-sdk=all
$ make install

* GCC compiler

$ mkdir gcc-4.5.1-mingw32 && cd gcc-4.5.1-mingw32
$ ../gcc-4.5.1/configure --prefix=/usr/local/ --target=i686-mingw32 --with-gnu-ld --with-gnu-as --enable-__cxa_atexit --enable-languages=c,c++
$ make all-gcc
$ make install-gcc

* mingw-w64 crt

$ mkdir mingw-w64-lib32 && cd mingw-w64-lib32
$ ../mingw-w64-svn/mingw-w64-crt/configure --host=i686-mingw32 --prefix=/usr/local/
$ make
$ make install

* Finnishing GCC

$ cd gcc-4.5.1-mingw32
$ make
$ make install
$ rm /usr/local/lib/gcc/i686-mingw32/4.5.1/include/float.h


** 64-bit environment **

* binutils

$ mkdir binutils-2.20.1-mingw64 && cd binutils-2.20.1-mingw64
$ ../binutils-2.20.1/configure --prefix=/usr/local/ --target=x86_64-w64-mingw32 --disable-multilib
$ make
$ make install

* mingw-w64 headers

$ mkdir mingw-w64-headers64 && cd mingw-w64-headers64
$ ../mingw-w64-svn/mingw-w64-headers/configure --host=x86_64-w64-mingw32 --prefix=/usr/local/ --enable-sdk=all
$ make install

* GCC compiler

$ mkdir gcc-4.5.1-mingw64 && cd gcc-4.5.1-mingw64
$ ../gcc-4.5.1/configure --target=x86_64-w64-mingw32 --disable-multilib --prefix=/usr/local/ --enable-languages=c,c++ --with-gnu-ld --with-gnu-as
$ make all-gcc
$ make install-gcc

* mingw-w64 crt

$ mkdir mingw-w64-lib64 && cd mingw-w64-lib64
$ ../mingw-w64-svn/mingw-w64-crt/configure --host=x86_64-w64-mingw32 --prefix=/usr/local/
$ make
$ make install

* Finishing GCC

$ cd gcc-4.5.1-mingw64
$ make
$ make install

** Compiling wine_gecko **

Choose the right mozconfig file. There is a few available in wine subdirectory of source top directory:

mozconfig            32-bit Wine Gecko optimized build
mozconfig-dbg        32-bit Wine Gecko debug build
mozconfig64          64-bit Wine Gecko optimized build
mozconfig64-dbg      64-bit Wine Gecko debug build
mozconfig-browser    32-bit Firefox debug build

$ export MOZCONFIG=/path/to/chosen/mozconfig

Do the compilation from source top directory by running commands:

$ make -f client.mk build
$ wine/make_package ../wine_gecko

Now you have a complete build in ../wine_gecko/dist/wine_gecko. You may already use it by copying or symlinking
it from c:\windows\gecko\1.0.0\wine_gecko (and setting up the registry correctly). To make it a proper package,
you'll have to archive it to CAB file. Unfortunately there is no good CAB tool for Linux, but that's what Wine
may be useful for. Note that Wine builtin cabinet.dll can't compress files well. Official packages are compressed
on Windows XP using Filzip.
