This patch enables the building of Cygwin Python with a static core
which still supports shared extensions. It takes advantage the latest
Cygwin binutils (i.e., 20030901-1) which can export symbols from
executables:

http://cygwin.com/ml/cygwin-announce/2003-09/msg00002.html

Additionally, it finally lays to rest the following mailing list
subthread:

http://mail.python.org/pipermail/python-list/2002-May/102500.html

I tested the patch under Red Hat Linux 8.0 too
diff --git a/configure.in b/configure.in
index 00483ed..44da831 100644
--- a/configure.in
+++ b/configure.in
@@ -539,6 +539,13 @@
         BASECFLAGS="$BASECFLAGS -pic"
         ;;
   esac
+else # shared is disabled
+  case $ac_sys_system in
+    CYGWIN*)
+          BLDLIBRARY='$(LIBRARY)'
+          LDLIBRARY='libpython$(VERSION).dll.a'
+          ;;
+  esac
 fi
 
 AC_MSG_RESULT($LDLIBRARY)
@@ -1371,6 +1378,11 @@
 			LINKFORSHARED="-Xlinker --export-dynamic"
 		    fi;;
 		  esac;;
+	CYGWIN*)
+		if test $enable_shared = "no"
+		then
+			LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
+		fi;;
 	esac
 fi
 AC_MSG_RESULT($LINKFORSHARED)