Karsten Hopp 8fa9a8
To: vim_dev@googlegroups.com
Karsten Hopp 8fa9a8
Subject: Patch 7.4.048
Karsten Hopp 8fa9a8
Fcc: outbox
Karsten Hopp 8fa9a8
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 8fa9a8
Mime-Version: 1.0
Karsten Hopp 8fa9a8
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 8fa9a8
Content-Transfer-Encoding: 8bit
Karsten Hopp 8fa9a8
------------
Karsten Hopp 8fa9a8
Karsten Hopp 8fa9a8
Patch 7.4.048
Karsten Hopp 8fa9a8
Problem:    Recent clang version complains about -fno-strength-reduce.
Karsten Hopp 8fa9a8
Solution:   Add a configure check for the clang version. (Kazunobu Kuriyama)
Karsten Hopp 8fa9a8
Files:	    src/configure.in, src/auto/configure
Karsten Hopp 8fa9a8
Karsten Hopp 8fa9a8
Karsten Hopp 8fa9a8
*** ../vim-7.4.047/src/configure.in	2013-08-04 20:00:50.000000000 +0200
Karsten Hopp 8fa9a8
--- src/configure.in	2013-10-02 17:56:25.000000000 +0200
Karsten Hopp 8fa9a8
***************
Karsten Hopp 8fa9a8
*** 62,67 ****
Karsten Hopp 8fa9a8
--- 62,90 ----
Karsten Hopp 8fa9a8
    fi
Karsten Hopp 8fa9a8
  fi
Karsten Hopp 8fa9a8
  
Karsten Hopp 8fa9a8
+ dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
Karsten Hopp 8fa9a8
+ dnl warning when that flag is passed to.  Accordingly, adjust CFLAGS based on
Karsten Hopp 8fa9a8
+ dnl the version number of the clang in use.
Karsten Hopp 8fa9a8
+ dnl Note that this does not work to get the version of clang 3.1 or 3.2.
Karsten Hopp 8fa9a8
+ AC_MSG_CHECKING(for recent clang version)
Karsten Hopp 8fa9a8
+ 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'`
Karsten Hopp 8fa9a8
+ if test x"$CLANG_VERSION_STRING" != x"" ; then
Karsten Hopp 8fa9a8
+   CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'`
Karsten Hopp 8fa9a8
+   CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'`
Karsten Hopp 8fa9a8
+   CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
Karsten Hopp 8fa9a8
+   CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
Karsten Hopp 8fa9a8
+   AC_MSG_RESULT($CLANG_VERSION)
Karsten Hopp 8fa9a8
+   dnl If you find the same issue with versions earlier than 500.2.75,
Karsten Hopp 8fa9a8
+   dnl change the constant 500002075 below appropriately.  To get the
Karsten Hopp 8fa9a8
+   dnl integer corresponding to a version number, refer to the
Karsten Hopp 8fa9a8
+   dnl definition of CLANG_VERSION above.
Karsten Hopp 8fa9a8
+   if test "$CLANG_VERSION" -ge 500002075 ; then
Karsten Hopp 8fa9a8
+     CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
Karsten Hopp 8fa9a8
+   fi
Karsten Hopp 8fa9a8
+ else
Karsten Hopp 8fa9a8
+   AC_MSG_RESULT(no)
Karsten Hopp 8fa9a8
+ fi
Karsten Hopp 8fa9a8
+ 
Karsten Hopp 8fa9a8
  dnl If configure thinks we are cross compiling, there might be something
Karsten Hopp 8fa9a8
  dnl wrong with the CC or CFLAGS settings, give a useful warning message
Karsten Hopp 8fa9a8
  if test "$cross_compiling" = yes; then
Karsten Hopp 8fa9a8
*** ../vim-7.4.047/src/auto/configure	2013-08-04 20:01:06.000000000 +0200
Karsten Hopp 8fa9a8
--- src/auto/configure	2013-10-02 17:56:52.000000000 +0200
Karsten Hopp 8fa9a8
***************
Karsten Hopp 8fa9a8
*** 3989,3994 ****
Karsten Hopp 8fa9a8
--- 3989,4012 ----
Karsten Hopp 8fa9a8
    fi
Karsten Hopp 8fa9a8
  fi
Karsten Hopp 8fa9a8
  
Karsten Hopp 8fa9a8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recent clang version" >&5
Karsten Hopp 8fa9a8
+ $as_echo_n "checking for recent clang version... " >&6; }
Karsten Hopp 8fa9a8
+ 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'`
Karsten Hopp 8fa9a8
+ if test x"$CLANG_VERSION_STRING" != x"" ; then
Karsten Hopp 8fa9a8
+   CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*/\1/p'`
Karsten Hopp 8fa9a8
+   CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/p'`
Karsten Hopp 8fa9a8
+   CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)/\1/p'`
Karsten Hopp 8fa9a8
+   CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
Karsten Hopp 8fa9a8
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_VERSION" >&5
Karsten Hopp 8fa9a8
+ $as_echo "$CLANG_VERSION" >&6; }
Karsten Hopp 8fa9a8
+           if test "$CLANG_VERSION" -ge 500002075 ; then
Karsten Hopp 8fa9a8
+     CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
Karsten Hopp 8fa9a8
+   fi
Karsten Hopp 8fa9a8
+ else
Karsten Hopp 8fa9a8
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
Karsten Hopp 8fa9a8
+ $as_echo "no" >&6; }
Karsten Hopp 8fa9a8
+ fi
Karsten Hopp 8fa9a8
+ 
Karsten Hopp 8fa9a8
  if test "$cross_compiling" = yes; then
Karsten Hopp 8fa9a8
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&5
Karsten Hopp 8fa9a8
  $as_echo "cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&6; }
Karsten Hopp 8fa9a8
*** ../vim-7.4.047/src/version.c	2013-10-02 16:46:23.000000000 +0200
Karsten Hopp 8fa9a8
--- src/version.c	2013-10-02 17:19:31.000000000 +0200
Karsten Hopp 8fa9a8
***************
Karsten Hopp 8fa9a8
*** 740,741 ****
Karsten Hopp 8fa9a8
--- 740,743 ----
Karsten Hopp 8fa9a8
  {   /* Add new patch number below this line */
Karsten Hopp 8fa9a8
+ /**/
Karsten Hopp 8fa9a8
+     48,
Karsten Hopp 8fa9a8
  /**/
Karsten Hopp 8fa9a8
Karsten Hopp 8fa9a8
-- 
Karsten Hopp 8fa9a8
I have to exercise early in the morning before my brain
Karsten Hopp 8fa9a8
figures out what I'm doing.
Karsten Hopp 8fa9a8
Karsten Hopp 8fa9a8
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 8fa9a8
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 8fa9a8
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 8fa9a8
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///