Compiling the GTK2 Crossfire client under Windows (MinGW)
v1.70T.1 (client version 1.70-TRUNK, instructions release #1)
------------------------------------------------------------------------------

These instructions will take you from a base MinGW installation and add all
the dependencies for the GTK2 client.


1) Install MinGW.  The easiest way (as of 2 Apr 2013) is by downloading
mingw-get-inst from http://www.mingw.org/wiki/Getting_Started

Follow the instructions for installing MinGW.  Specifically, it is suggested
that MinGW not be installed into a directory with a space in the name.


2) Use mingw-get to install libxml2:
   $ mingw-get install msys-libxml2

This version of libxml2 is really an internal library for mingw/msys.  It
is used so that pkg-config reports libxml2 is present.  The actual library
used by the crossfire client is the one in the packages we install in step 3.

Now go to step 3a or 3b, depending on whether you download the easy zip file
with all the dependencies (3a) or want to get all the individual libraries
manually (3b).


3a) All the rest of the dependencies for the current (1.70) version of the
Crossfire client have been combined together in one zip file:
"MinGWCrossfireDependenciesV1.70.1.zip".  This file is available at:
http://icculus.org/~kfitzner/misc/MinGWCrossfireDependenciesV1.70.1.zip

The version number of this file will be the version number of the client,
plus a number indicating the release number of the dependencies (in case
they have to be updated independent of a client release).

Copy this zip file to the root MinGW directory and unzip it.  Make sure
it is unzipped such that all the folders are expanded.

The zlib1.dll that ends up in the MinGW root directory needs to be copied
to your crossfire client source directory, to:
<CrossfireClient>/gtk-v2/src
It is this version of the DLL that will be packaged with the crossfire
client.

Now move on to step 4.


3b) Only do all this if you did not do 3a.
If you intend to get all the individual libraries yourself, then read on.
We can get about half our work done from one web site.  Navigate to:
http://www.gtk.org/download/win32.php and download the run-time and dev
packages for the following:
  GLib, ATK, Pango, gdk-pixbuf, GTK+, zlib, cairo, libpng, Freetype,
  Fontconfig, gettext-runtime, pkg-config

A comprehensive list of URLs for each package follows at the end.

Once you have each package, unzip them into the main MinGW installation
folder.  I did this by copying them into my MinGW installation directory
and then right-clicking each one and selecting "7-Zip->Extract Here".  This
should work for you as long as you have 7-Zip installed too.

You can also use the unzip command in MinGW for those packages that do
not require manual installation.
   $ cd /mingw
   $ unzip <package>

Some packages require manual steps to get them to work properly, and some
need to be installed totally manually.  Any manual steps are listed with
each package below.  Commands given are those that you would run from inside
MinGW.  Where a step says unzip to <mingw>/bin, then unzip and move the file
to bin inside the mingw installation directory.  Visual tools like 7-Zip make
this much easier.

PACKAGE LIST:

- Package-config tool & dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.26-1_win32.zip

- Glib 2.28.8 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib-dev_2.28.8-1_win32.zip

- GetText 0.18.1.1 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-dev_0.18.1.1-2_win32.zip

- libpng 1.4.3 bin and dev (manual steps required)
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.4.3-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.26-1_win32.zip

  You need to make a copy of the library so the Crossfire configure script can find it:
   $ cp /mingw/lib/libpng14.dll.a /mingw/lib/libpng.dll.a
   $ cp /mingw/bin/libpng14-14.dll /mingw/bin/libpng.dll

- GTK+ 2.24.10 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+_2.24.10-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-dev_2.24.10-1_win32.zip

- Pango 1.29.4 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.29/pango_1.29.4-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.29/pango-dev_1.29.4-1_win32.zip

- cairo 1.10.2 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.10.2-2_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo-dev_1.10.2-2_win32.zip

- Fontconfig 2.8.0 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.4.2-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig-dev_2.8.0-2_win32.zip

- Freetype 2.4.2 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.4.2-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype-dev_2.4.2-1_win32.zip

- gdk-pixbuf 2.24.0 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/gdk-pixbuf/2.24/gdk-pixbuf_2.24.0-1_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/gdk-pixbuf/2.24/gdk-pixbuf-dev_2.24.0-1_win32.zip

- ATK 1.32.0 bin and dev
   http://ftp.gnome.org/pub/gnome/binaries/win32/atk/1.32/atk_1.32.0-2_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/atk/1.32/atk-dev_1.32.0-2_win32.zip

- zlib 1.2.5 bin and dev (note: this is in addition to the zlib noted below)
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib_1.2.5-2_win32.zip
   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib-dev_1.2.5-2_win32.zip

- zlib 1.2.3 dll only (manual installation required)
   http://sourceforge.net/projects/gnuwin32/files/zlib/1.2.3/zlib-1.2.3-bin.zip/download

  This version is required because another library (libcurl) is compiled
  against this and uses DLL ordinals rather than exported names.  This DLL
  will end up being the one that is used by the client.  Package this one
  with the client binary.
  Do NOT place this one in the mingw system.  Unzip the DLL only from this
  package and place it directly into <CrossfireClient>/gtk-v2/src

- libglade 2.6.4 bin and dev
   http://ftp.gnome.org/pub/GNOME/binaries/win32/libglade/2.6/libglade_2.6.4-1_win32.zip
   http://ftp.gnome.org/pub/GNOME/binaries/win32/libglade/2.6/libglade-dev_2.6.4-1_win32.zip

- libcurl 7.18.0 (requires manual installation)
   http://curl.haxx.se/download/libcurl-7.18.0-win32-msvc.zip

  This is a MSVC version of libcurl that also works with MinGW with manual
  installation:
  Unzip include/curl/* to <mingw>/include/curl
  Unzip libcurl.dll to <mingw>/bin
  Unzip and rename libcurl.lib to <mingw>/lib/libcurl.dll.a

- libglut 3.7.6 (requires manual installation - see also http://www.opengl.org/wiki/MinGW)
   http://www.xmission.com/~nate/glut/glut-3.7.6-bin.zip

  Unzip glut.h to <mingw>/include/GL/glut.h
  Unzip and rename glut32.dll to <mingw>/bin/libglut.dll
  Unzip and rename glut32.lib to <mingw>/lib/libglut.dll.a

- libxml 2.4.12 (requires manual installation)
   http://sourceforge.net/projects/gnuwin32/files/libxml/2.4.12-1/libxml2-2.4.12-bin.zip/download

  Unzip and rename libxml2.dll to <mingw>/bin/libxml2-2.dll

- SDL 1.2.15 (requires manual installation)
   http://www.libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz

  Untar bin/sdl-config to <mingw>/bin/sdl-config
  Using any editor you like, edit sdl-config - line 3 should be: prefix=/mingw
  Untar bin/SDL.dll to <mingw>/bin/SDL.dll
  Untar include/SDL/* to <mingw>/include/SDL
  Untar lib/* to <mingw>/lib


4) A couple changes (as of client version 1.70) need to be made to the client:

  Edit <CrossfireClient>/gtk-v2/src/config.c - line 46 should read:
  #ifdef __MINGW32__

  Edit <CrossfireClient>/gtk-v2/src/Makefile.in - line 90 shold read:
  $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(GTK_CFLAGS) $(LIBGLADE_CFLAGS)
  That is just adding "$(GTK_CFLAGS) $(LIBGLADE_CFLAGS)" at the end


5) Before you run configure, you need to export the PKG_CONFIG_PATH variable:
   $ export PKG_CONFIG_PATH=/usr/lib/pkgconfig
   If you forget this step, you will get compilation errors indicating the
   compiler can't find glade-related include files.  You will have to
   perform this step, and then run configure again before you run make.


Done.

You should now be able to configure and make the client.  No special arguments
to configure should be needed.  You should get an SDL and OpenGL enabled client.
