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
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
#2
#autogen.sh
PREFIX=/opt/win32tools
TARGET=i386-mingw32msvc
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
export PATH
cache=cross-config.cache
sh autogen.sh --cache-file="$cache" \
--target=$TARGET --host=$TARGET --build=i386-linux \
$*
status=$?
rm -f "$cache"
exit $status
08/24/2003 (8:09 pm)
#!/bin/sh#autogen.sh
PREFIX=/opt/win32tools
TARGET=i386-mingw32msvc
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
export PATH
cache=cross-config.cache
sh autogen.sh --cache-file="$cache" \
--target=$TARGET --host=$TARGET --build=i386-linux \
$*
status=$?
rm -f "$cache"
exit $status
#3
#xconfigure.sh
PREFIX=/opt/win32tools
TARGET=i386-mingw32msvc
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
export PATH
cache=cross-config.cache
sh configure --cache-file="$cache" \
--target=$TARGET --host=$TARGET --build=i386-linux \
$*
status=$?
rm -f "$cache"
exit $status
08/24/2003 (8:10 pm)
#!/bin/sh#xconfigure.sh
PREFIX=/opt/win32tools
TARGET=i386-mingw32msvc
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
export PATH
cache=cross-config.cache
sh configure --cache-file="$cache" \
--target=$TARGET --host=$TARGET --build=i386-linux \
$*
status=$?
rm -f "$cache"
exit $status
#4
#xbuild.sh
# This is my script for building a complete cross-compiler toolchain.
# It is based partly on Ray Kelm's script, which in turn was built on
# Mo Dejong's script for doing the same, but with some added fixes.
# The intent with this script is to build a cross-compiled version
# of the current MinGW environment.
#
# Updated by Sam Lantinga
# Modified by Benoit Touchette
# what flavor are we building?
TARGET=i386-mingw32msvc
# where does it go?
PREFIX=/opt/win32tools
# you probably don't need to change anything from here down
TOPDIR='pwd'
SRCDIR="$TOPDIR/source"
# These are the files from the MinGW release
BASE_URL=http://umn.dl.sourceforge.net/sourceforge
MINGW_URL=$BASE_URL/mingw/
#uncomment to use gcc3
GCC=gcc-3.2.3-20030504-1
#uncomment to use gcc2
#GCC=gcc-2.95.3-8-20020922-1
GCC_ARCHIVE=$GCC-src.tar.gz
GCC_PATCH=""
BINUTILS=binutils-2.13-20020903-1
BINUTILS_ARCHIVE=$BINUTILS-src.tar.gz
MINGW=mingw-runtime-3.0
MINGW_ARCHIVE=$MINGW.tar.gz
W32API=w32api-2.3
W32API_ARCHIVE=$W32API.tar.gz
NASM_URL=$BASE_URL/nasm/
NASM=nasm-0.98.36
NASM_ARCHIVE=$NASM.tar.gz
# These are the files from the SDL website
SDL_URL=http://www.libsdl.org/extras/win32/common
OPENGL_ARCHIVE=opengl-devel.tar.gz
DIRECTX_ARCHIVE=directx-devel.tar.gz
# need install directory first on the path so gcc can find binutils
PATH="$PREFIX/bin:$PATH"
#
# Create initial directory and cd to it
#
initdir()
{
rm -fr $PREFIX
mkdir $PREFIX
cd $PREFIX
}
#
# download a file from a given url, only if it is not present
#
download_file()
{
cd "$SRCDIR"
if test ! -f $1 ; then
echo "Downloading $1"
wget "$2/$1"
if test ! -f $1 ; then
echo "Could not download $1"
exit 1
fi
else
echo "Found $1 in the srcdir $SRCDIR"
fi
cd "$TOPDIR"
}
download_files()
{
mkdir -p "$SRCDIR"
# Make sure wget is installed
if test "x'which wget'" = "x" ; then
echo "You need to install wget."
exit 1
fi
download_file "$GCC_ARCHIVE" "$MINGW_URL"
download_file "$BINUTILS_ARCHIVE" "$MINGW_URL"
download_file "$MINGW_ARCHIVE" "$MINGW_URL"
download_file "$W32API_ARCHIVE" "$MINGW_URL"
download_file "$OPENGL_ARCHIVE" "$SDL_URL"
download_file "$DIRECTX_ARCHIVE" "$SDL_URL"
download_file "$NASM_ARCHIVE" "$NASM_URL"
}
install_libs()
{
echo "Installing cross libs and includes"
mkdir -p "$PREFIX/$TARGET"
cd "$PREFIX/$TARGET"
gzip -dc "$SRCDIR/$MINGW_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$W32API_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$OPENGL_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$DIRECTX_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$NASM_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
extract_nasm()
{
cd "$SRCDIR"
rm -rf "$NASM"
echo "Extracting nasm"
gzip -dc "$SRCDIR/$NASM_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
configure_nasm()
{
cd "$TOPDIR"
rm -rf "nasm-$TARGET"
mkdir "nasm-$TARGET"
cd "nasm-$TARGET"
echo "Configuring nasm"
"$SRCDIR/$NASM/configure" --prefix="$PREFIX" \
--target=$TARGET &> configure.log
cd "$TOPDIR"
}
build_nasm()
{
cd "$TOPDIR/nasm-$TARGET"
echo "Building nasm"
make &> make.log
if test $? -ne 0; then
echo "make failed - log available: nasm-$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}
install_nasm()
{
cd "$TOPDIR/nasm-$TARGET"
echo "Installing nasm"
make install &> make-install.log
if test $? -ne 0; then
echo "install failed - log available: nasm-$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}
08/24/2003 (8:14 pm)
#!/bin/sh#xbuild.sh
# This is my script for building a complete cross-compiler toolchain.
# It is based partly on Ray Kelm's script, which in turn was built on
# Mo Dejong's script for doing the same, but with some added fixes.
# The intent with this script is to build a cross-compiled version
# of the current MinGW environment.
#
# Updated by Sam Lantinga
# Modified by Benoit Touchette
# what flavor are we building?
TARGET=i386-mingw32msvc
# where does it go?
PREFIX=/opt/win32tools
# you probably don't need to change anything from here down
TOPDIR='pwd'
SRCDIR="$TOPDIR/source"
# These are the files from the MinGW release
BASE_URL=http://umn.dl.sourceforge.net/sourceforge
MINGW_URL=$BASE_URL/mingw/
#uncomment to use gcc3
GCC=gcc-3.2.3-20030504-1
#uncomment to use gcc2
#GCC=gcc-2.95.3-8-20020922-1
GCC_ARCHIVE=$GCC-src.tar.gz
GCC_PATCH=""
BINUTILS=binutils-2.13-20020903-1
BINUTILS_ARCHIVE=$BINUTILS-src.tar.gz
MINGW=mingw-runtime-3.0
MINGW_ARCHIVE=$MINGW.tar.gz
W32API=w32api-2.3
W32API_ARCHIVE=$W32API.tar.gz
NASM_URL=$BASE_URL/nasm/
NASM=nasm-0.98.36
NASM_ARCHIVE=$NASM.tar.gz
# These are the files from the SDL website
SDL_URL=http://www.libsdl.org/extras/win32/common
OPENGL_ARCHIVE=opengl-devel.tar.gz
DIRECTX_ARCHIVE=directx-devel.tar.gz
# need install directory first on the path so gcc can find binutils
PATH="$PREFIX/bin:$PATH"
#
# Create initial directory and cd to it
#
initdir()
{
rm -fr $PREFIX
mkdir $PREFIX
cd $PREFIX
}
#
# download a file from a given url, only if it is not present
#
download_file()
{
cd "$SRCDIR"
if test ! -f $1 ; then
echo "Downloading $1"
wget "$2/$1"
if test ! -f $1 ; then
echo "Could not download $1"
exit 1
fi
else
echo "Found $1 in the srcdir $SRCDIR"
fi
cd "$TOPDIR"
}
download_files()
{
mkdir -p "$SRCDIR"
# Make sure wget is installed
if test "x'which wget'" = "x" ; then
echo "You need to install wget."
exit 1
fi
download_file "$GCC_ARCHIVE" "$MINGW_URL"
download_file "$BINUTILS_ARCHIVE" "$MINGW_URL"
download_file "$MINGW_ARCHIVE" "$MINGW_URL"
download_file "$W32API_ARCHIVE" "$MINGW_URL"
download_file "$OPENGL_ARCHIVE" "$SDL_URL"
download_file "$DIRECTX_ARCHIVE" "$SDL_URL"
download_file "$NASM_ARCHIVE" "$NASM_URL"
}
install_libs()
{
echo "Installing cross libs and includes"
mkdir -p "$PREFIX/$TARGET"
cd "$PREFIX/$TARGET"
gzip -dc "$SRCDIR/$MINGW_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$W32API_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$OPENGL_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$DIRECTX_ARCHIVE" | tar xf -
gzip -dc "$SRCDIR/$NASM_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
extract_nasm()
{
cd "$SRCDIR"
rm -rf "$NASM"
echo "Extracting nasm"
gzip -dc "$SRCDIR/$NASM_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
configure_nasm()
{
cd "$TOPDIR"
rm -rf "nasm-$TARGET"
mkdir "nasm-$TARGET"
cd "nasm-$TARGET"
echo "Configuring nasm"
"$SRCDIR/$NASM/configure" --prefix="$PREFIX" \
--target=$TARGET &> configure.log
cd "$TOPDIR"
}
build_nasm()
{
cd "$TOPDIR/nasm-$TARGET"
echo "Building nasm"
make &> make.log
if test $? -ne 0; then
echo "make failed - log available: nasm-$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}
install_nasm()
{
cd "$TOPDIR/nasm-$TARGET"
echo "Installing nasm"
make install &> make-install.log
if test $? -ne 0; then
echo "install failed - log available: nasm-$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}
#5
{
cd "$SRCDIR"
rm -rf "$BINUTILS"
echo "Extracting binutils"
gzip -dc "$SRCDIR/$BINUTILS_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
configure_binutils()
{
cd "$TOPDIR"
rm -rf "binutils-$TARGET"
mkdir "binutils-$TARGET"
cd "binutils-$TARGET"
echo "Configuring binutils"
"$SRCDIR/$BINUTILS/configure" --prefix="$PREFIX" --target=$TARGET &> configure.log
cd "$TOPDIR"
}
build_binutils()
{
cd "$TOPDIR/binutils-$TARGET"
echo "Building binutils"
make &> make.log
if test $? -ne 0; then
echo "make failed - log available: binutils-$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}
install_binutils()
{
cd "$TOPDIR/binutils-$TARGET"
echo "Installing binutils"
make install &> make-install.log
if test $? -ne 0; then
echo "install failed - log available: binutils-$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}
extract_gcc()
{
cd "$SRCDIR"
rm -rf "$GCC"
echo "Extracting gcc"
gzip -dc "$SRCDIR/$GCC_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
configure_gcc()
{
cd "$TOPDIR"
rm -rf "gcc-$TARGET"
mkdir "gcc-$TARGET"
cd "gcc-$TARGET"
echo "Configuring gcc"
"$SRCDIR/$GCC/configure" -v \
--prefix="$PREFIX" --target=$TARGET \
--with-headers="$PREFIX/$TARGET/include" \
--with-gnu-as --with-gnu-ld \
--without-newlib --disable-multilib &> configure.log
cd "$TOPDIR"
}
patch_gcc()
{
if [ "$GCC_PATCH" != "" ]; then
echo "Patching gcc"
cd "$SRCDIR/$GCC"
patch -p1 < "$SRCDIR/$GCC_PATCH"
cd "$TOPDIR"
fi
}
build_gcc()
{
cd "$TOPDIR/gcc-$TARGET"
echo "Building gcc"
make LANGUAGES="c c++" &> make.log
if test $? -ne 0; then
echo "make failed - log available: gcc-$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}
install_gcc()
{
cd "$TOPDIR/gcc-$TARGET"
echo "Installing gcc"
make LANGUAGES="c c++" install &> make-install.log
if test $? -ne 0; then
echo "install failed - log available: gcc-$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}
final_tweaks()
{
echo "Finalizing installation"
# remove gcc build headers
rm -rf "$PREFIX/$TARGET/sys-include"
# make cc and c++ symlinks to gcc and g++
if [ ! -f "$PREFIX/$TARGET/bin/g++" ]; then
ln "$PREFIX/bin/$TARGET-g++" "$PREFIX/$TARGET/bin/g++"
fi
if [ ! -f "$PREFIX/$TARGET/bin/cc" ]; then
ln -s "gcc" "$PREFIX/$TARGET/bin/cc"
fi
if [ ! -f "$PREFIX/$TARGET/bin/c++" ]; then
ln -s "g++" "$PREFIX/$TARGET/bin/c++"
fi
if [ ! -f "$PREFIX/$TARGET/bin/nasm" ]; then
ln -s "$PREFIX/bin/nasm" "$PREFIX/$TARGET/bin/nasm"
fi
if [ ! -f "$PREFIX/$TARGET/bin/ndisasm" ]; then
ln -s "$PREFIX/bin/ndisasm" "$PREFIX/$TARGET/bin/ndisasm"
fi
# strip all the binaries
ls "$PREFIX"/bin/* "$PREFIX/$TARGET"/bin/* | egrep -v '.dll$' |
while read file; do
strip "$file"
done
echo "Installation complete!"
}
08/24/2003 (8:15 pm)
Extract_binutils(){
cd "$SRCDIR"
rm -rf "$BINUTILS"
echo "Extracting binutils"
gzip -dc "$SRCDIR/$BINUTILS_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
configure_binutils()
{
cd "$TOPDIR"
rm -rf "binutils-$TARGET"
mkdir "binutils-$TARGET"
cd "binutils-$TARGET"
echo "Configuring binutils"
"$SRCDIR/$BINUTILS/configure" --prefix="$PREFIX" --target=$TARGET &> configure.log
cd "$TOPDIR"
}
build_binutils()
{
cd "$TOPDIR/binutils-$TARGET"
echo "Building binutils"
make &> make.log
if test $? -ne 0; then
echo "make failed - log available: binutils-$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}
install_binutils()
{
cd "$TOPDIR/binutils-$TARGET"
echo "Installing binutils"
make install &> make-install.log
if test $? -ne 0; then
echo "install failed - log available: binutils-$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}
extract_gcc()
{
cd "$SRCDIR"
rm -rf "$GCC"
echo "Extracting gcc"
gzip -dc "$SRCDIR/$GCC_ARCHIVE" | tar xf -
cd "$TOPDIR"
}
configure_gcc()
{
cd "$TOPDIR"
rm -rf "gcc-$TARGET"
mkdir "gcc-$TARGET"
cd "gcc-$TARGET"
echo "Configuring gcc"
"$SRCDIR/$GCC/configure" -v \
--prefix="$PREFIX" --target=$TARGET \
--with-headers="$PREFIX/$TARGET/include" \
--with-gnu-as --with-gnu-ld \
--without-newlib --disable-multilib &> configure.log
cd "$TOPDIR"
}
patch_gcc()
{
if [ "$GCC_PATCH" != "" ]; then
echo "Patching gcc"
cd "$SRCDIR/$GCC"
patch -p1 < "$SRCDIR/$GCC_PATCH"
cd "$TOPDIR"
fi
}
build_gcc()
{
cd "$TOPDIR/gcc-$TARGET"
echo "Building gcc"
make LANGUAGES="c c++" &> make.log
if test $? -ne 0; then
echo "make failed - log available: gcc-$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}
install_gcc()
{
cd "$TOPDIR/gcc-$TARGET"
echo "Installing gcc"
make LANGUAGES="c c++" install &> make-install.log
if test $? -ne 0; then
echo "install failed - log available: gcc-$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}
final_tweaks()
{
echo "Finalizing installation"
# remove gcc build headers
rm -rf "$PREFIX/$TARGET/sys-include"
# make cc and c++ symlinks to gcc and g++
if [ ! -f "$PREFIX/$TARGET/bin/g++" ]; then
ln "$PREFIX/bin/$TARGET-g++" "$PREFIX/$TARGET/bin/g++"
fi
if [ ! -f "$PREFIX/$TARGET/bin/cc" ]; then
ln -s "gcc" "$PREFIX/$TARGET/bin/cc"
fi
if [ ! -f "$PREFIX/$TARGET/bin/c++" ]; then
ln -s "g++" "$PREFIX/$TARGET/bin/c++"
fi
if [ ! -f "$PREFIX/$TARGET/bin/nasm" ]; then
ln -s "$PREFIX/bin/nasm" "$PREFIX/$TARGET/bin/nasm"
fi
if [ ! -f "$PREFIX/$TARGET/bin/ndisasm" ]; then
ln -s "$PREFIX/bin/ndisasm" "$PREFIX/$TARGET/bin/ndisasm"
fi
# strip all the binaries
ls "$PREFIX"/bin/* "$PREFIX/$TARGET"/bin/* | egrep -v '.dll$' |
while read file; do
strip "$file"
done
echo "Installation complete!"
}
#6
08/24/2003 (8:15 pm)
Note you will need to merge those last two posts as i couldn't get them to fit in a sinqle post.
#7
09/17/2003 (6:29 pm)
Here is a link to getting a working tarball of the scripts www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4610
#8
:)
09/26/2003 (9:48 am)
Thanks Benoit ... this will be very usefull for me. No more restart and booting windows to create a Win32 release.:)
#9
I have started to do some research on maybe getting the same tricks to work for MacOSX, so far it looks promising. Though i would need a Mac to test out to make sure that the binaries actually worked and find out what libs might be missing/needed. :)
09/26/2003 (3:29 pm)
Glad to hear this is useful to other folks. Note you want to use the resource link instead of what is posted here as i just noticed some parts were missing.I have started to do some research on maybe getting the same tricks to work for MacOSX, so far it looks promising. Though i would need a Mac to test out to make sure that the binaries actually worked and find out what libs might be missing/needed. :)
#10
09/27/2003 (8:53 am)
Benoit, you can contact me at the address in my profile if you want me to test generated binaries on my ibook (I'm in Montreal, you can even do it in French ;))
#11
09/27/2003 (9:47 am)
Thanks for the offer i am also from that area. Will be mailing you soon :)
#12
First, I could not get it to build the audio.cc file... but after a "hack" in lib/vorbis/include/ogg/os_types.h I got it to compile.
But when it starts to link I get alot of undefined references with vorbis_something .
Anyone knows a workaround?
10/02/2003 (10:08 am)
Hi... I tested this with the current HEAD release, I can't get it to link correctly.First, I could not get it to build the audio.cc file... but after a "hack" in lib/vorbis/include/ogg/os_types.h I got it to compile.
But when it starts to link I get alot of undefined references with vorbis_something .
Anyone knows a workaround?
#13
A few quick notes off the top of my head on doing torque mac builds from a linux or mingw cross compiler :
- getting it to produce Darwin binaries should not be harder than generating binaries for another Unix, with the right headers set up, etc. You can also link against X11 for GUI apps. this means you can post straight Unix apps quite easily, and probably cross compile them for Darwin. You can't build Torque for MacOS X like this, as MacOS X adds (roughly) another layer on top of Darwin, with its own headers, libs, etc, and does not use X11 as its windowing server..
- Which brings the second point : I don't know if you'll be able to produce mac Torque binaries this way, as quite a few headers and libs are in the OS itself, hidden away in frameworks and not in the dev tools, which you can download from apple, although opening them on anything other than a mac might be hard, as I don't know if Apple's disk image format is supported by non Mac utilities. Meaning that you can probably hack something together if you have a Mac and copy stuff over. I'm just quite certain it wouldn't be legal to distribute those parts freely on the Web, as there NOT part of the Open Source foundation of MacOS X, but rather an intricate morsel of their proprietary tech.
Anyhow, I'm still interested in helping you out :)
10/02/2003 (10:36 am)
Benoit, not forgetting you, just real busy..A few quick notes off the top of my head on doing torque mac builds from a linux or mingw cross compiler :
- getting it to produce Darwin binaries should not be harder than generating binaries for another Unix, with the right headers set up, etc. You can also link against X11 for GUI apps. this means you can post straight Unix apps quite easily, and probably cross compile them for Darwin. You can't build Torque for MacOS X like this, as MacOS X adds (roughly) another layer on top of Darwin, with its own headers, libs, etc, and does not use X11 as its windowing server..
- Which brings the second point : I don't know if you'll be able to produce mac Torque binaries this way, as quite a few headers and libs are in the OS itself, hidden away in frameworks and not in the dev tools, which you can download from apple, although opening them on anything other than a mac might be hard, as I don't know if Apple's disk image format is supported by non Mac utilities. Meaning that you can probably hack something together if you have a Mac and copy stuff over. I'm just quite certain it wouldn't be legal to distribute those parts freely on the Web, as there NOT part of the Open Source foundation of MacOS X, but rather an intricate morsel of their proprietary tech.
Anyhow, I'm still interested in helping you out :)
#14
Nicolas: yeah, for your second point, i am aware that this might be the case. But it might be possible with some kind of wrapper code though. For the graphics stuff i think i can probably tie that stuff in with SDL. But it does look like it won't be easy but not impossible :)
10/02/2003 (12:22 pm)
Alexander: i'm at my day job right now, will let you know when i get home later tonight.Nicolas: yeah, for your second point, i am aware that this might be the case. But it might be possible with some kind of wrapper code though. For the graphics stuff i think i can probably tie that stuff in with SDL. But it does look like it won't be easy but not impossible :)
#15
Untar this into your torque directory. This will replace os_types.h in lib/vorbis/include/ogg and replace conf.GCC3.WIN32 in in the mk directory and add the missing libogg.a and libvorbis.a in lib/vorbis/win32.
the os_types.h adds checking for mingw instead of dumbly assuming cygwin for the needed types.
10/02/2003 (5:04 pm)
members.fortunecity.com/torktools/Patch/vorbis_files.tar.gzUntar this into your torque directory. This will replace os_types.h in lib/vorbis/include/ogg and replace conf.GCC3.WIN32 in in the mk directory and add the missing libogg.a and libvorbis.a in lib/vorbis/win32.
the os_types.h adds checking for mingw instead of dumbly assuming cygwin for the needed types.
#16
10/03/2003 (2:02 pm)
The updates should be in HEAD according to Rick, so it should compile fine again :)
#17
10/05/2003 (4:15 am)
Wow, thanks alot benoit
#18
10/05/2003 (5:20 am)
Glad to help out :)
#19
Thanks.
12/06/2003 (12:29 pm)
I was able to cross compile correctly a couple of weeks ago, after doing some simple changes to the makefiles, but then I stopped doing for a while and when I went back to doing it again I found that it fails with this error:--> Linking out.GCC3.RELEASE/torqueDemo.exe /usr/lib/gcc-lib/i586-mingw32msvc/3.3.1/../../../../i586-mingw32msvc/bin/ld: out .GCC3.RELEASE/interior/itfdump.obj: bad reloc address 0x25 in section '.text' make[1]: *** [out.GCC3.RELEASE/torqueDemo.exe] Error 1And of course, I have no clue what that's supposed to mean, anyone else seen this or knows what it means?
Thanks.
#20
12/06/2003 (8:18 pm)
The error happens with using the wrong version of binutils with nasm (any version from what i can tell). It has to be the binutils version from the build script. Anything newer breaks it for some reason. I never found the reason why though, if anyone has a clue i'd like to know.
Torque Owner Benoit Touchette
#xmake.sh
PREFIX=/opt/win32tools
TARGET=i386-mingw32msvc
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
export PATH
exec make $*