clang.m4 897 B

12345678910111213141516171819202122232425262728293031
  1. dnl @synopsis MN_C_COMPILER_IS_CLANG
  2. dnl
  3. dnl Find out if a compiler claiming to be gcc really is gcc (fuck you clang).
  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. AC_DEFUN([MN_C_COMPILER_IS_CLANG],
  14. [AC_CACHE_CHECK(whether we are using the CLANG C compiler,
  15. mn_cv_c_compiler_clang,
  16. [ AC_LANG_ASSERT(C)
  17. AC_TRY_LINK([
  18. #include <stdio.h>
  19. ],
  20. [
  21. #ifndef __clang__
  22. This is not clang!
  23. #endif
  24. ],
  25. mn_cv_c_compiler_clang=yes,
  26. mn_cv_c_compiler_clang=no
  27. ])
  28. )
  29. ])