diff -ruw -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/Makefile.am pygtk-2.7.4/Makefile.am
--- pygtk-2.7.4-old/Makefile.am	Wed Aug 10 13:25:40 2005
+++ pygtk-2.7.4/Makefile.am	Thu Aug 25 19:40:55 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) $(PYTHON_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) $(PYTHON_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) $(PYTHON_LIBS)
 pangocairo_la_SOURCES = pangocairomodule.c
 nodist_pangocairo_la_SOURCES = pangocairo.c
 if BUILD_PANGOCAIRO
diff -ruw -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/configure.in pygtk-2.7.4/configure.in
--- pygtk-2.7.4-old/configure.in	Wed Aug 24 10:38:35 2005
+++ pygtk-2.7.4/configure.in	Thu Aug 25 12:35:46 2005
@@ -69,6 +69,8 @@
 
 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]),,
   enable_thread=yes)
diff -ruw -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/gobject/Makefile.am pygtk-2.7.4/gobject/Makefile.am
--- pygtk-2.7.4-old/gobject/Makefile.am	Wed Jul 13 06:10:01 2005
+++ pygtk-2.7.4/gobject/Makefile.am	Thu Aug 25 19:40:18 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) $(PYTHON_LIBS)
 gobject_la_SOURCES = \
 	gobjectmodule.c \
 	pygboxed.c \
diff -ruw -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/gtk/Makefile.am pygtk-2.7.4/gtk/Makefile.am
--- pygtk-2.7.4-old/gtk/Makefile.am	Wed Aug 10 13:25:40 2005
+++ pygtk-2.7.4/gtk/Makefile.am	Thu Aug 25 19:46:10 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) $(PYTHON_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) $(PYTHON_LIBS)
 glade_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initglade
 glade_la_SOURCES = libglademodule.c
 nodist_glade_la_SOURCES = libglade.c
diff -ruw -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/m4/python.m4 pygtk-2.7.4/m4/python.m4
--- pygtk-2.7.4-old/m4/python.m4	Sat Aug 27 14:23:37 2005
+++ pygtk-2.7.4/m4/python.m4	Sat Aug 27 14:40:49 2005
@@ -60,3 +60,39 @@
 $2])
 CPPFLAGS="$save_CPPFLAGS"
 ])
+
+AC_DEFUN([AM_CHECK_PYTHON_LIB],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_REQUIRE([AM_CHECK_PYTHON_HEADERS])
+
+if [[ "$PYTHON_PLATFORM" = "win32" ]]
+then
+    pyver=`echo $PYTHON_VERSION | sed -e 's/\.//'`
+else
+    pyver=$PYTHON_VERSION
+fi
+
+
+AC_MSG_CHECKING(for libpython${pyver}.a)
+
+py_config_dir=`$PYTHON -c "import os; print os.path.normpath('$pyexecdir/../config')"`
+
+py_makefile="${py_config_dir}/Makefile"
+if test -f "$py_makefile"; then
+dnl extra required libs
+  py_localmodlibs=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $py_makefile`
+  py_basemodlibs=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $py_makefile`
+  py_other_libs=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $py_makefile`
+
+dnl now the actual libpython
+  if test -e "${py_config_dir}/libpython${pyver}.a"; then
+    PYTHON_LIBS="-L${py_config_dir} -lpython${pyver} $py_localmodlibs $py_basemodlibs $py_other_libs"
+    AC_MSG_RESULT(found)
+  else
+    AC_MSG_RESULT(not found)
+  fi
+else
+  AC_MSG_RESULT(not found)
+fi
+AC_SUBST(PYTHON_LIBS)])
+
diff -ruw -x Makefile.in -x aclocal.m4 -x configure pygtk-2.7.4-old/tests/Makefile.am pygtk-2.7.4/tests/Makefile.am
--- pygtk-2.7.4-old/tests/Makefile.am	Wed Jul 13 06:10:01 2005
+++ pygtk-2.7.4/tests/Makefile.am	Thu Aug 25 19:54:13 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) $(PYTHON_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 \
