[m-rev.] testing for gcc (was Re: diff: MacOS changes
Simon Taylor
stayl at cs.mu.OZ.AU
Fri Oct 18 16:50:13 AEST 2002
On 23-Sep-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 23-Sep-2002, Peter Moulder <pmoulder at csse.monash.edu.au> wrote:
> > On Tue, Sep 10, 2002 at 03:18:22AM +1000, Fergus Henderson wrote:
> >
> > > scripts/mgnuc.in:
> > > If $COMPILER is "unknown" (e.g. because $CC is "cc"),
> > > don't disable grades such as "reg.gc".
> >
> > autoconf defines a shell variable GCC whose value is empty or "yes"
> > according to whether the chosen compiler defines preprocessor symbol
> > __GNUC__. If mgnuc didn't allow overriding the configured C compiler,
> > then I'd definitely recommend using this test (i.e. do AC_SUBST(GCC)
> > or something similar) rather than going by the name.
>
> Agreed. However, it doesn't really matter much.
> If you try to use grades such as reg.gc with a non-GCC
> compiler, then the error will be very quickly caught by a
> #error directive. The other uses of $COMPILER are all
> work-arounds for platform-specific (and gcc version-specific)
> problems; it's OK if they don't get activated on new platforms.
>
> > Given that mgnuc does allow overriding the configured C compiler, I'm
> > not sure what the best thing is; but I thought I'd mention this for
> > someone else to consider.
>
> Note that the support for overriding the configured C compiler doesn't
> completely work at the moment; CFLAGS_FOR_GOTOS, CFLAGS_FOR_REGS, and
> CFLAGS_FOR_THREADS will get set based on the configured C compiler,
> and they may be wrong for a different C compiler.
I'm currently working on eliminating some Cygwin dependencies by
implementing the ml and c2init scripts in the compiler, and the
duplication caused by the partial attempt to allow overriding the
C compiler (in configure.in, scripts/mgnuc.in, scripts/ml.in and
compiler/compile_target_code.m) is a bit of a pain.
Given that overriding the C compiler doesn't work properly anyway,
would anyone (Fergus) complain if I moved all of the compiler-dependent
code into configure.in? Overriding the C compiler would then require
generating a copy of the scripts with the correct configuration for
that C compiler (with `mmc --make' only the mmc script would need
to be generated).
Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list