Compiling on DEC Alpha

Lars Hecking lhecking@nmrc.ucc.ie
Fri, 12 Nov 1999 20:30:06 +0000


Werner Koch writes:

> Lars Hecking <lhecking@nmrc.ucc.ie> writes:
>
> > I think the latter form is more readable, so there you go. The former
> > obscures the code, and makes it harder to find and separate preprocessor
> > statements.
>
> I expected such a comment :-)
I hope you take it well :-) And show some good common sense :-))
> > To put the Alpha C compiler into ANSI mode (with extensions), use
> > cc -std. This sets __STDC__=0.
>
> Right, I remember this from porting some software to VMS.
> And now we need to find the autoconf macros which checks this out.
There are none. The closest you can get is AM_PROG_CC_STDC (through AM_C_PROTOTYPES), but it's of no use in this case. If you run it on OSF/DecUnix/Tru64, the result is that no extra options are needed because the decision is based on whether or not the compiler accepts prototypes (which Dec Unix cc without options does). The need for more fine grained detection of compiler capabilites/features, was discussed on the autoconf list, but I don't think any great efforts went into adding this to the upcoming 2.15 release. Need to check the CVS, though ... # @defmac AM_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC # If the C compiler in not in ANSI C mode by default, try to add an option # to output variable @code{CC} to make it so. This macro tries various # options that select ANSI C on some system or another. It considers the # compiler to be in ANSI C mode if it handles function prototypes correctly. # # If you use this macro, you should check after calling it whether the C # compiler has been set to accept ANSI C; if not, the shell variable # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source # code in ANSI C, you can make an un-ANSIfied copy of it by using the # program @code{ansi2knr}, which comes with Ghostscript. # @end defmac