|
|
Line 15: |
Line 15: |
|
#install mingw : |
|
#install mingw : |
|
#:<pre>apt-get install mingw32 mingw32-binutils mingw32-runtime</pre> |
|
#:<pre>apt-get install mingw32 mingw32-binutils mingw32-runtime</pre> |
|
#install wine from the wine repository : |
|
#install wine: |
|
|
#:<pre>apt-get install wine</pre> |
|
#:Change the file /etc/apt/sources.list and add <pre>deb http://wine.sourceforge.net/apt/ binary/</pre> |
|
|
#:<pre>apt-get update && apt-get install wine && ln -s /usr/bin/wine /usr/bin/wine-auto</pre> |
|
#:<pre>ln -s /usr/bin/wine /usr/bin/wine-auto</pre> |
|
#create the following directory : |
|
#create the following directory : |
|
#:<pre>mkdir libs</pre> |
|
#:<pre>mkdir libs</pre> |
Line 25: |
Line 25: |
|
#:<pre>tar jxf glob2_required_libs_mingw.tar.bz2 -C ./libs</pre> |
|
#:<pre>tar jxf glob2_required_libs_mingw.tar.bz2 -C ./libs</pre> |
|
#download boost c++ precompiled libraries : |
|
#download boost c++ precompiled libraries : |
|
#:broken link ... <pre>wget http://viral.media.mit.edu/releases/boost-1.33.1-mingw-bin.tar.gz</pre></s> |
|
#:broken link ... <s>wget <nowiki>http://viral.media.mit.edu/releases/boost-1.33.1-mingw-bin.tar.gz</nowiki></s> |
|
#manually install boost c++ with the following commands : |
|
#manually install boost c++ with the following commands : |
|
#:<pre>tar zxf boost-1.33.1-mingw-bin.tar.gz</pre> |
|
#:<pre>tar zxf boost-1.33.1-mingw-bin.tar.gz</pre> |
Revision as of 23:05, 22 January 2010
This guide is no longer valid: Globulation now uses scons to compile the source. If you do a cross compile please update this page accordingly. Thanx.
|
This page explains how to build and test globulation2 for windows on a Debian GNU/Linux operating system.
To see how to compile it natively on Windows, please see Mingw compilation.
For any problems or suggestions, don't hesitate to contact me.
Remark: if you use another mingw compiler than the one requested to download in this page, compilation might fail.
Compile globulation2 for windows on Debian using mingw
- install mingw :
apt-get install mingw32 mingw32-binutils mingw32-runtime
- install wine:
apt-get install wine
ln -s /usr/bin/wine /usr/bin/wine-auto
- create the following directory :
mkdir libs
- download glob2_required_libs_mingw.tar.bz2 :
wget http://globulation2.org/dev/glob2_required_libs_mingw.tar.bz2
- untar the libraries like this :
tar jxf glob2_required_libs_mingw.tar.bz2 -C ./libs
- download boost c++ precompiled libraries :
- broken link ...
wget http://viral.media.mit.edu/releases/boost-1.33.1-mingw-bin.tar.gz
- manually install boost c++ with the following commands :
tar zxf boost-1.33.1-mingw-bin.tar.gz
mv boost/include/boost-1_33_1/boost ./libs/include
mv boost/lib/* ./libs/lib
- Install a mingw compiler
sudo aptitude install mingw32-binutils mingw32 mingw32-runtime
- From the directory containing the libs directory, type the following :
export CC="i586-mingw32msvc-gcc"
export CXX="i586-mingw32msvc-g++"
export CFLAGS="-I$PWD/libs/include $CFLAGS"
export CXXFLAGS="-I$PWD/libs/include -I$PWD/libs/include/freetype2 $CXXFLAGS"
export LDFLAGS="-L$PWD/libs/lib $LDFLAGS"
export PATH=/usr/local/mingw/bin:/usr/i586-mingw32msvc/bin:$PWD/libs/bin:$PATH
rm ./libs/bin/auto*
- change the third line of ./libs/bin/sdl-config from prefix=/usr to point to the libs directory (hard path) or from the directory containing the libs directory, type:
- perl -e '$pwd=%ENV->{PWD};$tmp="";while(<>){chomp;if(s/prefix=\/usr/prefix=/g){$_="prefix=".$pwd."/libs"}$tmp.= $_."\n"}open(FI,"+< ./libs/bin/sdl-config");print FI $tmp;' ./libs/bin/sdl-config
- download glob2 mercurial:
hg clone http://hg.globulation2.org/glob2-new/
cd glob2
cp ../libs/bin/SDL.dll ../libs/bin/libvorbis-0.dll ../libs/bin/libogg-0.dll ../libs/bin/libvorbisenc-2.dll ../libs/bin/libfreetype-6.dll .
cp ../libs/lib/libvorbisfile.a ../libs/lib/libvorbis.a ../libs/lib/libogg.a .
- Open the configure.in file, find:
CPPFLAGS="$CPPFLAGS $SDL_CFLAGS" |
- and replace with:
CPPFLAGS="$CPPFLAGS $SDL_CFLAGS -I/usr/include/freetype2" LDFLAGS="$LDFLAGS `sdl-config --libs` -lSDL_ttf" |
- In the same file, find:
LIBS="$LIBS -logg -lwsock32" |
- and replace with:
LIBS="$LIBS -lwsock32 ../libvorbisfile.a ../libvorbis.a ../libogg.a" |
- compiling glob2 :
./bootstrap
./configure --host=i586-mingw32msvc
make
- To make the executable smaller :
strip ./src/glob2.exe
Test globulation2 for windows on Debian
- download glob2_windows_runtime.tar.bz2
wget http://globulation2.org/dev/glob2_windows_runtime.tar.bz2
- extract it with :
tar jxf glob2_windows_runtime.tar.bz2
- go in the glob2 directory where you have compiled glob2 and type
./syncdata
./syncmaps
- copy the content of glob2/data/ to glob2_runtime/data/
- copy the content of glob2/maps/ to glob2_runtime/maps/
- copy glob2.exe which is in the src directory (glob2/src/) to glob2_runtime/
- run wine glob2.exe from the glob2_runtime directory and play :)