summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-10-02 18:23:07 +0200
committerBram Moolenaar <Bram@vim.org>2013-10-02 18:23:07 +0200
commit0c6ccfdb62f233963ca2bd05092b94a0b855fcee (patch)
treefe7881b10121d9fcf4fdbfddc282747e822dc958
parent35a7c681bce136b6993c1c6f6e2fdf3e3667791d (diff)
updated for version 7.4.048v7.4.048
Problem: Recent clang version complains about -fno-strength-reduce. Solution: Add a configure check for the clang version. (Kazunobu Kuriyama)
-rwxr-xr-xsrc/auto/configure18
-rw-r--r--src/configure.in23
-rw-r--r--src/version.c2
3 files changed, 43 insertions, 0 deletions
diff --git a/src/auto/configure b/src/auto/configure
index a9755a0b6e..07f794e8fc 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -3989,6 +3989,24 @@ if test "$GCC" = yes; then
fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for recent clang version" >&5
+$as_echo_n "checking for recent clang version... " >&6; }
+CLANG_VERSION_STRING=`"$CC" --version 2>/dev/null | sed -n -e 's/^.*clang.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p'`
+if test x"$CLANG_VERSION_STRING" != x"" ; then
+ CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*/\1/p'`
+ CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/p'`
+ CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)/\1/p'`
+ CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_VERSION" >&5
+$as_echo "$CLANG_VERSION" >&6; }
+ if test "$CLANG_VERSION" -ge 500002075 ; then
+ CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
if test "$cross_compiling" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&5
$as_echo "cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&6; }
diff --git a/src/configure.in b/src/configure.in
index ed30bedf86..11e1d63d96 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -62,6 +62,29 @@ if test "$GCC" = yes; then
fi
fi
+dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
+dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on
+dnl the version number of the clang in use.
+dnl Note that this does not work to get the version of clang 3.1 or 3.2.
+AC_MSG_CHECKING(for recent clang version)
+CLANG_VERSION_STRING=`"$CC" --version 2>/dev/null | sed -n -e 's/^.*clang.*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'`
+if test x"$CLANG_VERSION_STRING" != x"" ; then
+ CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'`
+ CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'`
+ CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
+ CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
+ AC_MSG_RESULT($CLANG_VERSION)
+ dnl If you find the same issue with versions earlier than 500.2.75,
+ dnl change the constant 500002075 below appropriately. To get the
+ dnl integer corresponding to a version number, refer to the
+ dnl definition of CLANG_VERSION above.
+ if test "$CLANG_VERSION" -ge 500002075 ; then
+ CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
dnl If configure thinks we are cross compiling, there might be something
dnl wrong with the CC or CFLAGS settings, give a useful warning message
if test "$cross_compiling" = yes; then
diff --git a/src/version.c b/src/version.c
index 6b543975e0..5a916a9e85 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 48,
+/**/
47,
/**/
46,