summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-27 09:21:42 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-28 08:44:50 +0100
commit687d97b96ab97fa8bbd1c5112a0e4b43914c69f6 (patch)
tree3913621c11d733f1645bb81abd733fe6c4096a80 /configure.ac
parentd8a423399014b77d58d4546564ea4f44e1a5cf0b (diff)
Make Clang version detection work for clang-cl
...which does not behave as expected with the given command line arguments, so just strip "-cl.exe" (and any hard-coded command line arguments following it in $CC, but that's probably rather harmless here). Expects that clang-cl is given with an ".exe" extension in $CC (not assuming that and stripping "-cl" and everything that might follow could be a bit too agressive). Change-Id: If99f964dda1369b7d4bbb63b3d634b93c9f935a8
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 2 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 01d24e93d813..c02189b115ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3762,8 +3762,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
if test "$COM_IS_CLANG" = TRUE; then
AC_MSG_CHECKING([the Clang version])
- clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
- CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
+ clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | ${CC%-cl.exe*} -E -P -`
+ CLANG_FULL_VERSION=`echo __clang_version__ | ${CC%-cl.exe*} -E -P -`
CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)