diff --git a/configure b/configure
index 9280b4ea05ce46b4694db8b265eb80e454630701..c1f64095ad61e4bf8a3fea8773e73440f453a900 100755
--- a/configure
+++ b/configure
@@ -551,13 +551,15 @@ sub secondary_variables
     
     if($generic)
     {
+        no warnings;
 	# code should be portable
-	$coptflags =~ s/-msse\S+//g;
-	$cflags =~ s/-mtune=\S+/-mtune=generic/g;
-	$coptflags =~ s/-mtune=\S+/-mtune=generic/g;
 	$cflags =~ s/-march=\S+//g;
-	$coptflags =~ s/-march=\S+//g;
+	$cflags =~ s/-mtune=\S+/-mtune=generic/g;
+	$coptflags =~ s/-msse\S+//g;
+        $coptflags =~ s/-mtune=\S+/-mtune=generic/g;
+        $coptflags =~ s/-march=\S+//g;
 	$coptflags =~ s/-m(3dnow|popcnt)//g;
+        use warnings;
     }