--- configure.orig	Mon Apr 15 18:54:58 2002
+++ configure	Sat Aug 31 14:21:47 2002
@@ -2733,7 +2733,7 @@
 if test "${GCC}" = "yes"; then
 	echo $ac_n "checking version of GCC""... $ac_c" 1>&6
 echo "configure:2736: checking version of GCC" >&5
-	GCC_version=`${CC} --version`
+	GCC_version=`${CC} --version | sed -n '1s/^[^ ]* (.*) //;s/ .*$//;1p'`
 	echo "$ac_t""${GCC_version}" 1>&6
 fi
 
@@ -5541,7 +5541,7 @@
 	3.*)
 		# -funroll-loops seems to produce buggy code with gcc 3.0.3
 		OPTIMIZATION="-O -fomit-frame-pointer -ffast-math \
-			-funroll-loops -maccumulate-outgoing-args"
+			-funroll-loops"
 		;;
 	*)
 		# default
@@ -5555,11 +5555,15 @@
 	OPTIMIZATION_NORM="-fschedule-insns2"
 
 	OPTIMIZATION_FULL="-fmove-all-movables -freduce-all-givs \
-			-fsched-interblock -fbranch-count-reg -fforce-addr \
+			-fbranch-count-reg -fforce-addr \
 			-fforce-mem"
 
 	case "${CONFIG_EXPOPT}" in
 	no)
+		# if someone supplies own CFLAGS, we don't add our own
+		if [ "X${ac_save_CFLAGS}" != "X" ]; then
+			OPTIMIZATION=""
+		fi
 		;;
 	norm|yes)
 		OPTIMIZATION="${OPTIMIZATION} ${OPTIMIZATION_NORM}"
