diff --git a/configure b/configure
index 7d22b4650ab157174f47316c7008e8e6cebae11a..e2a558aba8eeb9bbc6ec79fdce14260372303829 100755
--- a/configure
+++ b/configure
@@ -494,6 +494,7 @@ sub secondary_variables
                 eval $f->{perl_pre};
             }
 
+            no warnings;
             foreach my $x ('extralibs',
                            'extralibdirs',
                            'extrainc',
@@ -506,11 +507,10 @@ sub secondary_variables
                     my $s = remws($f->{$x});
                     my $prl = '$'.$x.' .= " ".$s." ";'; 
                     #print "PERL $prl\n";
-                    no warnings;
                     eval $prl;
-                    use warnings;
                 }
             }
+            use warnings;
 
             # apply pkg-config libraries and C flags if given
             if($features->{have_pkg_config} &&