Difference between revisions of "Cross-compiling Windows version from Linux"

From Armagetron
m
 
m
Line 31: Line 31:
 
Prefix is the location of your cross-compiler, it should have "bin", "lib", and "include" in it.
 
Prefix is the location of your cross-compiler, it should have "bin", "lib", and "include" in it.
  
Apparently libxml2 doesn't cross-compile, or I have to dig deeper to make it do so.
+
To get libxml2 to cross-compile, use this as your configure command:
 +
 
 +
  ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --with-python=no
 +
 
 +
== Armagetron Advanced ==
 +
 
 +
You need to set some influential environment variables to make it configure.
 +
 
 +
XML2_CONFIG=/path/to/cross-compiled/xml2-config
 +
SDL_CONFIG=/path/to/cross-compiled/sdl-config
 +
 
 +
Example:
 +
 
 +
  XML2_CONFIG=/usr/i586-mingw32msvc/bin/xml2-config SDL_CONFIG=/usr/i586-mingw32msvc/bin/sdl-config ../../armagetronadnew/configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --disable-sound

Revision as of 07:06, 10 June 2006

Just collecting cross-compilation notes.

Setting up the cross compiler under linux

Check your distribution for mingw packages. If it has it, install them. If not, try this:

http://www.libsdl.org/extras/win32/cross/

Export some environment variable:

 export CC=i586-mingw32msvc-gcc
 export CXX=i586-mingw32msvc-c++
 export LD=i586-mingw32msvc-ld
 export AR=i586-mingw32msvc-ar
 export AS=i586-mingw32msvc-as
 export NM=i586-mingw32msvc-nm
 export STRIP=i586-mingw32msvc-strip
 export RANLIB=i586-mingw32msvc-ranlib
 export DLLTOOL=i586-mingw32msvc-dlltool
 export OBJDUMP=i586-mingw32msvc-objdump
 export RESCOMP=i586-mingw32msvc-windres

You might want those in a script.

Libraries

You'll need to use the same configure command to configure and install the libraries. Get libSDL and libxml2 and do this:

 ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc

Prefix is the location of your cross-compiler, it should have "bin", "lib", and "include" in it.

To get libxml2 to cross-compile, use this as your configure command:

 ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --with-python=no

Armagetron Advanced

You need to set some influential environment variables to make it configure.

XML2_CONFIG=/path/to/cross-compiled/xml2-config SDL_CONFIG=/path/to/cross-compiled/sdl-config

Example:

 XML2_CONFIG=/usr/i586-mingw32msvc/bin/xml2-config SDL_CONFIG=/usr/i586-mingw32msvc/bin/sdl-config ../../armagetronadnew/configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --disable-sound