Crosscompiling with tdragon's gcc

Crosscompiling with tdragon's gcc

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Crosscompiling with tdragon's gcc

Post by imbaczek »

Found this little gem during the weekend: http://www.profv.de/mingw_cross_env/. After dropping the author an email, he said he always wanted a more recent gcc, but didn't know about tdragon's, so the day after support was there. Installation: untar, make, done (it downloads sources itself), and it even crosscompiles boost! (for tdragon support you need to grab hg clone, it's not released yet.)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Crosscompiling with tdragon's gcc

Post by hoijui »

hmm.. this is usefull for unix distors with poor packaging systems, or simply no mingw packages by default?
or what would be good for us, about this?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

we can have a gcc that doesn't suck, need to poke bibim when he's back.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Crosscompiling with tdragon's gcc

Post by hoijui »

so we would have a better MinGW. like.. later version, more gcc like/compatible... things like that?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

yeah, my main interest is debug symbols that actually work with gdb, but the optimizer improvements are worth it too, imho.

edit: i finished the spring crosscompilation and it works flawlessly. scons script for future reference:

Code: Select all

#!/bin/sh
#sconscross.sh

export MINGDIR=$HOME/usr/mingw_cross_env/usr/
export CC=$HOME/usr/mingw_cross_env/usr/bin/i386-mingw32msvc-gcc
export CXX=$HOME/usr/mingw_cross_env/usr/bin/i386-mingw32msvc-g++
export AR=$HOME/usr/mingw_cross_env/usr/bin/i386-mingw32msvc-ar
export RANLIB=$HOME/usr/mingw_cross_env/usr/bin/i386-mingw32msvc-ranlib

scons $* platform=windows
would've used cmake but no idea how to force crosscompilation there ^^
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Crosscompiling with tdragon's gcc

Post by Auswaschbar »

imbaczek wrote:would've used cmake but no idea how to force crosscompilation there ^^
You could have checked the wiki:
wiki wrote:# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i686-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-mingw32-g++)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i686-mingw32)

SET(MINGWLIBS /home/karl/spring/mingwlibs_v12)

Code: Select all

Pass this with "-DCMAKE_TOOLCHAIN_FILE=/your/toolchain/file" to cmake or select it in the gui to make a cross-compilation. 
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

was looking in cmake docs, dunno what i missed, but it doesn't matter; it works and that's ok.

also, it doesn't crash like the builds from buildserv.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Crosscompiling with tdragon's gcc

Post by Argh »

Do we have working buildbot yet? Or a binary for Windows?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

i compiled one using my own crosscompiling setup, here it is: http://www.darkstars.co.uk/downloads/vi ... 136ac0.zip

seems to work fine.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Crosscompiling with tdragon's gcc

Post by Argh »

Thanks so much, that will be veeeeeery useful.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Crosscompiling with tdragon's gcc

Post by Argh »

Says it can't run, something about boost_thread-mgw43-mt-1_36.dll... crap.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

forgot a dll. lemme see...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Crosscompiling with tdragon's gcc

Post by Argh »

Sorry to be such a pain, I've just been dying to get a current build running...
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

Last edited by imbaczek on 04 Feb 2009, 14:30, edited 1 time in total.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Crosscompiling with tdragon's gcc

Post by Beherith »

Argh wrote:Do we have working buildbot yet? Or a binary for Windows?
Doesnt #buildserv offer the latest binaries as well? I recall it doing so.
Also, if you wanna compile it on windows with vs2005, shoot me a pm.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

the problem is buildserv's binaries are broken for quite some time now.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Crosscompiling with tdragon's gcc

Post by hoijui »

why iam i trying to get my branch running on buildserv then!?!?

BIBIM!!!!!!!!!!!!!!!
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

your branch may be fine as you didn't merge master for quite some time. compiling works, btw ;p
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Crosscompiling with tdragon's gcc

Post by Argh »

It's working over here. Horrible graphics errors with the trees and other issues, but I'll live.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Crosscompiling with tdragon's gcc

Post by imbaczek »

screenshots, screenshots, screenshots!
Post Reply

Return to “Engine”