--- ./win32/Makefile.mingw.ORIG	2007-01-03 17:11:57.000000000 +0200
+++ ./win32/Makefile.mingw	2007-08-23 23:38:32.000000000 +0300
@@ -55,7 +55,7 @@
 # The linker and its options.
 LD = gcc.exe
 LDFLAGS += -Wl,-L,$(BINDIR) -Wl,-L,$(LIBPREFIX)
-LIBS = -lwsock32
+LIBS =
 
 # The archiver and its options.
 AR = ar.exe
--- ./win32/Makefile.msvc.ORIG	2007-01-03 17:11:57.000000000 +0200
+++ ./win32/Makefile.msvc	2007-08-23 23:38:38.000000000 +0300
@@ -58,7 +58,7 @@
 LD = link.exe
 LDFLAGS = /nologo
 LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
-LIBS = wsock32.lib
+LIBS =
 
 # The archiver and its options.
 AR = lib.exe
--- ./libxslt/Makefile.am.ORIG	2007-01-03 17:11:57.000000000 +0200
+++ ./libxslt/Makefile.am	2007-07-04 03:07:14.000000000 +0300
@@ -50,8 +50,8 @@
 	xsltwin32config.h.in		\
 	libxslt.h
 
-libxslt_la_LIBADD = $(EXTRA_LIBS)
-libxslt_la_LDFLAGS = -version-info @LIBXSLT_VERSION_INFO@
+libxslt_la_LIBADD = $(EXTRA_LIBS) $(WIN32_EXTRA_LIBADD)
+libxslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBXSLT_VERSION_INFO)
 
 man_MANS = libxslt.3
 
--- ./libxslt/xsltutils.c.ORIG	2007-01-15 14:54:32.000000000 +0200
+++ ./libxslt/xsltutils.c	2007-08-23 23:17:46.000000000 +0300
@@ -36,16 +36,12 @@
 #include "imports.h"
 #include "transform.h"
 
-/* gettimeofday on Windows ??? */
-#if defined(WIN32) && !defined(__CYGWIN__)
+#ifndef HAVE_GETTIMEOFDAY
 #ifdef _MSC_VER
-#include <winsock2.h>
-#pragma comment(lib, "ws2_32.lib")
-#define gettimeofday(p1,p2)
-#define HAVE_GETTIMEOFDAY
+#include <windows.h>
 #define XSLT_WIN32_PERFORMANCE_COUNTER
 #endif /* _MS_VER */
-#endif /* WIN32 */
+#endif /* HAVE_GETTIMEOFDAY*/
 
 #ifdef XSLT_NEED_TRIO
 #include "trio.h"
--- ./libxslt/extensions.c.ORIG	2007-01-15 14:54:32.000000000 +0200
+++ ./libxslt/extensions.c	2007-06-26 17:12:46.000000000 +0300
@@ -34,8 +34,10 @@
 
 #ifdef _WIN32
 #include <stdlib.h>             /* for _MAX_PATH */
+#ifndef PATH_MAX
 #define PATH_MAX _MAX_PATH
 #endif
+#endif
 
 #ifdef WITH_XSLT_DEBUG
 #define WITH_XSLT_DEBUG_EXTENSIONS
--- ./configure.in.ORIG	2007-01-17 16:37:13.000000000 +0200
+++ ./configure.in	2007-08-23 23:32:51.000000000 +0300
@@ -511,9 +511,7 @@
 WIN32_EXTRA_LDFLAGS=
 case "$host" in
  *-*-mingw*)
- WIN32_EXTRA_LIBADD="-lwsock32"
- WIN32_EXTRA_LDFLAGS="-no-undefined"
- AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
+ WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version"
  AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
  AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
  ;;
--- ./xsltproc/xsltproc.c.ORIG	2007-01-15 14:54:32.000000000 +0200
+++ ./xsltproc/xsltproc.c	2007-08-23 23:05:21.000000000 +0300
@@ -54,8 +54,7 @@
 #include <libexslt/exsltconfig.h>
 
 #if defined(WIN32) && !defined (__CYGWIN__)
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#include <winsock2.h>
+#if defined(_MSC_VER)
 #define gettimeofday(p1,p2)
 #define snprintf _snprintf
 #endif /* _MS_VER */
--- ./libexslt/Makefile.am.ORIG	2007-01-03 17:11:57.000000000 +0200
+++ ./libexslt/Makefile.am	2007-07-04 02:05:09.000000000 +0300
@@ -28,8 +28,8 @@
 	libexslt.h			\
 	dynamic.c
 
-libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS)
-libexslt_la_LDFLAGS = -version-info @LIBEXSLT_VERSION_INFO@ $(LIBGCRYPT_LIBS)
+libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS) $(WIN32_EXTRA_LIBADD)
+libexslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBEXSLT_VERSION_INFO) $(LIBGCRYPT_LIBS)
 
 man_MANS = libexslt.3
 
