From d28ec8a4a480246ff6a4f18e5fd9659ed8bb1747 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 20 Dec 2015 18:35:41 +0100 Subject: [PATCH] CONFIGURE: Report clang compiler version Our previous code printed the gcc version clang is pretending to be. --- configure | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure b/configure index e0d412daad9d..e1ee583b9c88 100755 --- a/configure +++ b/configure @@ -1720,7 +1720,17 @@ if test "$have_gcc" = yes; then _cxx_minor=`gcc_get_define __GNUC_MINOR__` cxx_version="`( $CXX -dumpversion ) 2>&1`" - if test "$_cxx_major" -eq 2 && test "$_cxx_minor" -ge 95 || \ + if test "$have_clang" = yes; then + # Clang sets a gcc version number for compatibility. + # We keep that as _cxx_minor/_cxx_major for later + # compiler version checks. + + # For the version reported in the configure log (cxx_version), + # we get the actual clang version. + cxx_version=`gcc_get_define __clang_version__` + cxx_version="`echo "${cxx_version}" | sed -e 's/"\([^ ]\+\) .*/\1/'`" + cxx_version="clang $cxx_version, ok" + elif test "$_cxx_major" -eq 2 && test "$_cxx_minor" -ge 95 || \ test "$_cxx_major" -gt 2 ; then cxx_version="$cxx_version, ok" cxx_verc_fail=no