Game Development Community

Cross compiling TGE from linux to windows

by Benoit Touchette · in Torque Game Engine · 08/24/2003 (8:07 pm) · 24 replies

Here is a howto to creating windows binaries from a linux setup using gcc/binutil/nasm toolchain under that platform. This was tested on Mandrake 9.1 (x86 machine). Special thanks goes to Sam Latinga of SDL fame for the initial scripts, which i adapted for building TGE. The originals can be found at http://www.libsdl.org/extras/win32/cross/

Tools Needed:

gcc 3.2.3 or 2.95.3 (MINGW Version)
binutil 2.13.90 (MINGW Version)
nasm 0.98.36
wine (any recent build)
TGE (tested with cvs head checkout)
xbuild.sh (toolchain build script)
xmake.sh (make script)

Note that xbuild.sh will by default build for gcc 3.2.3, just edit the proper line to switch to 2.95.3. This example procedure assumes gcc3.2.3 will be used and that wine is already installed.

Procedure

1- First step is to build the gcc/binutils/nasm tool chain

cd /opt
mkdir win32build
cd win32build
cp ~/xbuild.sh .
./xbuild.sh

2- Get/Install TGE

cd /opt
cvs -d:pserver:username@cvs.garagegames.com:/cvs/torque login
cvs -z6 -d:pserver:username@cvs.garagegames.com:/cvs/torque co torque

3- copy xmake.sh script to the torque directory

cd torque
cp ~/xmake.sh .

4- Edit the makefiles so that the following reads

COMPILER.asm=nasm

instead of

COMPILER.asm=../bin/nasmnasmw.exe

to edit for GCC2 :

vi mk/conf.GCC2.WIN32.mk

or to edit for GCC3 :

vi mk/conf.GCC3.WIN32.mk

5- Setting up TGE for win32 compilation

./xmake.sh mk/configure.mk OS=WIN32 COMPILER=GCC3 BUILD=RELEASE

6- Compiling TGE

./xmake.sh

7- Testing TGE

cd example
wine -- torqueDemo.exe
Page«First 1 2 Next»
#21
12/06/2003 (10:26 pm)
I'm not using your scripts to compile though. Just the win32 gcc3 makefile from torque, changing gcc for mingw and nasm.
#22
12/06/2003 (10:49 pm)
Ok, using binutils 2.13 fixed the problem. Thanks! I will have to put that package on hold now.
#23
12/07/2003 (7:45 am)
Hehe i should have been clearer. At least you found it :)
#24
12/07/2003 (11:21 am)
Yeah, I looked at your scripts requirements on your first post and figured :)
Page«First 1 2 Next»