blob: 036f0e684e60656b033eceb2250774ae6ea3e190 [file] [log] [blame]
Erik de Castro Lopoa6a4b6f2013-11-22 18:13:36 +11001dnl @synopsis XIPH_C_COMPILER_IS_CLANG
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
15AC_DEFUN([XIPH_C_COMPILER_IS_CLANG],
16[AC_CACHE_CHECK(whether we are using the CLANG C compiler,
17 xiph_cv_c_compiler_clang,
18 [ AC_LANG_ASSERT(C)
19 AC_TRY_LINK([
20 #include <stdio.h>
21 ],
22 [
23 #ifndef __clang__
24 This is not clang!
25 #endif
26 ],
27 xiph_cv_c_compiler_clang=yes,
28 xiph_cv_c_compiler_clang=no
29 ])
30 )]
31)