Index: configure
===================================================================
--- configure	(revision 12)
+++ configure	(working copy)
@@ -16235,9 +16235,11 @@
 
 
 
+
 for ac_func in putenv strdup strerror strsignal mkstemp getpagesize \
 	getdtablesize strstr ftruncate floorl ceill sqrtl frexpl ldexpl asinl \
-	acosl atanl logl expl tanl sinl cosl truncl lrintl strsep strpbrk
+	acosl atanl logl expl tanl sinl cosl truncl lrintl strsep strpbrk \
+	symlink
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -18084,7 +18086,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18087 "configure"
+#line 18089 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -21647,17 +21649,17 @@
 
 else
 
-            { echo "$as_me:$LINENO: checking For listen in -lwsock32" >&5
-echo $ECHO_N "checking For listen in -lwsock32... $ECHO_C" >&6; }
+            { echo "$as_me:$LINENO: checking For listen in -lws2_32" >&5
+echo $ECHO_N "checking For listen in -lws2_32... $ECHO_C" >&6; }
     OLD_LIBS="$LIBS"
-    LIBS="-lwsock32 $LIBS"
+    LIBS="-lws2_32 $LIBS"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <winsock.h>
+#include <winsock2.h>
 int
 main ()
 {
@@ -21684,7 +21686,7 @@
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_wsock32_listen=yes
+  ac_cv_lib_ws2_32_listen=yes
                     { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
 else
@@ -22146,7 +22148,10 @@
 fi
 
 
-if test $gst_cv_inet_sockets = yes || test $ac_cv_lib_wsock32_listen = yes; then
+if test "$ac_cv_lib_ws2_32_listen" = "yes"; then
+    gst_cv_inet_sockets=yes
+fi
+if test $gst_cv_inet_sockets = yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_INET_SOCKETS 1
Index: configure.ac
===================================================================
--- configure.ac	(revision 12)
+++ configure.ac	(working copy)
@@ -213,7 +213,8 @@
 GST_REPLACE_POLL
 AC_REPLACE_FUNCS(putenv strdup strerror strsignal mkstemp getpagesize \
 	getdtablesize strstr ftruncate floorl ceill sqrtl frexpl ldexpl asinl \
-	acosl atanl logl expl tanl sinl cosl truncl lrintl strsep strpbrk)
+	acosl atanl logl expl tanl sinl cosl truncl lrintl strsep strpbrk \
+	symlink)
 AC_CHECK_FUNCS_ONCE(gethostname memcpy memmove sighold uname sbrk usleep lstat \
 	grantpt popen getrusage gettimeofday getcwd fork strchr	utimes utime \
 	sigsetmask alarm select mprotect madvise nl_langinfo waitpid \
Index: libgst/cint.c
===================================================================
--- libgst/cint.c	(revision 12)
+++ libgst/cint.c	(working copy)
@@ -232,6 +232,7 @@
 		     gst_stat * out);
 static int my_putenv (const char *str);
 static int my_chdir (const char *str);
+static int my_symlink(const char* oldpath, const char* newpath);
 static DIR *my_opendir (const char *str);
 static char *extract_dirent_name (struct dirent *dir);
 
@@ -531,7 +532,7 @@
   _gst_define_cfunc ("rewinddir", rewinddir);
   _gst_define_cfunc ("extractDirentName", extract_dirent_name);
 
-  _gst_define_cfunc ("symlink", symlink);
+  _gst_define_cfunc ("symlink", my_symlink);
   _gst_define_cfunc ("unlink", unlink);
   _gst_define_cfunc ("rename", rename);
   _gst_define_cfunc ("rmdir", rmdir);
@@ -1244,3 +1245,9 @@
   xfree (funcName);
   SET_COBJECT_VALUE (desc->cFunction, cfi);
 }
+
+static int my_symlink(const char* oldpath, const char* newpath)
+{
+    return symlink(oldpath,  newpath);
+}
+ 
Index: build-aux/inet.m4
===================================================================
--- build-aux/inet.m4	(revision 12)
+++ build-aux/inet.m4	(working copy)
@@ -3,13 +3,13 @@
 AC_DEFUN([GST_INET_SOCKETS], [
 
 AC_SEARCH_LIBS(listen, socket, [], [
-    dnl Check for listen on MinGW. We need to include <winsock.h>
+    dnl Check for listen on MinGW. We need to include <winsock2.h>
     dnl to get the correct __stdcall name decoration
-    AC_MSG_CHECKING([For listen in -lwsock32])
+    AC_MSG_CHECKING([For listen in -lws2_32])
     OLD_LIBS="$LIBS"
-    LIBS="-lwsock32 $LIBS"
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>]],[[listen(0,0);]])],
-                   [ac_cv_lib_wsock32_listen=yes
+    LIBS="-lws2_32 $LIBS"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]],[[listen(0,0);]])],
+                   [ac_cv_lib_ws2_32_listen=yes
                     AC_MSG_RESULT(yes)],
                    [LIBS="$OLD_LIBS"
                     AC_MSG_RESULT(no)])])
@@ -19,7 +19,10 @@
 AC_CHECK_FUNC(socket, , gst_cv_inet_sockets=no)
 AC_CHECK_HEADER(netinet/in.h, , gst_cv_inet_sockets=no)
 AC_CHECK_HEADER(arpa/inet.h, , gst_cv_inet_sockets=no)
-if test $gst_cv_inet_sockets = yes || test $ac_cv_lib_wsock32_listen = yes; then
+if test "$ac_cv_lib_ws2_32_listen" = "yes"; then
+    gst_cv_inet_sockets=yes
+fi
+if test $gst_cv_inet_sockets = yes; then
   AC_DEFINE(HAVE_INET_SOCKETS, 1, [Define if your system's sockets provide access to the Internet.])
 fi
 
Index: lib-src/Makefile.in
===================================================================
--- lib-src/Makefile.in	(revision 12)
+++ lib-src/Makefile.in	(working copy)
@@ -44,7 +44,7 @@
 	frexpl.c ftruncate.c getdtablesize.c getpagesize.c ldexpl.c \
 	logl.c lrintl.c mkstemp.c obstack.c obstack.h poll.c putenv.c \
 	sinl.c sqrtl.c strdup.c strerror.c strpbrk.c strsep.c \
-	strsignal.c strstr.c strtoul.c tanl.c truncl.c
+	strsignal.c strstr.c strtoul.c symlink.c tanl.c truncl.c
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/build-aux/bold.m4 \
 	$(top_srcdir)/build-aux/codeset.m4 \
@@ -366,6 +366,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strsignal.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strstr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/symlink.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/tanl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/truncl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avltrees.Plo@am__quote@
Index: lib-src/mkstemp.c
===================================================================
--- lib-src/mkstemp.c	(revision 12)
+++ lib-src/mkstemp.c	(working copy)
@@ -36,8 +36,9 @@
 mkstemp (template)
      char *template;
 {
-  int i, j, n, fd;
+  int i, j, n, fd, save_errno;
   char *data = template + strlen(template) - 6;
+  save_errno = errno;
 
   if (data < template) {
     errno = EINVAL;
@@ -59,7 +60,10 @@
 
     fd = open (template, O_CREAT|O_EXCL|O_RDWR, 0600);
     if (fd != -1)
+    {
+      errno = save_errno;
       return fd;
+    }
   }
     
   errno = EEXIST;
Index: lib-src/socketx.h
===================================================================
--- lib-src/socketx.h	(revision 12)
+++ lib-src/socketx.h	(working copy)
@@ -67,6 +67,7 @@
 
 #define ESHUTDOWN WSAESHUTDOWN
 #define ENOTCONN WSAENOTCONN
+#define ENOTSOCK WSAENOTSOCK
 #define ECONNRESET WSAECONNRESET
 #define ECONNABORTED WSAECONNABORTED
 #define ENETRESET WSAENETRESET
Index: lib-src/symlink.c
===================================================================
--- lib-src/symlink.c	(revision 0)
+++ lib-src/symlink.c	(revision 0)
@@ -0,0 +1,21 @@
+#include <windows.h>
+#include <errno.h>
+
+/*
+ * windows does not currently have symbolic links - they are 
+ * scheduled for the next version of NTFS, but for now we 
+ * may be able to get away with hard links and/or copying
+ */
+int symlink(const char* old_path, const char* new_path)
+{
+/*    if (CreateHardLink(new_path, old_path, NULL) == 0) */
+    if (CopyFile(old_path, new_path, TRUE) == 0)
+    {
+        errno = EPERM;  /* file system does not support symbolic links */
+        return -1;
+    }
+    else
+    {   
+        return 0; /* OK */
+    }
+}
Index: config.h.in
===================================================================
--- config.h.in	(revision 12)
+++ config.h.in	(working copy)
@@ -352,6 +352,9 @@
 /* Define to 1 if you have the `strstr' function. */
 #undef HAVE_STRSTR
 
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
 /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
    */
 #undef HAVE_SYS_DIR_H
