--- configure.orig	2003-10-15 18:01:26.000000000 +1000
+++ configure	2012-03-19 22:09:18.000000000 +1100
@@ -2182,17 +2182,9 @@
 if test "$ac_test_CXXFLAGS" = set; then
   CXXFLAGS=$ac_save_CXXFLAGS
 elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
+  CXXFLAGS="$ac_save_CXXFLAGS -g"
 else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
+  CXXFLAGS=$ac_save_CXXFLAGS
 fi
 for ac_declaration in \
    ''\
@@ -7560,17 +7552,17 @@
 #define DEBUG 1
 _ACEOF
 
-		CXXFLAGS="-O2 -Wall -g"
+		CXXFLAGS+=" -Wall -g"
 	else
 		echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-		CXXFLAGS="-O2 -Wall"
+		CXXFLAGS+=" -Wall"
 	fi
 
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-	CXXFLAGS="-O2 -Wall"
+	CXXFLAGS+=" -Wall"
 
 fi;
 
