diff --git a/configure.ac b/configure.ac
old mode 100644
new mode 100755
index 7a40c64..5abbe4c
--- a/configure.ac
+++ b/configure.ac
@@ -246,13 +246,19 @@ AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
 AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
 AM_CONDITIONAL(OS_LINUX, test "$os_linux" = "yes")
 
-if test "$os_win32" = "yes"; then
+if test "$platform_win32" = "yes"; then
   AC_CHECK_TOOL(WINDRES, windres, no)
   if test "$WINDRES" = no; then
     AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
   fi
-  AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
 fi
+
+if test "$os_win32" = "yes"; then
+	if test "$enable_shared" = "yes"; then
+  	AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
+  fi
+fi
+
 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
 
 m4_define([debug_default],
@@ -366,6 +372,9 @@ if test "$enable_win32_backend" = "yes"; then
   cairo_backends="$cairo_backends cairo-win32"
   GDK_BACKENDS="$GDK_BACKENDS win32"
   backend_immodules="$backend_immodules,ime"
+  if test "$os_win32" != "yes"; then
+    have_gio_unix=yes
+  fi  
   GDK_WINDOWING="$GDK_WINDOWING
 #define GDK_WINDOWING_WIN32"
   GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm"
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
old mode 100644
new mode 100755
index 3fcc35c..760d758
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -179,10 +179,14 @@ endif # USE_QUARTZ
 if USE_WIN32
 libgdk_3_la_SOURCES += gdkkeynames.c
 libgdk_3_la_LIBADD += win32/libgdk-win32.la
-libgdk_3_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
-libgdk_3_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def
+libgdk_3_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o
+libgdk_3_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o
 endif # USE_WIN32
 
+if MS_LIB_AVAILABLE
+libgdk_3_la_LDFLAGS += -Wl,--output-def -Wl,gdk.def
+endif # MS_LIB_AVAILABLE
+
 if USE_BROADWAY
 libgdk_3_la_LIBADD += broadway/libgdk-broadway.la
 endif # USE_BROADWAY
@@ -281,10 +285,11 @@ CLEANFILES += $(gir_DATA) $(typelibs_DATA)
 
 endif # HAVE_INTROSPECTION
 
-if OS_WIN32
-install-def-file: gdk.def
+if MS_LIB_AVAILABLE
+CLEANFILES += gdk.def
+install-def-file:
 	mkdir -p $(DESTDIR)$(libdir)
-	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
+	$(INSTALL) gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
 uninstall-def-file:
 	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
 else
@@ -293,17 +298,21 @@ uninstall-def-file:
 endif
 
 if MS_LIB_AVAILABLE
+libgdk_dlname = `sed -n "s/^dlname='\([A-Za-z0-9.+-]\+\)'/\1/p" libgdk-3.la`
 noinst_DATA = gdk-win32-$(GTK_API_VERSION).lib
+CLEANFILES += gdk-win32-$(GTK_API_VERSION).lib gdk-win32-$(GTK_API_VERSION).exp
 
-gdk-win32-$(GTK_API_VERSION).lib: libgdk-win32-$(GTK_API_VERSION).la gdk.def
-	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
+gdk-win32-$(GTK_API_VERSION).lib: libgdk-3.la
+	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:$(libgdk_dlname) -def:gdk.def -out:$@
 
 install-ms-lib:
 	mkdir -p $(DESTDIR)$(libdir)
 	$(INSTALL) gdk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
+	$(INSTALL) gdk-win32-$(GTK_API_VERSION).exp $(DESTDIR)$(libdir)
 
 uninstall-ms-lib:
 	-rm $(DESTDIR)$(libdir)/gdk-win32-$(GTK_API_VERSION).lib
+	-rm $(DESTDIR)$(libdir)/gdk-win32-$(GTK_API_VERSION).exp
 else
 install-ms-lib:
 uninstall-ms-lib:
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
old mode 100644
new mode 100755
index 6b35059..9f02335
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -70,7 +70,7 @@
  
 /* The mingw.org compiler does not export GUIDS in it's import library. To work
  * around that, define INITGUID to have the GUIDS declared. */
-#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && !defined(__MINGW64_VERSION_MAJOR)
 #define INITGUID
 #endif
 
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
old mode 100644
new mode 100755
index d0ceb1c..d85ce3d
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -56,22 +56,22 @@ AM_CPPFLAGS =						\
 	$(GTK_DEP_CFLAGS)				\
 	$(INCLUDED_IMMODULE_DEFINE)
 
+CLEANFILES =
+
 if PLATFORM_WIN32
 no_undefined = -no-undefined
 endif
 
-if OS_WIN32
-gtk_def = gtk.def
-gtk_win32_symbols = -export-symbols $(srcdir)/gtk.def
-
+if MS_LIB_AVAILABLE
+CLEANFILES += gtk.def
 gtk_win32_res = gtk-win32-res.o
 gtk_win32_res_ldflag = -Wl,gtk-win32-res.o
 
 gtk-win32-res.o : gtk-win32.rc
 	$(WINDRES) gtk-win32.rc $@
 
-install-def-file: gtk.def
-	$(INSTALL) $(srcdir)/gtk.def $(DESTDIR)$(libdir)/gtk-win32-3.0.def
+install-def-file:
+	$(INSTALL) gtk.def $(DESTDIR)$(libdir)/gtk-win32-3.0.def
 uninstall-def-file:
 	-rm $(DESTDIR)$(libdir)/gtk-win32-3.0.def
 else
@@ -79,17 +79,23 @@ install-def-file:
 uninstall-def-file:
 endif
 
+
+
 if MS_LIB_AVAILABLE
+libgtk_dlname = `sed -n "s/^dlname='\([A-Za-z0-9.+-]\+\)'/\1/p" libgtk-3.la`
 noinst_DATA = gtk-win32-$(GTK_API_VERSION).lib
+CLEANFILES += gdk-win32-$(GTK_API_VERSION).lib gdk-win32-$(GTK_API_VERSION).exp
 
-gtk-win32-$(GTK_API_VERSION).lib: libgtk-win32-$(GTK_API_VERSION).la gtk.def
-	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgtk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gtk.def -out:$@
+gtk-win32-$(GTK_API_VERSION).lib: libgtk-3.la
+	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:$(libgtk_dlname) -def:gtk.def -out:$@
 
 install-ms-lib:
 	$(INSTALL) gtk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
+	$(INSTALL) gtk-win32-$(GTK_API_VERSION).exp $(DESTDIR)$(libdir)
 
 uninstall-ms-lib:
 	-rm $(DESTDIR)$(libdir)/gtk-win32-$(GTK_API_VERSION).lib
+	-rm $(DESTDIR)$(libdir)/gtk-win32-$(GTK_API_VERSION).exp
 else
 install-ms-lib:
 uninstall-ms-lib:
@@ -1240,10 +1246,14 @@ libgtk_3_la_DEPENDENCIES = $(deps)
 if USE_WIN32
 libgtk_3_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32
 libgtk_3_la_LDFLAGS += -Wl,-luuid
-libgtk_3_la_DEPENDENCIES += $(gtk_def) $(gtk_win32_res) $(deps)
-libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols)
+libgtk_3_la_DEPENDENCIES += $(gtk_win32_res) $(deps)
+libgtk_target_ldflags = $(gtk_win32_res_ldflag)
 endif
 
+if MS_LIB_AVAILABLE
+libgtk_3_la_LDFLAGS += -Wl,--output-def -Wl,gtk.def
+endif # MS_LIB_AVAILABLE
+
 install-exec-hook:
 if DISABLE_EXPLICIT_DEPS
 	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgtk-3.la
diff --git a/libgail-util/Makefile.am b/libgail-util/Makefile.am
old mode 100644
new mode 100755
index 4e9c192..66a49d5
--- a/libgail-util/Makefile.am
+++ b/libgail-util/Makefile.am
@@ -1,13 +1,15 @@
 include $(top_srcdir)/Makefile.decl
 
-EXTRA_DIST += gailutil.def
 if PLATFORM_WIN32
 no_undefined = -no-undefined
 endif
-if OS_WIN32
-export_symbols = -export-symbols $(srcdir)/gailutil.def
-install-def-file: gailutil.def
-	$(INSTALL) $(srcdir)/gailutil.def $(DESTDIR)$(libdir)
+
+CLEANFILES =
+
+if MS_LIB_AVAILABLE
+CLEANFILES += gailutil.def
+install-def-file:
+	$(INSTALL) gailutil.def $(DESTDIR)$(libdir)
 uninstall-def-file:
 	-rm $(DESTDIR)$(libdir)/gailutil.def
 else
@@ -17,12 +19,15 @@ endif
 
 if MS_LIB_AVAILABLE
 noinst_DATA = gailutil.lib
+CLEANFILES += gailutil.lib gailutil.exp gailutil.def
 
 install-ms-lib:
 	$(INSTALL) gailutil.lib $(DESTDIR)$(libdir)
+	$(INSTALL) gailutil.exp $(DESTDIR)$(libdir)
 
 uninstall-ms-lib:
 	-rm $(DESTDIR)$(libdir)/gailutil.lib
+	-rm $(DESTDIR)$(libdir)/gailutil.exp
 else
 install-ms-lib:
 uninstall-ms-lib:
@@ -71,11 +76,16 @@ libgailutil_3_la_LIBADD = \
 libgailutil_3_la_LDFLAGS = \
 	-version-info $(GAIL_LT_VERSION_INFO)	\
 	$(no_undefined)				\
-	$(export_symbols)			\
         $(LDFLAGS)
+        
+if MS_LIB_AVAILABLE
+libgailutil_3_la_LDFLAGS += -Wl,--output-def -Wl,gailutil.def
+endif # MS_LIB_AVAILABLE
+
+libgailutil_dlname = `sed -n "s/^dlname='\([A-Za-z0-9.+-]\+\)'/\1/p" libgailutil-3.la`
 
-gailutil.lib: libgailutil-3.la gailutil.def
-	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgailutil-3.0-$(GAIL_LT_CURRENT_MINUS_AGE).dll -def:gailutil.def -out:$@
+gailutil.lib: libgailutil-3.la
+	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:$(libgailutil_dlname) -def:gailutil.def -out:$@
 
 install-data-local: install-ms-lib install-def-file
 
diff --git a/libgail-util/gailutil.def b/libgail-util/gailutil.def
index 5c74915..49271e4 100644
--- a/libgail-util/gailutil.def
+++ b/libgail-util/gailutil.def
@@ -1,14 +1,14 @@
 EXPORTS
-	gail_misc_add_attribute
-	gail_misc_buffer_get_run_attributes
-	gail_misc_get_default_attributes
-	gail_misc_get_extents_from_pango_rectangle
-	gail_misc_get_index_at_point_in_layout
-	gail_misc_get_origins
-	gail_misc_layout_get_run_attributes
-	gail_text_util_buffer_setup
-	gail_text_util_get_substring
-	gail_text_util_get_text
-	gail_text_util_get_type
-	gail_text_util_new
-	gail_text_util_text_setup
+    gail_misc_add_attribute @1
+    gail_misc_buffer_get_run_attributes @2
+    gail_misc_get_default_attributes @3
+    gail_misc_get_extents_from_pango_rectangle @4
+    gail_misc_get_index_at_point_in_layout @5
+    gail_misc_get_origins @6
+    gail_misc_layout_get_run_attributes @7
+    gail_text_util_buffer_setup @8
+    gail_text_util_get_substring @9
+    gail_text_util_get_text @10
+    gail_text_util_get_type @11
+    gail_text_util_new @12
+    gail_text_util_text_setup @13
