autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used


From: David A. Wheeler
Subject: Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used
Date: Mon, 08 Sep 2014 15:53:34 -0400 (EDT)

Bastien Chevreux <address@hidden>:
> Which brings me to what sparked my initial mail to the list: is there 
> somewhere in the autoconf system a macro which gives back the compiler family 
> of the used compiler so that one can take some action? Something which would 
> set a variable (e.g. COMPILER_FAMILY) so that one can write something like 
> this:
> case $COMPILER_FAMILY in
> gnu)
>   ?
> ;;
> clang)
>   ?
> ;;
> icc)
>   ?
> ;;
> sunc)
>   ?
> ;;
> hpc)
>   ?
> ;;
> # (and others)
> esac

I think that would be un-autotools-like.  After all, tomorrow some compiler 
(say clang) may add support for something, or change how it does something.  
It's usually better to probe for a specific capability, and *not* assume that 
"only GCC supports X" (or similar).

Typically you use the existing mechanisms to probe for particular functions or 
.h files.  Dale Visser's recent patch makes it easy to probe if a specific 
compiler flag is accepted (if accepted, I hope it will be).

--- David A. Wheeler



reply via email to

[Prev in Thread] Current Thread [Next in Thread]