Erik de Castro Lopo | a6a4b6f | 2013-11-22 18:13:36 +1100 | [diff] [blame] | 1 | dnl @synopsis XIPH_GCC_REALLY_IS_GCC |
| 2 | dnl |
| 3 | dnl Find out if a compiler claiming to be gcc really is gcc (clang lies). |
| 4 | dnl @version 1.0 Oct 31 2013 |
| 5 | dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 6 | dnl |
| 7 | dnl Permission to use, copy, modify, distribute, and sell this file for any |
| 8 | dnl purpose is hereby granted without fee, provided that the above copyright |
| 9 | dnl and this permission notice appear in all copies. No representations are |
| 10 | dnl made about the suitability of this software for any purpose. It is |
| 11 | dnl provided "as is" without express or implied warranty. |
| 12 | dnl |
| 13 | |
| 14 | # If the configure script has already detected GNU GCC, then make sure it |
| 15 | # isn't CLANG masquerading as GCC. |
| 16 | |
| 17 | AC_DEFUN([XIPH_GCC_REALLY_IS_GCC], |
| 18 | [ AC_LANG_ASSERT(C) |
| 19 | if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then |
| 20 | AC_TRY_LINK([ |
| 21 | #include <stdio.h> |
| 22 | ], |
| 23 | [ |
| 24 | #ifdef __clang__ |
| 25 | This is clang! |
| 26 | #endif |
| 27 | ], |
| 28 | ac_cv_c_compiler_gnu=yes, |
| 29 | ac_cv_c_compiler_gnu=no |
| 30 | ) |
| 31 | fi |
| 32 | ]) |