Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/Makefile.am,v
retrieving revision 1.85
diff -u -p -r1.85 Makefile.am
--- Makefile.am	3 Aug 2005 01:44:58 -0000	1.85
+++ Makefile.am	28 Aug 2005 18:03:43 -0000
@@ -63,7 +63,7 @@ CLEANFILES += atk.c
 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 @@ CLEANFILES += pango.c
 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 @@ EXTRA_DIST += $(PANGOCAIRO_DEFS) pangoca
 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
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/configure.in,v
retrieving revision 1.130
diff -u -p -r1.130 configure.in
--- configure.in	24 Aug 2005 20:40:27 -0000	1.130
+++ configure.in	28 Aug 2005 18:03:43 -0000
@@ -69,6 +69,19 @@ AM_PATH_PYTHON(2.3.5)
 
 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
 
+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
+  PYTHON_INCLUDES=`$echo "$PYTHON_INCLUDES" | sed -e 's/\\\\/\\//g'`
+  py_exec_prefix=`echo "$py_exec_prefix" | sed -e 's/\\\\/\\//g'`
+  pylibversion=`echo $PYTHON_VERSION | sed -e 's/\\.//'`
+  PYLINK_LIBS="-L${py_exec_prefix}/libs -lpython${pylibversion}"
+fi
+AC_SUBST(PYLINK_LIBS)
+
 AC_ARG_ENABLE(thread,
   AC_HELP_STRING([--disable-thread], [Disable pygtk threading support]),,
   enable_thread=yes)
Index: gobject/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gobject/Makefile.am,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile.am
--- gobject/Makefile.am	10 Jul 2005 22:17:15 -0000	1.6
+++ gobject/Makefile.am	28 Aug 2005 18:03:43 -0000
@@ -15,7 +15,7 @@ endif
 
 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 \
Index: gtk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gtk/Makefile.am,v
retrieving revision 1.57
diff -u -p -r1.57 Makefile.am
--- gtk/Makefile.am	3 Aug 2005 01:44:59 -0000	1.57
+++ gtk/Makefile.am	28 Aug 2005 18:03:43 -0000
@@ -53,7 +53,7 @@ gdk.c: $(GDK_DEFS) $(GDK_OVERRIDES)
 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 @@ CLEANFILES += libglade.c
 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
Index: m4/python.m4
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/m4/python.m4,v
retrieving revision 1.1
diff -u -p -r1.1 python.m4
--- m4/python.m4	26 Jul 2004 12:04:20 -0000	1.1
+++ m4/python.m4	28 Aug 2005 18:03:43 -0000
@@ -42,12 +42,18 @@ dnl function also defines PYTHON_INCLUDE
 AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
 [AC_REQUIRE([AM_PATH_PYTHON])
 AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl Win32 doesn't have a versioned directory for headers
+if test "$PYTHON_PLATFORM" != "win32"; then
+  py_versiondir="/python${PYTHON_VERSION}"
+else
+  py_versiondir=
+fi
 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}"
+PYTHON_INCLUDES="-I${py_prefix}/include${py_versiondir}"
 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${py_versiondir}"
 fi
 AC_SUBST(PYTHON_INCLUDES)
 dnl check if the headers exist:
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/tests/Makefile.am,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile.am
--- tests/Makefile.am	10 Jul 2005 22:17:15 -0000	1.20
+++ tests/Makefile.am	28 Aug 2005 18:03:43 -0000
@@ -11,8 +11,13 @@ EXTRA_DIST = $(tests) common.py runtests
 noinst_LTLIBRARIES = testhelper.la
 linked_LIBS = testhelper.la
 
-testhelper_la_LDFLAGS = -module -avoid-version
-testhelper_la_LIBADD = $(GLIB_LIBS)
+common_ldflags = -module -avoid-version
+if PLATFORM_WIN32
+common_ldflags += -no-undefined
+endif
+
+testhelper_la_LDFLAGS = $(common_ldflags) -export-symbols-regex inittesthelper
+testhelper_la_LIBADD = $(GLIB_LIBS) $(PYLINK_LIBS)
 testhelper_la_SOURCES = \
 	testhelpermodule.c \
 	test-thread.c \
