prev toc next

Compiling Libraries needed for ClanLib

Before we start

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.


Tarball of Libs

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.


DirectX

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:

  1. unzip the file (unzip dx8libs.zip)
  2. copy all the *.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.


Required Libraries for ClanLib

The required libraries for ClanLib as listed on the ClanLib website are:

Zlib

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).

  1. untar/unzip the zlib sources (tar xzvf zlib-1.2.1.tar.gz or tar xjvf zlib-1.2.1.tar.bz2 or unzip zlib-1.2.1.zip)
  2. put the modified Makefile in your zlib source directory
  3. do one of the following in the zlib source dir.
    • if you want to use the assembly instructions provided with zlib for 586 (pentium mmx and above) do the following:
      cp contrib/asm586/match.S ./match.S
      cross-make.sh LOC=-DASMV OBJA=match.o -fzlibMakefile.gcc libz.a
    • if you want to use the assembly instructions provided with zlib for 686 (pentium pro and above) do the following:
      cp contrib/asm686/match.S ./match.S
      cross-make.sh LOC=-DASMV OBJA=match.o -fzlibMakefile.gcc libz.a
    • if you don't want to use those or don't know what they are, then do the following:
      cross-make.sh -fzlibMakefile.gcc libz.a
  4. then do the following to install:
    cross-make.sh install -fzlibMakefile.gcc

    NOTE: You may need to get root access to do this.

libJPEG

Get the libJPEG source files from ClanLib's website http://www.clanlib.org/~sphair/download/external/jpegsrc.v6b.tar.gz

  1. untar/unzip the file (tar xzvf jpegsrc.v6b.tar.gz)
  2. do the following following in the libJPEG source dir:
    cross-configure.sh
    cross-make.sh
  3. do the following (you may need to do this as root) to install:
    cross-make.sh install-lib

libPNG

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.

  1. untar/unzip the file (tar xzvf libpng-125.tar.gz)
  2. put the modified Makefile in your libPNG source directory
  3. do the following in the libPNG source dir:
    cross-make.sh -f libPNGmakefile.gcmmx
  4. do the following (you may need to do this as root) to install:
    cross-make.sh install-static -f libPNGmakefile.gcmmx

Hermes 1.3

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

  1. untar/unzip the file (tar xzvf Hermes-1.3.3.tar.gz or tar xjvf Hermes-1.3.3.tar.bz2)
  2. put the configure script in the hermes source directory (replacing the original configure file there)
  3. do the following in the hermes source dir:
    cross-configure.sh --disable-shared
    cross-make.sh
  4. then do the following to install (you might need to do this as root):
    cross-make.sh install

Optional Libraries

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.

LibSDL

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.

  1. untar/unzip (tar xzvf SDL-1.2.6.tar.gz)
  2. In the source directory do the following to build:
    cross-configure.sh
    cross-make.sh
  3. do the following to install:
    cross-make.sh install

MikMod

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)

  1. untar/unzip (tar xzvf libmikmod-3.1.10.tar.gz)
  2. put the makefile in the libmikmod-3.1.10/win32 subdirectory
  3. do the following in the libmikmod-3.1.10/win32 subdirectory:
    cross-make.sh -f MikModMakefile.mingw
  4. then do the following (you may need root access) to install:
    cross-make.sh -f MikModMakefile.mingw install

LibOGG

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

  1. unzip (unzip libogg-1.0.1.zip)
  2. put the os_types.h file in thelibogg-1.0.1/include/ogg directory, replacing the os_types.h file there
  3. do the following in the top libogg-1.0.1 source dir:
    cross-configure.sh --disable-shared
    cross-make.sh
  4. then do the following (you may need root access) to install:
    cross-make.sh install

LibVorbis

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.

  1. unzip (unzip libvorbis-1.0.1.zip)
  2. do the following in the top libvorbis-1.0.1 source dir:
    cross-configure.sh --disable-shared
    cross-make.sh
  3. then do the following (you may need root access) to install:
    cross-make.sh install

prev toc next