[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ac-archive not known? Re: Detecting C compiler
From: |
Guido Draheim |
Subject: |
ac-archive not known? Re: Detecting C compiler |
Date: |
Tue, 02 Jul 2002 00:21:23 +0200 |
http://ac-archive.sf.net/C_Support/ac_prog_cc_warnings.html
see also
http://ac-archive.sf.net/C_Support/ac_prog_cc_strict_prototypes.html
http://ac-archive.sf.net/C_Support/ac_prog_cc_no_writeable_strings.html
Es schrieb Philip Willoughby:
>
> Hi all,
>
> I'm trying to write a pair of macros to enable strict ansi conformance mode
> and all vaguely useful warnings for at least my target platforms:
>
> * AIX with Visualage for C++ C compiler (xlc_r)
> * Solaris with Sun's ANSI C compiler (cc)
> * HP-UX with HP's C compiler (cc)
> * Linux with GCC
>
> I have used the feature of AC_PROG_CC which sets GCC to "yes" to check for
> gcc, and when it comes to AIX I can just test if CC is xlc or xlc_r (I hope
> -- this is untested).
>
> The problem is what to do to differentiate between the Sun and HP cc's.
>
> Any ideas are welcomed, as is any information (prefereably web addresses of
> manuals) for other unix compilers (I'm afraid I can't bring myself to care
> about windows)...
>
> Ideas that have crossed my mind so far are:
>
> * use `which' to detect the path to cc and grep that for clues.
> * parse the output of `cc -h' and hope for clues
> * get the user to tell me via --with-cc=[hp|sun|...]
>
> I don't fancy which because there are no guarantees that the path will be
> the same or even share any common elements across platforms/releases.
>
> I don't want to parse `cc -h' because there is too much scope for change.
>
> The final option is most reliable, but just plain ugly.
>
> I haven't even considered looking at uname and relying on the kernel
> architecture since that breaks the philosophy of autoconf.
>
> Regards,
>
> Philip Willoughby
>
> Systems Programmer, Department of Computing, Imperial College, London, UK
> --
> echo address@hidden | tr "bizndfohces" "pwgd9ociaku"