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