Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO create an cross-compilation environment for Win32+SDL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
frozsyn
n00b
n00b


Joined: 06 Feb 2005
Posts: 9

PostPosted: Sun Feb 20, 2005 10:15 am    Post subject: HOWTO create an cross-compilation environment for Win32+SDL Reply with quote

For the moment, this post is a bit limited, and is here for people who want to test quickly
please not replying before it is completed.

This HOWTO aims to help people in creating a cross-compilation environment for Windows/SDL on their lovely Gentoo box from scratch (I mean, without using any script from SDL website or anybody else). As I want this howto to be clean, I have reinstall my Gentoo. Now I will explain exactly what I do.

The first step is to install the mingw32 cross-compiler. To do so, I have followed the first stage of this howto. So I execute first:

Code:
emerge xmingw-binutils && emerge xmingw-gcc && emerge xmingw-w32api && emerge xmingw-runtime && emerge xmingw-gcc


At this point, you should be able to compile every program that only use only the standard functions. Now, we want to allow SDL programs to compile for Windows. So I download first the directx and opengl stuff and then the last version of the sources of SDL.

Code:
cd /opt/xmingw/
mkdir src
cd src
wget http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz
wget http://www.libsdl.org/extras/win32/common/opengl-devel.tar.gz
wget http://www.libsdl.org/release/SDL-1.2.8.tar.gz


directx-devel.tar.gz and opengl-devel.tar.gz are tarballs which must be unpacked in the root directorie of the cross-compilation environment. So I do:

Code:
tar xfvz directx-devel.tar.gz -C /opt/xmingw/i386-mingw32msvc
tar xfvz opengl-devel.tar.gz -C /opt/xmingw/i386-mingw32msvc


Now, we can compile the SDL library. But we have to setup some variable before. So what I do is:

Code:
export PATH=/opt/xmingw/i386-mingw32msvc/bin:/opt/xmingw/bin:$PATH

tar xfvz SDL-1.2.8.tar.gz
cd SDL-1.2.8
./configure --host i386-mingw32msvc --prefix /opt/xmingw/i386-mingw32msvc
make
make install


Last edited by frozsyn on Mon Apr 11, 2005 8:08 am; edited 1 time in total
Back to top
View user's profile Send private message
robertd79
n00b
n00b


Joined: 10 Apr 2005
Posts: 1

PostPosted: Sun Apr 10, 2005 9:16 pm    Post subject: Reply with quote

two small corrections and an error:

(1)
Code:
tar xfvz direct-devel.tar.gz -C /opt/xmingw/i386-mingw32msvc


shoudl be:

Code:
tar xfvz directx-devel.tar.gz -C /opt/xmingw/i386-mingw32msvc


(2)

Code:
./configure --host i386-mingw32msvc --prefix /opt/xmingw/i36-mingw32msvc


should be :

Code:
./configure --host i386-mingw32msvc --prefix /opt/xmingw/i386-mingw32msvc


make fails with the following error:

Quote:
Creating library file: .libs/libSDL.dll.a
/opt/xmingw/lib/gcc-lib/i386-mingw32msvc/3.3.1/../../../../i386-mingw32msvc/bin/ld: hermes/.libs/libhermes.a(mmxp2_32.o): bad reloc address 0x87 in section `.text'
make[2]: *** [libSDL.la] Error 1


It seems to work if I disable nasm:

Code:
./configure --host i386-mingw32msvc --prefix /opt/xmingw/i386-mingw32msvc --with-gnu-ld --disable-nasm
Back to top
View user's profile Send private message
frozsyn
n00b
n00b


Joined: 06 Feb 2005
Posts: 9

PostPosted: Mon Apr 11, 2005 8:07 am    Post subject: Reply with quote

Thanx, I have modfied my post to correct those mistakes.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum