diff --git a/ChangeLog b/ChangeLog
index ce8513a9a..a379e5095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-11  Mike Kestner  <mkestner@ximian.com>
+
+	* configure.in : deal with a csc-ism in source paths.
+	* */Makefile.am : use the GENERATED_SOURCES var.
+	* */glue/Makefile.am : add -no-undefined for win32 dll builds.
+
 2004-06-10  Mike Kestner  <mkestner@ximian.com>
 
 	* configure.in : break the monodoc dep, even though it was optional
diff --git a/art/Makefile.am b/art/Makefile.am
index b95d7e3fb..42921021a 100644
--- a/art/Makefile.am
+++ b/art/Makefile.am
@@ -58,7 +58,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then					\
diff --git a/atk/Makefile.am b/atk/Makefile.am
index ea28a26e2..9268e70d6 100644
--- a/atk/Makefile.am
+++ b/atk/Makefile.am
@@ -47,7 +47,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/atk/glue/Makefile.am b/atk/glue/Makefile.am
index 2fc40609b..0293957e8 100644
--- a/atk/glue/Makefile.am
+++ b/atk/glue/Makefile.am
@@ -1,6 +1,6 @@
 lib_LTLIBRARIES = libatksharpglue.la
 
-libatksharpglue_la_LDFLAGS = -module -avoid-version
+libatksharpglue_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libatksharpglue_la_SOURCES = 	\
 	generated.c		\
diff --git a/configure.in b/configure.in
index fec29f6bb..bd971015d 100644
--- a/configure.in
+++ b/configure.in
@@ -28,6 +28,7 @@ AC_SUBST(BUILD_EXEEXT)
 
 # Set STDC_HEADERS
 AC_HEADER_STDC
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
 # not 64 bit clean in cross-compile
@@ -64,6 +65,7 @@ PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true
 
 if test "x$has_mono" = "xtrue"; then
 GACUTIL_FLAGS='/package $(PACKAGE) /gacdir $(libdir)'
+GENERATED_SOURCES=generated/*.cs
 if test `uname -s` = "Darwin"; then
 	AC_PATH_PROG(RUNTIME, mint, no)
 	AC_PATH_PROG(CSC, mcs, no)
@@ -78,6 +80,7 @@ fi
 else
 AC_PATH_PROG(CSC, csc.exe, no)
 GACUTIL_FLAGS=
+GENERATED_SOURCES=generated\\\\*.cs
 
 if test x$CSC = "xno"; then
 	AC_MSG_ERROR([You need to install either mono or .Net])
@@ -104,6 +107,7 @@ AC_SUBST(GACUTIL)
 AC_SUBST(GACUTIL_FLAGS)
 AC_SUBST(LIB_PREFIX)
 AC_SUBST(LIB_SUFFIX)
+AC_SUBST(GENERATED_SOURCES)
 
 PKG_CHECK_MODULES(GLIB, glib-2.0)
 AC_SUBST(GLIB_CFLAGS)
diff --git a/gda/Makefile.am b/gda/Makefile.am
index e3db95bc6..ef9d7228c 100644
--- a/gda/Makefile.am
+++ b/gda/Makefile.am
@@ -55,7 +55,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 003601ea9..f4a0918c8 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -85,7 +85,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/gdk/glue/Makefile.am b/gdk/glue/Makefile.am
index 4f491ff40..2948eb6c1 100644
--- a/gdk/glue/Makefile.am
+++ b/gdk/glue/Makefile.am
@@ -10,7 +10,7 @@ libgdksharpglue_la_SOURCES =	\
 # Adding a new glue file?
 # Please remember to update makefile.win32
 
-libgdksharpglue_la_LDFLAGS = -module -avoid-version
+libgdksharpglue_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libgdksharpglue_la_LIBADD = $(GTK_LIBS)
 
diff --git a/glade/Makefile.am b/glade/Makefile.am
index 400a12545..28186d6b1 100644
--- a/glade/Makefile.am
+++ b/glade/Makefile.am
@@ -61,7 +61,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/glade/glue/Makefile.am b/glade/glue/Makefile.am
index 87a235f70..16e643559 100644
--- a/glade/glue/Makefile.am
+++ b/glade/glue/Makefile.am
@@ -6,7 +6,7 @@ else
 TARGET = 
 endif
 
-libgladesharpglue_la_LDFLAGS = -module -avoid-version
+libgladesharpglue_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libgladesharpglue_la_SOURCES = 	\
 	gladexml.c
diff --git a/glib/glue/Makefile.am b/glib/glue/Makefile.am
index bbb685cc8..f62fcc1c5 100644
--- a/glib/glue/Makefile.am
+++ b/glib/glue/Makefile.am
@@ -1,6 +1,6 @@
 lib_LTLIBRARIES = libglibsharpglue.la
 
-libglibsharpglue_la_LDFLAGS = -module -avoid-version
+libglibsharpglue_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libglibsharpglue_la_SOURCES = 	\
 	error.c			\
diff --git a/gnome/Makefile.am b/gnome/Makefile.am
index 821a5abd2..28148a4ca 100644
--- a/gnome/Makefile.am
+++ b/gnome/Makefile.am
@@ -91,7 +91,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/gnome/glue/Makefile.am b/gnome/glue/Makefile.am
index f9cafa1e8..697e15342 100644
--- a/gnome/glue/Makefile.am
+++ b/gnome/glue/Makefile.am
@@ -6,7 +6,7 @@ else
 TARGET = 
 endif
 
-libgnomesharpglue_la_LDFLAGS = -module -avoid-version
+libgnomesharpglue_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libgnomesharpglue_la_SOURCES = 	\
 	canvas.c 		\
diff --git a/gnomedb/Makefile.am b/gnomedb/Makefile.am
index 87a956880..0612bba9d 100644
--- a/gnomedb/Makefile.am
+++ b/gnomedb/Makefile.am
@@ -55,7 +55,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 786c8e857..d6b559900 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -116,7 +116,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/gtk/glue/Makefile.am b/gtk/glue/Makefile.am
index 05260e926..9b154f5a5 100644
--- a/gtk/glue/Makefile.am
+++ b/gtk/glue/Makefile.am
@@ -22,7 +22,7 @@ libgtksharpglue_la_SOURCES =	\
 # Adding a new glue file?
 # Please remember to update makefile.win32
 
-libgtksharpglue_la_LDFLAGS = -module -avoid-version
+libgtksharpglue_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libgtksharpglue_la_LIBADD = $(GTK_LIBS)
 
diff --git a/gtkhtml/Makefile.am b/gtkhtml/Makefile.am
index d959d18ee..3fe69b01b 100644
--- a/gtkhtml/Makefile.am
+++ b/gtkhtml/Makefile.am
@@ -56,7 +56,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/pango/Makefile.am b/pango/Makefile.am
index 99200d326..2c0a125e9 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -53,7 +53,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/pango/glue/Makefile.am b/pango/glue/Makefile.am
index 9aca97feb..71397114d 100644
--- a/pango/glue/Makefile.am
+++ b/pango/glue/Makefile.am
@@ -6,7 +6,7 @@ libpangosharpglue_la_SOURCES =	\
 # Adding a new glue file?
 # Please remember to update makefile.win32
 
-libpangosharpglue_la_LDFLAGS = -module -avoid-version
+libpangosharpglue_la_LDFLAGS = -module -avoid-version -no-undefined
 
 libpangosharpglue_la_LIBADD = $(PANGO_LIBS)
 
diff --git a/rsvg/Makefile.am b/rsvg/Makefile.am
index c6986f940..31bef2884 100644
--- a/rsvg/Makefile.am
+++ b/rsvg/Makefile.am
@@ -56,7 +56,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\
diff --git a/sample/Makefile.am b/sample/Makefile.am
index 849b98e26..b86888b52 100755
--- a/sample/Makefile.am
+++ b/sample/Makefile.am
@@ -24,7 +24,7 @@ VTE_TARGETS=
 VTE_ASSEMBLY=
 endif
 
-TARGETS = custom-cellrenderer.exe gtk-hello-world.exe button.exe calendar.exe subclass.exe menu.exe size.exe scribble.exe treeviewdemo.exe managedtreeviewdemo.exe testdnd.exe drawing-sample.exe custom-widget.exe $(GNOME_TARGETS) $(GLADE_TARGETS) $(VTE_TARGETS)
+TARGETS = custom-cellrenderer.exe gtk-hello-world.exe button.exe calendar.exe subclass.exe menu.exe size.exe scribble.exe treeviewdemo.exe managedtreeviewdemo.exe testdnd.exe custom-widget.exe $(GNOME_TARGETS) $(GLADE_TARGETS) $(VTE_TARGETS)
 
 assemblies=../glib/glib-sharp.dll ../pango/pango-sharp.dll ../atk/atk-sharp.dll ../gdk/gdk-sharp.dll ../gtk/gtk-sharp.dll $(GNOME_ASSEMBLY) $(GLADE_ASSEMBLY) $(VTE_ASSEMBLY)
 references=$(addprefix /r:, $(assemblies))
diff --git a/vte/Makefile.am b/vte/Makefile.am
index dc08af3e1..15a19459b 100644
--- a/vte/Makefile.am
+++ b/vte/Makefile.am
@@ -54,7 +54,7 @@ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk
 	cp $(top_srcdir)/gtk-sharp.snk .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk
-	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES)
 
 install-data-local:
 	@if test -n '$(TARGET)'; then						\