]> eyrie.org Git - kerberos/krb5-strength.git/blob - m4/clang.m4
Change CrackLib tests for system CrackLib
[kerberos/krb5-strength.git] / m4 / clang.m4
1 dnl Determine whether the current compiler is Clang.
2 dnl
3 dnl If the current compiler is Clang, set the shell variable CLANG to yes.
4 dnl
5 dnl The canonical version of this file is maintained in the rra-c-util
6 dnl package, available at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
7 dnl
8 dnl Copyright 2015 Russ Allbery <eagle@eyrie.org>
9 dnl
10 dnl This file is free software; the authors give unlimited permission to copy
11 dnl and/or distribute it, with or without modifications, as long as this
12 dnl notice is preserved.
13
14 dnl Source used by RRA_PROG_CC_CLANG.
15 AC_DEFUN([_RRA_PROG_CC_CLANG_SOURCE], [[
16 #if ! __clang__
17 #error
18 #endif
19 ]])
20
21 AC_DEFUN([RRA_PROG_CC_CLANG],
22 [AC_CACHE_CHECK([if the compiler is Clang], [rra_cv_prog_cc_clang],
23     [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_RRA_PROG_CC_CLANG_SOURCE])],
24         [rra_cv_prog_cc_clang=yes],
25         [rra_cv_prog_cc_clang=no])])
26  AS_IF([test x"$rra_cv_prog_cc_clang" = xyes], [CLANG=yes])])