blob: cba53ab3a8242f7d540943803bbbdc4db621561f [file] [log] [blame]
Erik de Castro Lopoa6a4b6f2013-11-22 18:13:36 +11001dnl @synopsis XIPH_GCC_REALLY_IS_GCC
2dnl
3dnl Find out if a compiler claiming to be gcc really is gcc (clang lies).
4dnl @version 1.0 Oct 31 2013
5dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
6dnl
7dnl Permission to use, copy, modify, distribute, and sell this file for any
8dnl purpose is hereby granted without fee, provided that the above copyright
9dnl and this permission notice appear in all copies. No representations are
10dnl made about the suitability of this software for any purpose. It is
11dnl provided "as is" without express or implied warranty.
12dnl
13
14# If the configure script has already detected GNU GCC, then make sure it
15# isn't CLANG masquerading as GCC.
16
17AC_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])