diff -ur -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/Makefile.am pygtk-2.7.4-patchv2/Makefile.am
--- pygtk-2.7.4-old/Makefile.am	Wed Aug 10 13:25:40 2005
+++ pygtk-2.7.4-patchv2/Makefile.am	Mon Aug 29 16:19:19 2005
@@ -63,7 +63,7 @@
 EXTRA_DIST += $(ATK_DEFS) atk.override
 atk.c: $(ATK_DEFS) atk.override
 atk_la_CFLAGS = $(ATK_CFLAGS)
-atk_la_LIBADD = $(ATK_LIBS)
+atk_la_LIBADD = $(ATK_LIBS) $(PYLINK_LIBS)
 atk_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initatk
 atk_la_SOURCES = atkmodule.c
 nodist_atk_la_SOURCES = atk.c
@@ -78,7 +78,7 @@
 EXTRA_DIST += $(PANGO_DEFS) pango.override
 pango.c: $(PANGO_DEFS) pango.override
 pango_la_CFLAGS = $(PANGO_CFLAGS)
-pango_la_LIBADD = $(PANGO_LIBS)
+pango_la_LIBADD = $(PANGO_LIBS) $(PYLINK_LIBS)
 pango_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initpango
 pango_la_SOURCES = pangomodule.c
 nodist_pango_la_SOURCES = pango.c
@@ -94,7 +94,7 @@
 pangocairo.c: $(PANGOCAIRO_DEFS) pangocairo.override
 pangocairo_la_CFLAGS = $(PANGOCAIRO_CFLAGS)
 pangocairo_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initpangocairo
-pangocairo_la_LIBADD = $(PANGOCAIRO_LIBS)
+pangocairo_la_LIBADD = $(PANGOCAIRO_LIBS) $(PYLINK_LIBS)
 pangocairo_la_SOURCES = pangocairomodule.c
 nodist_pangocairo_la_SOURCES = pangocairo.c
 if BUILD_PANGOCAIRO
diff -ur -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/configure.in pygtk-2.7.4-patchv2/configure.in
--- pygtk-2.7.4-old/configure.in	Wed Aug 24 10:38:35 2005
+++ pygtk-2.7.4-patchv2/configure.in	Thu Sep  1 11:35:31 2005
@@ -65,9 +65,11 @@
 AC_LIBTOOL_WIN32_DLL
 AC_PROG_LIBTOOL
 
-AM_PATH_PYTHON(2.3.5)
+AM_PATH_PYTHON(2.3.5,, [AC_MSG_ERROR(could not find Python)])
 
 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
+
+AM_CHECK_PYTHON_LIB
 
 AC_ARG_ENABLE(thread,
   AC_HELP_STRING([--disable-thread], [Disable pygtk threading support]),,
diff -ur -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/gobject/Makefile.am pygtk-2.7.4-patchv2/gobject/Makefile.am
--- pygtk-2.7.4-old/gobject/Makefile.am	Wed Jul 13 06:10:01 2005
+++ pygtk-2.7.4-patchv2/gobject/Makefile.am	Mon Aug 29 16:19:19 2005
@@ -15,7 +15,7 @@
 
 gobject_la_CFLAGS = $(GLIB_CFLAGS)
 gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initgobject
-gobject_la_LIBADD = $(GLIB_LIBS)
+gobject_la_LIBADD = $(GLIB_LIBS) $(PYLINK_LIBS)
 gobject_la_SOURCES = \
 	gobjectmodule.c \
 	pygboxed.c \
diff -ur -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/gtk/Makefile.am pygtk-2.7.4-patchv2/gtk/Makefile.am
--- pygtk-2.7.4-old/gtk/Makefile.am	Wed Aug 10 13:25:40 2005
+++ pygtk-2.7.4-patchv2/gtk/Makefile.am	Mon Aug 29 16:19:19 2005
@@ -53,7 +53,7 @@
 gtk.c: $(GTK_DEFS) $(GTK_OVERRIDES)
 _gtk_la_CFLAGS = $(GTK_CFLAGS)
 _gtk_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gtk
-_gtk_la_LIBADD = $(GTK_LIBS)
+_gtk_la_LIBADD = $(GTK_LIBS) $(PYLINK_LIBS)
 _gtk_la_SOURCES = 		\
 	gtk-types.c 		\
 	gtkmodule.c 		\
@@ -79,7 +79,7 @@
 EXTRA_DIST += $(LIBGLADE_DEFS) libglade.override
 libglade.c: $(LIBGLADE_DEFS) libglade.override
 glade_la_CFLAGS = $(LIBGLADE_CFLAGS)
-glade_la_LIBADD = $(LIBGLADE_LIBS)
+glade_la_LIBADD = $(LIBGLADE_LIBS) $(PYLINK_LIBS)
 glade_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initglade
 glade_la_SOURCES = libglademodule.c
 nodist_glade_la_SOURCES = libglade.c
diff -ur -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/m4/python.m4 pygtk-2.7.4-patchv2/m4/python.m4
--- pygtk-2.7.4-old/m4/python.m4	Sat Aug 27 14:23:37 2005
+++ pygtk-2.7.4-patchv2/m4/python.m4	Thu Sep  1 12:37:34 2005
@@ -1,7 +1,7 @@
 ## this one is commonly used with AM_PATH_PYTHONDIR ...
 dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
 dnl Check if a module containing a given symbol is visible to python.
-AC_DEFUN(AM_CHECK_PYMOD,
+AC_DEFUN([AM_CHECK_PYMOD],
 [AC_REQUIRE([AM_PATH_PYTHON])
 py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
 AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
@@ -45,9 +45,26 @@
 dnl deduce PYTHON_INCLUDES
 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+py_mingw_cmd="import sys
+if sys.version.find('[GCC ') is not -1 and sys.version.find('(mingw-special)]') is not -1:
+  print 'yes'
+else:
+  print 'no'"
+py_mingw=`python -c "$py_mingw_cmd"`
+if test "$PYTHON_PLATFORM" = "win32"
+then
+  py_prefix=`echo "$py_prefix" | sed -e 's/\\\\/\\//g'`
+  py_exec_prefix=`echo "$py_exec_prefix" | sed -e 's/\\\\/\\//g'`
+  if test "x$py_mingw" = "xyes"
+  then
+    include_suffix=/python${PYTHON_VERSION}
+  else
+    include_suffix=
+  fi
+fi
+PYTHON_INCLUDES="-I${py_prefix}/include${include_suffix}"
 if test "$py_prefix" != "$py_exec_prefix"; then
-  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include${include_suffix}"
 fi
 AC_SUBST(PYTHON_INCLUDES)
 dnl check if the headers exist:
@@ -59,4 +76,38 @@
 [AC_MSG_RESULT(not found)
 $2])
 CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl a macro to check for the python library
+dnl AM_CHECK_PYTHON_LIB([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl function also defines PYLINK_LIBS
+AC_DEFUN([AM_CHECK_PYTHON_LIB],
+[AC_REQUIRE([AM_CHECK_PYTHON_HEADERS])
+AC_MSG_CHECKING(for the python library flags needed)
+dnl Win32 needs all symbols resolved for linking, even for DLLs
+dnl Assume the link library is in $exec_prefix/libs
+dnl This might be able to be figured out from distutils, but it's
+dnl not documented so we won't rely on internal implementation
+PYLINK_LIBS=
+if test "x$platform_win32" = "xyes"; then
+  pyexecdir=`echo "$pyexecdir" | sed -e 's/\\\\/\\//g'`
+  pythondir=`echo "$pythondir" | sed -e 's/\\\\/\\//g'`
+  pylibversion=`echo $PYTHON_VERSION | sed -e 's/\\.//'`
+  if test "x$py_mingw" = "xno"
+  then
+    PYLINK_LIBS="-L${py_exec_prefix}/libs"
+  fi
+  PYLINK_LIBS="$PYLINK_LIBS -lpython${pylibversion}"
+fi
+if test "x$PYLINK_LIBS" = "x"
+then
+  AC_MSG_RESULT(None needed)
+  ifelse([$2], [],, [$2
+])dnl
+else
+  AC_MSG_RESULT($PYLINK_LIBS)
+  ifelse([$1], [],, [$1
+])dnl
+fi
+AC_SUBST(PYLINK_LIBS)
 ])
diff -ur -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/tests/Makefile.am pygtk-2.7.4-patchv2/tests/Makefile.am
--- pygtk-2.7.4-old/tests/Makefile.am	Wed Jul 13 06:10:01 2005
+++ pygtk-2.7.4-patchv2/tests/Makefile.am	Mon Aug 29 16:19:19 2005
@@ -12,11 +12,15 @@
 linked_LIBS = testhelper.la
 
 testhelper_la_LDFLAGS = -module -avoid-version
-testhelper_la_LIBADD = $(GLIB_LIBS)
+testhelper_la_LIBADD = $(GLIB_LIBS) $(PYLINK_LIBS)
 testhelper_la_SOURCES = \
 	testhelpermodule.c \
 	test-thread.c \
 	test-unknown.c 
+
+if PLATFORM_WIN32
+testhelper_la_LDFLAGS += -no-undefined
+endif
 
 tests =  \
 	test_conversion.py \
diff -ur -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/tests/runtests.py pygtk-2.7.4-patchv2/tests/runtests.py
--- pygtk-2.7.4-old/tests/runtests.py	Sat Jul  9 12:20:23 2005
+++ pygtk-2.7.4-patchv2/tests/runtests.py	Mon Aug 29 16:44:05 2005
@@ -23,6 +23,10 @@
 
 SKIP_FILES = ['common', 'runtests', 'testmodule']
 
+# Win32 doesn't support os.fork()
+if sys.platform == 'win32':
+    SKIP_FILES.append('test_mainloop')
+
 dir = os.path.split(os.path.abspath(__file__))[0]
 os.chdir(dir)
 
