[Mesa-dev] [PATCH 03/21] configure.ac: Save user {C, CXX}FLAGS and append them at end.

Johannes Obermayr johannesobermayr at gmx.de
Wed Sep 11 15:32:41 PDT 2013


This way the user has the privilege of last decision and so the option to build an optimized debug build again.
---
 configure.ac | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d280e38..e3d323d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,12 @@ cygwin*)
     ;;
 esac
 
+dnl Save user {C,CXX}FLAGS
+USER_CFLAGS="$CFLAGS"
+USER_CXXFLAGS="$CXXFLAGS"
+CFLAGS=""
+CXXFLAGS=""
+
 dnl Add flags for gcc and g++
 if test "x$GCC" = xyes; then
     case "$host_os" in
@@ -1976,6 +1982,8 @@ if test "x$acv_mesa_CLANG" = xyes; then
 fi
 
 dnl Add user CFLAGS and CXXFLAGS
+cflags="$CFLAGS"
+cxxflags="$CXXFLAGS"
 CFLAGS="$CFLAGS $USER_CFLAGS"
 CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
 
@@ -2222,14 +2230,16 @@ echo "        Shared-glapi:    $enable_shared_glapi"
 
 dnl Compiler options
 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
-cflags=`echo $CFLAGS | \
+cflags=`echo $cflags | \
     $SED 's/^ *//;s/  */ /;s/ *$//'`
-cxxflags=`echo $CXXFLAGS | \
+cxxflags=`echo $cxxflags | \
     $SED 's/^ *//;s/  */ /;s/ *$//'`
 defines=`echo $DEFINES | $SED 's/^ *//;s/  */ /;s/ *$//'`
 echo ""
 echo "        CFLAGS:          $cflags"
+echo "        USER_CFLAGS:     $USER_CFLAGS"
 echo "        CXXFLAGS:        $cxxflags"
+echo "        USER_CXXFLAGS:   $USER_CXXFLAGS"
 echo "        Macros:          $defines"
 echo ""
 if test "x$MESA_LLVM" = x1; then
-- 
1.8.1.4



More information about the mesa-dev mailing list