This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linux->Win32 cross compiler ?


"Felix E. Klee" <felix.klee@inka.de> writes:

> does anyone know if a cross compiler exists for Linux which
> creates Win32 executables just like gnuwin32 does?

You can create a set of cross tools quite easily using the
binutils-2.9.1 and egcs-1.1b distributions if you just lift the
target-dependent stuff (libraries, include files) off of Mumit
Khan's toolkits (haven't tried gnuwin32, but mingw32 seems to have
worked quite easily for me although it hasn't received much testing
yet). Primary location is
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/

The basic steps for the mingw32 crosscompiler are (don't kill me if I
get this slightly wrong...):

[replace $cross, etc. as needed or set them as shell variables]

a) lift the i386-mingw32 subtree out of egcs-1.1-mingw32.zip and put
it into $cross

b) get and unpack binutils and egcs from one of the GNU mirror sites.
get and apply the patches from Mumit. Only the windres patch from
Anders Norlander and the Fortran time patches seem really important
for crossbuilding.

c) create separate build directories for binutils and egcs (this is
probably unnecessary, but it's nice to be able to clear out mistakes
completely with "rm -rf *" and some rather nasty things seem to happen
with the links if you run configure with wrong arguments and try to
rerun it).

d) cd $binu-bld 
$binu-src/configure --target=i386-mingw32 --prefix=$cross
make
make install

e) same thing with egcs

There are some older versions of linux->mingw32 gcc compilers already
packaged up as .rpm files, but the above should be simple enough to be
preferable. 

(Jan-Jaaps binaries at
ftp://agnes.dida.physik.uni-essen.de/home/janjaap/mingw32/linux/ are
for RedHat4.2 only - the RPMS_rh50/ appears to be empty, so you'd have
to build from SRPMS anyway.)
-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]