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

Johannes Obermayr johannesobermayr at gmx.de
Fri Jan 11 18:23:29 PST 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 Datei geändert, 12 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

diff --git a/configure.ac b/configure.ac
index 10b306e..5bbcf05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,6 +164,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
@@ -1989,6 +1995,8 @@ LDFLAGS="$_SAVE_LDFLAGS"
 CPPFLAGS="$_SAVE_CPPFLAGS"
 
 dnl Add user CFLAGS and CXXFLAGS
+cflags="$CFLAGS"
+cxxflags="$CXXFLAGS"
 CFLAGS="$CFLAGS $USER_CFLAGS"
 CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
 
@@ -2229,14 +2237,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.7.10.4



More information about the mesa-dev mailing list