[m-rev.] testing for gcc (was Re: diff: MacOS changes

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Sep 23 16:41:36 AEST 2002


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.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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