# HG changeset patch # User Volker Grabsch # Date 1244033016 -7200 # Node ID 1c47f20328601223c0c8b68aed2df62cf48d5dac # Parent 416f59747b461961888e97633623e47ec90204a3 include tutorial from http://wiki.njh.eu/mediawiki/index.php?title=Win32_Cross_Compiling_Tutorial&oldid=2061 (by Hans Bezemer) diff -r 416f59747b46 -r 1c47f2032860 doc/index.html --- a/doc/index.html Wed Jun 03 11:55:56 2009 +0200 +++ b/doc/index.html Wed Jun 03 14:43:36 2009 +0200 @@ -11,13 +11,15 @@ font-size: 11pt; margin-top: 0em; } - h1, h2 { + h1, h2, h3 { font-family: sans-serif; - margin-top: 0em; } h2 { font-size: 14pt; - padding-top: 1em; + } + h3 { + font-size: 11pt; + background-color: #eee; } #navigation a { text-decoration: none; @@ -64,6 +66,11 @@ @media screen, handheld { h1 { font-size: 12pt; + margin-top: 0em; + } + h2 { + margin-top: 0em; + padding-top: 1em; } #navigation { position: fixed; @@ -163,12 +170,131 @@

Tutorial

- +

Step 1: Download and Unpack

+ +

+ First, download the + latest release + and unpack the tarball: +

+
wget http://www.profv.de/mingw_cross_env/mingw_cross_env-2.5.tar.gz
+tar -xzvf mingw_cross_env-2.5.tar.gz
+ +

+ If you don't mind installing it in your home directory, + just skip the following step and go straight to step 3. +

+ +

Step 2: System-wide Installation (optional)

+ +

+ Now you should save any previous installation + of the MinGW cross compiling environment. + Assuming you've installed it under + /opt/mingw (any other directory will do as well), + you should execute the following commands: +

+
su
+mv /opt/mingw /opt/mingw.old
+exit
+ +

+ Then you need to transfer the entire directory to its definitive location. + We will assume again you use /opt/mingw, + but feel free to use any other directory if you like. +

+
su
+mv mingw_cross_env-2.5 /opt/mingw
+exit
+ +

+ We're almost done. + Just change to your newly created directory and get going: +

+
cd /opt/mingw
+ +

Step 3: Build mingw_cross_env

+ +

+ Enter the directory where you've unpacked the + MinGW cross compiling environment. + Now it depends on what you actually want - or need. +

+ +

+ If you choose to enter: +

+
make
+

+ you're in for a long wait, + because the MinGW cross compiling environment + compiles a lot of stuff. + On the other hand it doesn't require any intervention, + so you're free to do whatever you like + - like watch a movie or go for a night on the town. + When it's done you'll find that you've installed + a very capable Win32 cross compiler onto your system. +

+ +

+ If you only need the most basic tools you can also use: +

+
make gcc
+

+ and add any additional packages you need later on. + You can also supply a host of packages on the + command line, + e.g.: +

+
make gtk lua libidn
+

+ You'll always end up with a consistent cross compiler environment. +

+ +

+ After you're done it just needs a little post-installation. + Edit your .bashrc script in order to change $PATH: +

export PATH=/where MinGW cross compiler is installed/usr/bin:$PATH
+ +

+ BTW, note that any compiler related environment variables + (like $CC, $LDFLAGS, etc.) + may spoil your compiling pleasure, + so be sure to delete or disable those. +

+ +

Step 4: Build your Project

+ +

+ You probably will have to make a few adjustments to your Makefile: +

+
CC=$(CROSS)gcc
+LD=$(CROSS)ld
+AR=$(CROSS)ar
+

+ You may have to add a few others, depending on your project. + Then, all you have to do is type this: +

+
make CROSS="i386-mingw32msvc-"
+ +

+ If you're using configure, all you have to do is: +

+
./configure --host="i386-mingw32msvc"
+make
+

+ That's it! +

+ +

+ Don't let any warnings put you off. + A warning like this is absolutely harmless: +

+
configure: WARNING: If you wanted to set the --build type, don't use --host.
+If a cross compiler is detected then cross compile mode will be used.
+

+ Everything will be just fine. +

@@ -358,6 +484,7 @@
  • Giuseppe Scrivano
  • Martin Gerhardy
  • Mark Brand
  • +
  • Hans Bezemer
  • @@ -627,6 +754,8 @@

  • Project entry on Freshmeat + with a filled + comments section
  • IMCROSS @@ -639,6 +768,14 @@ and Linux Today
  • +
  • + Cross Compiling for Win32 + – an overview of the various possibilities for win32 cross compiling +
  • +
  • + Cross-compiling under Linux for MS Windows + – a very old, but good win32 cross compiling tutorial +