Configure: make -mno-cygwin optional on mingw platforms.
PR: 2381
diff --git a/Configure b/Configure
index e2efb5b..b638a0b 100755
--- a/Configure
+++ b/Configure
@@ -1131,6 +1131,12 @@
 if (defined($postlflags))	{ $lflags=$postlflags;	}
 else				{ $lflags=$prelflags; undef $prelflags;	}
 
+if ($target =~ /^mingw/ && `$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
+	{
+	$cflags =~ s/\-mno\-cygwin\s*//;
+	$shared_ldflag =~ s/\-mno\-cygwin\s*//;
+	}
+
 my $no_shared_warn=0;
 my $no_user_cflags=0;