[MLton] Cygwin->Mingw32: patch + future

Wesley W. Terpstra terpstra@gkec.tu-darmstadt.de
Thu, 18 Nov 2004 03:39:17 +0100

On Wed, Nov 17, 2004 at 12:09:59PM -0500, Matthew Fluet wrote:
> > There were only two issues:
> > 1. With gcc-3.4, the '-b <arch>' must be the first argument.
> > 2. When using cygwin to compile native windows applications via their
> > included mingw compiler, the option to use is '-mno-cygwin' instead.
> > (I don't know why they did this, but there you have it)
> >
> > In general,  I think most of the CC-controlling options should be moved
> > into a config file somewhere. Some people might want to use 'icc' for
> > example, or under windows one of those other non-free compilers. Also, the
> > gcc command-line api is always changing (and recompiling MLton is brutal!).
> > I'm not planning on doing this.
> The CC-controling options are essentially in their own place:
> in the bin/mlton script you can see the default settings for
>   -cc             -- the C compiler
>   -cc-opt         -- options to the C compiler
>   -target-cc-opt  -- options to the C compiler on a particular target
> Modifying those would be better than modifying main.fun, for per target
> specifics.

You cannot modify the things I changed in main.fun from there.
I tried that first.

Look at my changes; you had hard-coded the '-c' preceding the '-b <target>'.
Neither of those options can be controlled via '-cc' or '-cc-opt' etc.

I agree that keeping these things in bin/mlton is good.
However, in main.fun you will find many cases where the options are
hard-wired. I agree with you that they should be moved out of there.

Right now though, it can't be done as you propose.
'-b' gets forced in if you use '-target x' --- and in the wrong place.
Not to mention, not all compilers use '-b' for their cross-compile flag
(like the compiler I had to write that patch for [which is even gcc]).

Wesley W. Terpstra