MinGW cross compiling environment  (1.4)
=================================

http://www.profv.de/mingw_cross_env/

This script compiles a MinGW cross compiler and cross compiles
many free libraries such as GD and SDL. Thus, it provides you
a nice MinGW cross compiling environment. All necessary source
packages are downloaded automatically.

This script is designed to run on any Unix system. It also runs
partly on MSYS. It needs GNU make and GNU sed, so FreeBSD users
need the ports textproc/gsed and devel/gmake.


Usage:  ./build_mingw_cross_env.sh  [ action ]

<no action>
    same as '--download', followed by '--build'.

--new-versions
    retrieve the new version numbers of all packages
    (modifies the script in-place, use with caution!)

--download
    download all packages in download/
    (resumes incomplete downloads)

--build
    build the packages in src/ and usr/, create mingw_cross_env.tar.gz
    (needs a prepared download/ directory
     or a previous '--download' run)

--build-experimental
    build the experimental packages
    (allows fast testing of new additions to the script,
     needs a prepared mingw_cross_env.tar.gz archive
     or a previous '--build' run)

--dist
    build a source distribution package


Copyright
=========

(c)  Volker Grabsch <vog@notjusthosting.com>
     Rocco Rutte <pdmef@gmx.net>
     Andreas Roever <roever@users.sf.net>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject
to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Tutorial
========

http://wiki.njh.eu/Win32_Cross_Compiling_Tutorial

First of all you have to decide where your compiler is going to
reside. I chose /opt/mingw but any other location is alright,
too. Just remember to edit your .bashrc script in order to
change $PATH:

export PATH=/opt/mingw/bin:$PATH

Next, create the directory. If you're afraid that the script
might touch your current development environment, be sure you
give yourself full access because you can run the entire script
under your current user account:

su
mkdir /opt/mingw
chown <user> /opt/mingw
chgrp <group> /opt/mingw
exit

Be sure to use the user account settings appropriate for your
system; this is just an example. Next, make a tiny adjustment to
the script. Don't take another route, you won't get a proper
compilant. Line 96 to be exact:

PREFIX="/opt/mingw"

Now run it:

./build_mingw_cross_env.sh

Take a coffee and wait. Make it a big one. If all goes well
you'll end up with a cross compiler in /opt/mingw and you're
almost ready to run. 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.
Please refer to Cross Compiling for Win32 or the Comments on
freshmeat about mingw_cross_env. All you have to do is type
this:

make CROSS="i386-mingw32msvc-"

Depending on your project this may be a bit more complex, but
now you got plenty of links to solve these issues. If you're
using configure, all you have to do is:

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

or this:

./configure --target="i386-mingw32msvc"
make

Whatever works for you. Have phun!

Hans Bezemer


List of Packages
================

binutils       2.18.50-20080109
curl           7.17.1
fltk           1.1.7
fontconfig     2.5.91
freetype       2.3.5
gcc            4.2.1-2
gd             2.0.35
gdal           1.5.0
geos           3.0.0
gettext        0.17
giflib         4.1.6
gnutls         1.6.3
jpeg           6b
libdnet        1.11
libgcrypt      1.4.0
libgeotiff     1.2.4
libgpg_error   1.6
libiconv       1.9.2
libmikmod      3.2.0-beta2
libpng         1.2.24
libxml2        2.6.30
libxslt        1.1.22
mingw_runtime  3.14
ogg            1.1.3
pdcurses       33
pdflib_lite    7.0.2
pkg_config     0.22
proj           4.6.0
pthreads       2-8-0
SDL            1.2.11
SDL_image      1.2.6
SDL_mixer      1.2.8
smpeg          0.4.5+cvs20030824
tiff           3.8.2
tre            0.7.5
vorbis         1.2.0
w32api         3.11
winpcap        4_0_2
xmlwrapp       0.5.0
zlib           1.2.3
