Free and Open Source real time strategy game with a new take on micro-management

Difference between revisions of "Mingw cross compilation"

From Globulation2

Jump to: navigation, search
(https://bitbucket.org/giszmo/glob2 again)
 
(29 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This page explains how to build and test globulation2 for windows on a Debian GNU/Linux operating system.
This page explains how to build and test glob2 for Windows on a Debian/Ubuntu 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. [[User:Ion bidon|Ion bidon]]


===Compile globulation2 for windows on Debian using mingw===
===Compile globulation2 for Windows on Debian using mingw===


#install mingw :
#Install a mingw compiler:
#:<pre>apt-get install mingw32 mingw32-binutils mingw32-runtime</pre>
#:<pre>sudo apt-get install mingw32-binutils mingw32 mingw32-runtime</pre>
#Install NSIS (required only if you want to build NSIS installer):
#install wine from the wine repository :
#:<pre>sudo apt-get install nsis</pre>
#:Change the file /etc/apt/sources.list and add <pre>deb http://wine.sourceforge.net/apt/ binary/</pre>
#Create the following directory:
#:<pre>apt-get update && apt-get install wine && ln -s /usr/bin/wine /usr/bin/wine-auto</pre>
#:<pre>mkdir build</pre>
#create the following directory :
#:<pre>mkdir libs</pre>
#:<pre>cd build</pre>
#download glob2_required_libs_mingw.tar.bz2 :
#Download glob2_required_libs_mingw-scons.tar.bz2:
#:<pre>wget http://globulation2.org/dev/glob2_required_libs_mingw.tar.bz2</pre>
#:<pre>wget http://dl.sv.nongnu.org/releases/glob2/mingw/glob2_required_libs_mingw-scons.tar.bz2</pre>
#untar the libraries like this :
#Untar the libraries:
#:<pre>tar jxf glob2_required_libs_mingw.tar.bz2 -C ./libs</pre>
#:<pre>tar -xjf glob2_required_libs_mingw-scons.tar.bz2</pre>
#Download glob2 sources from mercurial (check [[Compiling#Sources_from_Mercurial]] for details):
#download boost c++ precompiled libraries :
#:<pre>wget http://viral.media.mit.edu/releases/boost-1.33.1-mingw-bin.tar.gz</pre>
#:<pre>hg clone https://bitbucket.org/giszmo/glob2</pre>
#:<pre>cd glob2-new</pre>
#manually install boost c++ with the following commands :
#Compile:
#:<pre>tar zxf boost-1.33.1-mingw-bin.tar.gz</pre>
#:<pre>mv boost/include/boost-1_33_1/boost ./libs/include</pre>
#:<pre>scons -j5 mingwcross=yes</pre>
#To create NSIS installer package run after previous step:
#:<pre>mv boost/lib/* ./libs/lib</pre>
#:<pre>scons -j5 mingwcross=yes dist</pre>
#Download a mingw compiler that works :
#:<pre>wget http://mirrors.ircam.fr/pub/videolan/testing/win32/mingw-gcc3.3.1-linux-crosscompiler.tar.bz2</pre>
#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>
#From the same directory type the following :
#:<pre>export CC="i586-mingw32msvc-gcc"</pre>
#:<pre>export CXX="i586-mingw32msvc-g++"</pre>
#:<pre>export CFLAGS="-I$PWD/libs/include $CFLAGS"</pre>
#:<pre>export CXXFLAGS="-I$PWD/libs/include -I$PWD/libs/include/freetype2 $CXXFLAGS"</pre>
#:<pre>export LDFLAGS="-L$PWD/libs/lib $LDFLAGS"</pre>
#:<pre>export PATH=/usr/local/mingw/bin:/usr/i586-mingw32msvc/bin:$PWD/libs/bin:$PATH</pre>
#:<pre>rm ./libs/bin/auto*</pre>
#download glob2 cvs (as anonymous for example) :
#:<pre>export CVS_RSH="ssh"</pre>
#:<pre>cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/glob2 co glob2</pre>
#:<pre>cd glob2</pre>
#:<pre>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 .</pre>
#:change in configure.in :<br />CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"<br />&nbsp;&nbsp;&nbsp;with<br />CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"<br />LDFLAGS="$LDFLAGS `sdl-config --libs` -lSDL_ttf -lwsock32"
#compiling glob2 :
#:<pre>./bootstrap</pre>
#:<pre>./configure</pre>
#:<pre>make</pre>
#To make the executable smaller :
#:<pre>strip ./src/glob2.exe</pre>


===Test globulation2 for windows on Debian ===


===Test globulation2 for Windows on Debian===
#download glob2_windows_runtime.tar.bz2

#:<pre>wget http://globulation2.org/dev/glob2_windows_runtime.tar.bz2</pre>
#Install wine:
#extract it with :
#:<pre>tar jxf glob2_windows_runtime.tar.bz2</pre>
#:<pre>sudo apt-get install wine</pre>
#Copy files necessary to run:
#go in the glob2 directory where you have compiled glob2 and type
#:<pre>./syncdata</pre>
#:<pre>cp src/glob2.exe .</pre>
#:<pre>./syncmaps</pre>
#:<pre>cp ../local/bin/* ../local/lib/* .</pre>
#Run glob2:
#copy the content of glob2/data/ to glob2_runtime/data/
#:<pre>wine glob2.exe</pre>
#copy the content of glob2/maps/ to glob2_runtime/maps/

#copy glob2.exe which is in the src directory (glob2/src/) to glob2_runtime/
[[Category:en]]
#run wine glob2.exe from the glob2_runtime directory and play :)
[[Category:Developer Resources]]

Latest revision as of 19:31, 4 October 2012

This page explains how to build and test glob2 for Windows on a Debian/Ubuntu GNU/Linux operating system. To see how to compile it natively on Windows, please see Mingw compilation.


Compile globulation2 for Windows on Debian using mingw

  1. Install a mingw compiler:
    sudo apt-get install mingw32-binutils mingw32 mingw32-runtime
  2. Install NSIS (required only if you want to build NSIS installer):
    sudo apt-get install nsis
  3. Create the following directory:
    mkdir build
    cd build
  4. Download glob2_required_libs_mingw-scons.tar.bz2:
    wget http://dl.sv.nongnu.org/releases/glob2/mingw/glob2_required_libs_mingw-scons.tar.bz2
  5. Untar the libraries:
    tar -xjf glob2_required_libs_mingw-scons.tar.bz2
  6. Download glob2 sources from mercurial (check Compiling#Sources_from_Mercurial for details):
    hg clone https://bitbucket.org/giszmo/glob2
    cd glob2-new
  7. Compile:
    scons -j5 mingwcross=yes
  8. To create NSIS installer package run after previous step:
    scons -j5 mingwcross=yes dist


Test globulation2 for Windows on Debian

  1. Install wine:
    sudo apt-get install wine
  2. Copy files necessary to run:
    cp src/glob2.exe .
    cp ../local/bin/* ../local/lib/* .
  3. Run glob2:
    wine glob2.exe
Misc