Development:MSYS/MinGW
Adonthell Development on Windows
Overview
This page is largely based on the README.Win32 that comes with Adonthell's source code and describes how to set up an environment for developing Adonthell on Windows. In contrast to latter it doesn't assume that you are a Unix guru already.
The general idea is to create a small Unix-like environment on your Windows system that can host Adonthell, which has its origins in the GNU/Linux world. That way, development on Adonthell can be consistent across platforms without the need to accommodate for radically different build systems and compilers.
Install MSYS/MinGW
Download the following files from the MinGW website and install in this order:
Follow these instructions if you need help with the installation. Afterwards, launch MSys from the Windows Start Menu.
Since MSYS does not include the program <tt>more</tt> we'll have to create a symlink:
ln -s /usr/bin/less.exe /usr/bin/more
We also have to set a number of environment variables. To make them persistent, we add them to ~/.profile:
echo "export CFLAGS=-I/usr/local/include" >> ~/.profile echo "export CPPFLAGS=-I/usr/local/include" >> ~/.profile echo "export CXXFLAGS=-I/usr/local/include" >> ~/.profile echo "export LDFLAGS=-L/usr/local/lib" >> ~/.profile echo "export SWIG_LIB=/usr/local/share/swig/1.3.29" >> ~/.profile echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" >> ~/.profile echo "export CMAKE_INCLUDE_PATH=/usr/local/include" >> ~/.profile echo "export CMAKE_LIBRARY_PATH=/usr/local/lib" >> ~/.profile
You can check that they were added correctly with <tt>more ~/.profile</tt>. If you wonder why we don't use an editor to modify that file: the editor that comes with MSYS is vi, which might feel strange if you never used it before. You should consider learning it though, if you don't want to switch between the shell and a graphical text editor just to make small changes to some files.
Install Adonthell Prerequisites
Now that a minimal unix system is installed, you can setup all of Adonthell's Dependencies. For the most part, just download the source code of the most recent version to a common directory, such as <tt>C:\adonthell-dev</tt>. Then, in the MSYS shell, change into that directory
cd /c/adonthell-dev
and extract the archive using the <tt>tar</tt> command. Mind the different program options for different types of archives. E.g.
tar -xzf libtool-1.5.22.tar.gz tar -xjf libpng-1.2.8.tar.bz2
Unless noted otherwise, change into the directory you just unpacked and run the following set of commands for each dependency:
./configure --prefix=/usr/local make make install
Some of the dependencies neat special treatment to get them installed, although newer versions might fix these issues. They are listed below.
Python
Python doesn't compile without patching the source code. Instead, the following method seems the path with the least resistance:
- Download python-2.4.3.msi [4] and execute the installer. Chose a installation directory without whitepace in the pathname, e.g <tt>C:\Python2.4</tt>
- Download pyMinGW-bin-core-2.4.3.1.zip [5]
- Extract this over your Python installation to replace corresponding files.
- Copy contents of the MinGW folder to the toplevel Python2.4 folder to replace the executables and dll file
- Create links to Python library and header files in MSYS:
ln -s /c/Python2.4/python24.dll /usr/local/bin/python24.dll ln -s /c/Python2.4/libs/libpython24.a /usr/local/lib/libpython24.a ln -s /c/Python2.4/python.exe /usr/local/bin/python.exe ln -s /c/Python2.4/include /usr/local/include/python2.4 ln -s /c/Python2.4/Lib /usr/local/lib/python2.4
SDL
To compile SDL with DirectX support, get the directx-devel package [6] from the SDL website and extract into /usr/local . The compile as per standard instructions above.
zlib
zlib 1.2.3 doesn't use configure. Instead run the following commands.
make -f win32/Makefile.gcc make install -f win32/Makefile.gcc INCLUDE_PATH=/usr/local/include LIBRARY_PATH=/usr/local/lib cp zlib1.dll /usr/local/bin/
Freetype2
Version 2.2.1 required those commands to compile
./configure LDFLAGS="'-no-undefined -L/usr/local/lib'" --prefix=/usr/local mingw32-make make install
Libxml2
Version 2.2.1 required those commands to compile
./configure --without-python --prefix=/usr/local make make install
libvorbis
Version 1.1.2 requires a little tweak after the <tt>configure</tt> step. Edit lib/Makefile and replace line
libvorbisfile_la_LIBADD = libvorbis.la
with
libvorbisfile_la_LIBADD = -logg libvorbis.la
Then continue with the standard <tt>make</tt> and <tt>make install</tt>.
libpng
Version 1.2.8 requires a little tweak after the <tt>configure</tt> step. Edit lib/Makefile and replace line
for ext in a la so; do\
with
for ext in a la; do\
Then continue with the standard <tt>make</tt> and <tt>make install</tt>.
pkg-config
There is no way to compile pkg-config yourself, as it requires glib 2.0, which in turn requires pkg-config. Instead get the binary version [7] and extract to /usr/local.
CMake
Get the binary zip file and place the 'bin', 'doc', 'man' and 'share' directories into /usr/local.