Author: hwright
Date: Fri Dec 14 02:29:24 2012
New Revision: 1421638

URL: http://svn.apache.org/viewvc?rev=1421638&view=rev
Log:
Add a helper configure macro for stripping values from compile-time flags,
and use it in a couple of places in configure.  (More uses coming soon.)

* build/ac-macros/svn-macros.m4
  (SVN_STRIP_FLAG): New.

* configure.ac:
  Use the new macro when stripping flags for clang.

Modified:
    subversion/trunk/build/ac-macros/svn-macros.m4
    subversion/trunk/configure.ac

Modified: subversion/trunk/build/ac-macros/svn-macros.m4
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/svn-macros.m4?rev=1421638&r1=1421637&r2=1421638&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/svn-macros.m4 (original)
+++ subversion/trunk/build/ac-macros/svn-macros.m4 Fri Dec 14 02:29:24 2012
@@ -172,6 +172,16 @@ AC_DEFUN(SVN_MAYBE_ADD_TO_CFLAGS,
   fi
 ])
 
+dnl SVN_STRIP_FLAG(FLAG_VAR_NAME, FLAG)
+dnl
+dnl Remove FLAG from the variable FLAG_VAR_NAME, if it exists.  This macro
+dnl is primarily used for removing unwanted compiler flags, but is really
+dnl just a general wrapper around `sed'.
+AC_DEFUN(SVN_STRIP_FLAG,
+[
+  $1=`echo "$$1" | $SED -e 's/$2//'`
+])
+
 dnl SVN_REMOVE_STANDARD_LIB_DIRS(OPTIONS)
 dnl
 dnl Remove standard library search directories.

Modified: subversion/trunk/configure.ac
URL: 
http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1421638&r1=1421637&r2=1421638&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Fri Dec 14 02:29:24 2012
@@ -1384,12 +1384,12 @@ AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
 # Strip '-no-cpp-precomp' from CPPFLAGS for the clang compiler
 ### I think we get this flag from APR, so the fix probably belongs there
 if test "$CC" = "clang"; then
-  CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'`
+  SVN_STRIP_FLAG(CPPFLAGS, [-no-cpp-precomp ])
 fi
 
 # Clang also doesn't (yet) support the '-ansi' flag
 if test "$CC" = "clang"; then
-  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-ansi //'`
+  SVN_STRIP_FLAG(CFLAGS, [-ansi ])
 fi
 
 dnl Since this is used only on Unix-y systems, define the path separator as '/'


Reply via email to