[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
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, (continued)
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Bastien Chevreux, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Marko Lindqvist, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Bastien Chevreux, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Marko Lindqvist, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Bastien Chevreux, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Russ Allbery, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Russ Allbery, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Thomas Jahns, 2014/09/09
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Peter Johansson, 2014/09/08
- Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, Bastien Chevreux, 2014/09/09
Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used,
David A. Wheeler <=
Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used, David A. Wheeler, 2014/09/08