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