[MLton-user] MinGW Cross-compile

Anoq of the Sun anoq@HardcoreProcessing.com
Thu, 06 Nov 2003 21:46:31 +0200


Thanks for all the comments Pete and Stephen :)

Pete Chown wrote:
> If you just want to build a
> cross-compiling gcc, don't worry about that script, just do it by hand.

I think that I might as well modify the script. It will also help
me if I need to do it again - but your hints are most definately
useful :)

> --with-headers and --with-libs should point to the place where you have
> unpacked your Windows SDKs.  The headers and libraries will be copied to
> the install directory.  This should include windows.h, allowing the
> compiler to find it. ;-)

OK - right now I'm copying the the local system includes (see
the reply to Stephen's comment below).

> Now type make and make install.  Oh, and you have to do binutils too,
> and install it before attempting to build gcc.

Yes, I got the binutils to work with the script (and some work) -
so that part should be fine.

Stephen Weeks wrote:
> Building a cross gcc is a black enough art
> to me that I need all the help I can get.

Agreed ;)

> In fact, you don't even need a cross gcc to build MLton.  You can
> always use -stop g to generate the C and assembler and then ship those
> over to the target machine, where you use a regular gcc.  If you're
> having too many problems, this approach might be easier for
> bootstrapping.

Actually I'm more interested in being able to cross-compile
applications rather than MLton itself. I basically just need
to make Windows binaries of my apps on Linux. We will see
when I get that far :)

> Because the two previous "tar -x" unpack in usr/include and usr/lib,
> at least for the Cygwin stuff I got.
> 
> > Also it doesn't seem to copy anything from $root/cygwin at all, even
> > though it unpacks the cybwin runtime and the w32api there.
> 
> That's because you changed the usr to /usr.

Ahh! That explains it! I thought you were trying to make a copy
of your own native Linux system includes and copy the cross-headers
on top of that or something :) My mingw tarball just unpacks
the lib, include and bin directly though - so I guess I will just
remove the cd usr command and hopefully something will happen :)

> I do remember problems with some combinations of gcc and the libraries
> where gcc didn't know to look in include/w32api/ to find windows.h.
> Maybe Pete's configure args fix this, or maybe newer gcc's know to
> look there.  I worked around it at one point by copying everything in
> include/w32api/ up one level into include/.

OK - if this gives problems, I'll try following Pete's suggestions.


Cheers
-- 
http://www.HardcoreProcessing.com