summaryrefslogtreecommitdiffstats
path: root/m4/ax_cc_clang.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:36:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:36:22 +0000
commitb88bb292821fd7742604ec4e280acebd9a049f62 (patch)
tree625e4e19e6619f7481e5a8103f876520950769f6 /m4/ax_cc_clang.m4
parentInitial commit. (diff)
downloadknot-b88bb292821fd7742604ec4e280acebd9a049f62.tar.xz
knot-b88bb292821fd7742604ec4e280acebd9a049f62.zip
Adding upstream version 3.0.5.upstream/3.0.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/ax_cc_clang.m4')
-rw-r--r--m4/ax_cc_clang.m418
1 files changed, 18 insertions, 0 deletions
diff --git a/m4/ax_cc_clang.m4 b/m4/ax_cc_clang.m4
new file mode 100644
index 0000000..abf2991
--- /dev/null
+++ b/m4/ax_cc_clang.m4
@@ -0,0 +1,18 @@
+dnl Check to see if the C compiler is clang and which version it is
+dnl
+AC_DEFUN([AX_CC_CLANG],[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_MSG_CHECKING([whether C compiler is clang])
+ CC_CLANG_VERSION=$(
+ $CC -x c -dM -E /dev/null | \
+ $GREP '__clang_version__' | \
+ $GREP -o '".*"' | \
+ $SED 's/^"\(.*\)"$/\1/g'
+ )
+ AC_SUBST([CC_CLANG_VERSION])
+ if test -n "$CC_CLANG_VERSION"; then
+ AC_MSG_RESULT([$CC_CLANG_VERSION])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ])