|
|
Line 30: |
Line 30: |
|
#As root, unpack the compiler (it will create a mingw directory in /usr/local) : |
|
#As root, unpack the compiler (it will create a mingw directory in /usr/local) : |
|
#:<pre>tar jxf mingw-gcc3.3.1-linux-crosscompiler.tar.bz2 -C /</pre> |
|
#:<pre>tar jxf mingw-gcc3.3.1-linux-crosscompiler.tar.bz2 -C /</pre> |
|
#Type the following : |
|
#From the directory containing the libs directory, type the following : |
|
#:<pre>export CC="i586-mingw32msvc-gcc"</pre> |
|
#:<pre>export CC="i586-mingw32msvc-gcc"</pre> |
|
#:<pre>export CXX="i586-mingw32msvc-g++"</pre> |
|
#:<pre>export CXX="i586-mingw32msvc-g++"</pre> |
Line 38: |
Line 38: |
|
#:<pre>export PATH=/usr/local/mingw/bin:/usr/i586-mingw32msvc/bin:$PWD/libs/bin:$PATH</pre> |
|
#:<pre>export PATH=/usr/local/mingw/bin:/usr/i586-mingw32msvc/bin:$PWD/libs/bin:$PATH</pre> |
|
#:<pre>rm ./libs/bin/auto*</pre> |
|
#:<pre>rm ./libs/bin/auto*</pre> |
|
|
#: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:<br /> |
|
|
perl -e '$pwd = %ENV->{PWD}; while (<>) {chomp; s/prefix=\/usr/prefix=/g; if ($_ eq "prefix=") {print $_.$pwd."/libs","\n"} else {print $_,"\n";}}' ./libs/bin/sdl-config > ./libs/bin/sdl-config2 && rm ./libs/bin/sdl-config && mv ./libs/bin/sdl-config2 ./libs/bin/sdl-config && chmod u+x ./libs/bin/sdl-config |
|
#download glob2 cvs (as anonymous for example) : |
|
#download glob2 cvs (as anonymous for example) : |
|
#:<pre>export CVS_RSH="ssh"</pre> |
|
#:<pre>export CVS_RSH="ssh"</pre> |
Revision as of 20:00, 26 January 2006
This page explains how to build and test globulation2 for windows on a Debian GNU/Linux operating system.
For any problems or suggestions, don't hesitate to contact me. Ion bidon
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 from the wine repository :
- Change the file /etc/apt/sources.list and add
deb http://wine.sourceforge.net/apt/ binary/
apt-get update && 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 :
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
- Download a mingw compiler that works :
wget http://mirrors.ircam.fr/pub/videolan/testing/win32/mingw-gcc3.3.1-linux-crosscompiler.tar.bz2
- As root, unpack the compiler (it will create a mingw directory in /usr/local) :
tar jxf mingw-gcc3.3.1-linux-crosscompiler.tar.bz2 -C /
- 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}; while (<>) {chomp; s/prefix=\/usr/prefix=/g; if ($_ eq "prefix=") {print $_.$pwd."/libs","\n"} else {print $_,"\n";}}' ./libs/bin/sdl-config > ./libs/bin/sdl-config2 && rm ./libs/bin/sdl-config && mv ./libs/bin/sdl-config2 ./libs/bin/sdl-config && chmod u+x ./libs/bin/sdl-config
- download glob2 cvs (as anonymous for example) :
export CVS_RSH="ssh"
cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/glob2 co glob2
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 .
- change in configure.in :
CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
with
CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
LDFLAGS="$LDFLAGS `sdl-config --libs` -lSDL_ttf"
- 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 :)