If you do not already have cross-configure.sh and cross-make.sh
please take a look at the section titled Convenient Scripts.
Also note that the scripts found in that section are different from the
ones found at libsdl.org. The instructions below were written for the
scripts found in that section and will not work with the ones from
libsdl.org.
ClanLib require some libraries. There are also some optional ones.
The instructions below is for building these libraries. If you are not
interested in building these libraries, you could download this tarball
(ExternalLibs.tar.gz) which contains all the libraries and header files
mentioned below except for directx (see next section)
and SDL (see section on SDL). To install from this
tarball, uzip/untar it. And do a cross-make.sh install in
the directory it creates.
You will need DirectX8 for ClanLib to compile properly on MinGW32.
To get the directx libs you could try some of the suggestions at http://www.spacejack.org/games/mingw/mingw-dx.html
or you could get Peter Puck's MinGW32 DirectX8 import libs at http://mywebpage.netscape.com/PtrPck/directx.htm
the file is called dx8libs.zip. To install Peter Puck's
MinGW32 DirectX8 import libs, do the following:
unzip dx8libs.zip) *.a files to your /path-to-your/cross-tools/dir/i586-mingw32msvc/lib
(cd dx8libs;cp *.a /path-to-your/cross-tools/dir/i586-mingw32msvc/lib)
Note: /path-to-your/cross-tools/dir/i586-mingw32msvc
is the path to your cross compile target directory. For example /usr/local/cross-tools/i586-mingw32msvc
. You might need root access to do this.
If you are using Peter Puck's import libs you will need to get the
DirectX headers from somewhere. You can try getting the headers from
Microsoft's sdk. Or you could get them by downloading the
zip
file called ExternalLibs.zip
from the ClanLib website http://www.clanlib.org/~sphair/download/external/ExternalLibs.zip,
and do the following (with the ExternalLibs.zip
file in
the current directory) to install:
unzip -d /path-to-your/cross-tools/dir/i586-mingw32msvc ExternalLibs.zip include/dx8/*
Note: /path-to-your/cross-tools/dir/i586-mingw32msvc
is the path to your cross compile target directory. For example /usr/local/cross-tools/i586-mingw32msvc.
You might need root access to do this.
To get zlib compiling under MinGW32, I would recommend you
download latest zlib
sources from http://www.gzip.org/zlib/
and use a modified Makefile provided for convenience here zlibMakefile.gcc
(this makefile is a modified version of Makefile.gcc found in the scripts subdirectory in the zlib source).
tar xzvf zlib-1.2.1.tar.gz
or tar xjvf zlib-1.2.1.tar.bz2 or unzip
zlib-1.2.1.zip)cp contrib/asm586/match.S ./match.S
cross-make.sh LOC=-DASMV OBJA=match.o -fzlibMakefile.gcc libz.a
cp contrib/asm686/match.S ./match.S
cross-make.sh LOC=-DASMV OBJA=match.o -fzlibMakefile.gcc libz.a
cross-make.sh -fzlibMakefile.gcc libz.a
cross-make.sh install -fzlibMakefile.gcc
NOTE: You may need to get root access to do this.
Get the libJPEG source files from ClanLib's website http://www.clanlib.org/~sphair/download/external/jpegsrc.v6b.tar.gz
tar xzvf jpegsrc.v6b.tar.gz)cross-configure.sh
cross-make.sh
cross-make.sh install-lib
Get the libPNG source files from ClanLib's website http://www.clanlib.org/~sphair/download/external/libpng-1.2.5.tar.gz
and use a modified Makefile provided for convenience here libPNGmakefile.gcmmx
(this makefile is
a modified version of makefile.gcmmx
found in the scripts subdirectory in the libPNG source).
LibPNG depends on zlib, so it would be a good idea to have zlib
compiled and installed first.
tar xzvf libpng-125.tar.gz)cross-make.sh -f libPNGmakefile.gcmmx
cross-make.sh install-static -f libPNGmakefile.gcmmx
Get the latest Hermes 1.3 sources from the ClanLib Hermes site http://www.clanlib.org/hermes/index.php?main=dls
and this slightly modified configure script configure
tar xzvf Hermes-1.3.3.tar.gz
or tar xjvf Hermes-1.3.3.tar.bz2)cross-configure.sh --disable-shared
cross-make.sh
cross-make.sh install
At this point you are ready to get ClanLib. However I would recommend getting the optional libraries as you might need them. The optional libraries listed on the ClanLib website are:
If you do not want to build any of these libraries, you can skip this step. Some of these libs might depend on directx as well, so it would be a good idea to install it first. Oh and there's also libSDL required by clanSDL, but I wouldn't recomend it if you do not absolutely need it.
Note that I wouldn't recommend building this, but here are the instructions if you need it. Get libSDL from http://www.libsdl.org/download-1.2.php.
tar xzvf SDL-1.2.6.tar.gz) cross-configure.sh
cross-make.sh
cross-make.sh install
Get the MikMod sources from the ClanLib website http://www.clanlib.org/~sphair/download/external/libmikmod-3.1.10.tar.gz
and the makefile provided hereMikModMakefile.mingw
(this
make file was converted by hand from the nmake Makefile.static
found in
the mikmod sources)
tar xzvf libmikmod-3.1.10.tar.gz) libmikmod-3.1.10/win32
subdirectorylibmikmod-3.1.10/win32
subdirectory:
cross-make.sh -f MikModMakefile.mingw
cross-make.sh -f MikModMakefile.mingw install
Get libOGG sources fromwww.vorbis.com
(http://www.vorbis.com/download_win_1.0.1.psp),
and a modified version of os_types.h provided here os_types.h
unzip libogg-1.0.1.zip)os_types.h file in thelibogg-1.0.1/include/ogg
directory, replacing the os_types.h file therelibogg-1.0.1 source
dir:
cross-configure.sh --disable-shared
cross-make.sh
cross-make.sh install
Get libVorbis sources fromwww.vorbis.com (http://www.vorbis.com/download_win_1.0.1.psp). LibVorbis depends on libOGG, so it would be a good idea to build libOGG first.
unzip libvorbis-1.0.1.zip)libvorbis-1.0.1 source
dir:
cross-configure.sh --disable-shared
cross-make.sh
cross-make.sh install