+diff -urN libssh2-0.18.orig/configure.in libssh2-0.18.mingw/configure.in
+--- libssh2-0.18.orig/configure.in 2007-07-31 10:55:29.000000000 +0100
++++ libssh2-0.18.mingw/configure.in 2008-11-10 14:12:07.000000000 +0000
+@@ -1,7 +1,7 @@
+ # AC_PREREQ(2.57)
+ AC_INIT(libssh2, [-], libssh2-devel@lists.sourceforge.net)
+ AC_CONFIG_SRCDIR([src])
+-AC_CONFIG_HEADER([src/libssh2_config.h example/simple/config.h])
++AC_CONFIG_HEADER([src/libssh2_config.h])
+ AM_MAINTAINER_MODE
+
+ dnl SED is needed by some of the tools
+diff -urN libssh2-0.18.orig/example/simple/config.h.in libssh2-0.18.mingw/example/simple/config.h.in
+--- libssh2-0.18.orig/example/simple/config.h.in 2007-07-31 11:02:51.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/config.h.in 1970-01-01 01:00:00.000000000 +0100
+@@ -1,172 +0,0 @@
+-/* src/libssh2_config.h.in. Generated from configure.in by autoheader. */
+-
+-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+- systems. This function is required for `alloca.c' support on those systems.
+- */
+-#undef CRAY_STACKSEG_END
+-
+-/* Define to 1 if using `alloca.c'. */
+-#undef C_ALLOCA
+-
+-/* Define to 1 if you have `alloca', as a function or macro. */
+-#undef HAVE_ALLOCA
+-
+-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+- */
+-#undef HAVE_ALLOCA_H
+-
+-/* Define to 1 if you have the <arpa/inet.h> header file. */
+-#undef HAVE_ARPA_INET_H
+-
+-/* disabled non-blocking sockets */
+-#undef HAVE_DISABLED_NONBLOCKING
+-
+-/* Define to 1 if you have the <dlfcn.h> header file. */
+-#undef HAVE_DLFCN_H
+-
+-/* Define to 1 if you have the <errno.h> header file. */
+-#undef HAVE_ERRNO_H
+-
+-/* Define to 1 if you have the <fcntl.h> header file. */
+-#undef HAVE_FCNTL_H
+-
+-/* use FIONBIO for non-blocking sockets */
+-#undef HAVE_FIONBIO
+-
+-/* Define to 1 if you have the `gettimeofday' function. */
+-#undef HAVE_GETTIMEOFDAY
+-
+-/* Define to 1 if you have the <inttypes.h> header file. */
+-#undef HAVE_INTTYPES_H
+-
+-/* use ioctlsocket() for non-blocking sockets */
+-#undef HAVE_IOCTLSOCKET
+-
+-/* use Ioctlsocket() for non-blocking sockets */
+-#undef HAVE_IOCTLSOCKET_CASE
+-
+-/* Define if you have the gcrypt library. */
+-#undef HAVE_LIBGCRYPT
+-
+-/* Define to 1 if you have the <memory.h> header file. */
+-#undef HAVE_MEMORY_H
+-
+-/* Define to 1 if you have the <netinet/in.h> header file. */
+-#undef HAVE_NETINET_IN_H
+-
+-/* use O_NONBLOCK for non-blocking sockets */
+-#undef HAVE_O_NONBLOCK
+-
+-/* Define to 1 if you have the `poll' function. */
+-#undef HAVE_POLL
+-
+-/* Define to 1 if you have the `select' function. */
+-#undef HAVE_SELECT
+-
+-/* use SO_NONBLOCK for non-blocking sockets */
+-#undef HAVE_SO_NONBLOCK
+-
+-/* Define to 1 if you have the <stdint.h> header file. */
+-#undef HAVE_STDINT_H
+-
+-/* Define to 1 if you have the <stdio.h> header file. */
+-#undef HAVE_STDIO_H
+-
+-/* Define to 1 if you have the <stdlib.h> header file. */
+-#undef HAVE_STDLIB_H
+-
+-/* Define to 1 if you have the <strings.h> header file. */
+-#undef HAVE_STRINGS_H
+-
+-/* Define to 1 if you have the <string.h> header file. */
+-#undef HAVE_STRING_H
+-
+-/* Define to 1 if you have the <sys/ioctl.h> header file. */
+-#undef HAVE_SYS_IOCTL_H
+-
+-/* Define to 1 if you have the <sys/select.h> header file. */
+-#undef HAVE_SYS_SELECT_H
+-
+-/* Define to 1 if you have the <sys/socket.h> header file. */
+-#undef HAVE_SYS_SOCKET_H
+-
+-/* Define to 1 if you have the <sys/stat.h> header file. */
+-#undef HAVE_SYS_STAT_H
+-
+-/* Define to 1 if you have the <sys/time.h> header file. */
+-#undef HAVE_SYS_TIME_H
+-
+-/* Define to 1 if you have the <sys/types.h> header file. */
+-#undef HAVE_SYS_TYPES_H
+-
+-/* Define to 1 if you have the <sys/uio.h> header file. */
+-#undef HAVE_SYS_UIO_H
+-
+-/* Define to 1 if you have the <unistd.h> header file. */
+-#undef HAVE_UNISTD_H
+-
+-/* Enable "none" cipher -- NOT RECOMMENDED */
+-#undef LIBSSH2_CRYPT_NONE
+-
+-/* Enable newer diffie-hellman-group-exchange-sha1 syntax */
+-#undef LIBSSH2_DH_GEX_NEW
+-
+-/* Compile in zlib support */
+-#undef LIBSSH2_HAVE_ZLIB
+-
+-/* Use libgcrypt */
+-#undef LIBSSH2_LIBGCRYPT
+-
+-/* Enable "none" MAC -- NOT RECOMMENDED */
+-#undef LIBSSH2_MAC_NONE
+-
+-/* Name of package */
+-#undef PACKAGE
+-
+-/* Define to the address where bug reports for this package should be sent. */
+-#undef PACKAGE_BUGREPORT
+-
+-/* Define to the full name of this package. */
+-#undef PACKAGE_NAME
+-
+-/* Define to the full name and version of this package. */
+-#undef PACKAGE_STRING
+-
+-/* Define to the one symbol short name of this package. */
+-#undef PACKAGE_TARNAME
+-
+-/* Define to the version of this package. */
+-#undef PACKAGE_VERSION
+-
+-/* If using the C implementation of alloca, define if you know the
+- direction of stack growth for your system; otherwise it will be
+- automatically deduced at runtime.
+- STACK_DIRECTION > 0 => grows toward higher addresses
+- STACK_DIRECTION < 0 => grows toward lower addresses
+- STACK_DIRECTION = 0 => direction of growth unknown */
+-#undef STACK_DIRECTION
+-
+-/* Define to 1 if you have the ANSI C header files. */
+-#undef STDC_HEADERS
+-
+-/* Version number of package */
+-#undef VERSION
+-
+-/* Define to 1 if your processor stores words with the most significant byte
+- first (like Motorola and SPARC, unlike Intel and VAX). */
+-#undef WORDS_BIGENDIAN
+-
+-/* Number of bits in a file offset, on hosts where this is settable. */
+-#undef _FILE_OFFSET_BITS
+-
+-/* Define for large files, on AIX-style hosts. */
+-#undef _LARGE_FILES
+-
+-/* Define to empty if `const' does not conform to ANSI C. */
+-#undef const
+-
+-/* Define to `__inline__' or `__inline' if that's what the C compiler
+- calls it, or to nothing if 'inline' is not supported under any name. */
+-#ifndef __cplusplus
+-#undef inline
+-#endif
+diff -urN libssh2-0.18.orig/example/simple/Makefile.am libssh2-0.18.mingw/example/simple/Makefile.am
+--- libssh2-0.18.orig/example/simple/Makefile.am 2007-08-12 22:39:55.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/Makefile.am 2008-11-10 14:13:22.000000000 +0000
+@@ -10,6 +10,6 @@
+ sftp_RW_nonblock \
+ sftpdir sftpdir_nonblock
+
+-INCLUDES = -I. -I$(top_srcdir)/include
++INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/include
+ LDADD = $(top_builddir)/src/libssh2.la
+
+diff -urN libssh2-0.18.orig/example/simple/scp.c libssh2-0.18.mingw/example/simple/scp.c
+--- libssh2-0.18.orig/example/simple/scp.c 2007-08-12 22:39:55.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/scp.c 2008-11-10 14:18:13.000000000 +0000
+@@ -4,7 +4,7 @@
+ * Sample showing how to do a simple SCP transfer.
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+
+ #ifdef HAVE_WINSOCK2_H
+diff -urN libssh2-0.18.orig/example/simple/scp_nonblock.c libssh2-0.18.mingw/example/simple/scp_nonblock.c
+--- libssh2-0.18.orig/example/simple/scp_nonblock.c 2007-09-24 13:15:45.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/scp_nonblock.c 2008-11-10 14:22:21.000000000 +0000
+@@ -4,7 +4,7 @@
+ * Sample showing how to do SCP transfers in a non-blocking manner.
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+
+ #ifdef HAVE_WINSOCK2_H
+diff -urN libssh2-0.18.orig/example/simple/scp_write.c libssh2-0.18.mingw/example/simple/scp_write.c
+--- libssh2-0.18.orig/example/simple/scp_write.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/scp_write.c 2008-11-10 14:19:32.000000000 +0000
+@@ -4,7 +4,7 @@
+ * Sample showing how to do a simple SCP transfer.
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+
+ #ifdef HAVE_WINSOCK2_H
+diff -urN libssh2-0.18.orig/example/simple/scp_write_nonblock.c libssh2-0.18.mingw/example/simple/scp_write_nonblock.c
+--- libssh2-0.18.orig/example/simple/scp_write_nonblock.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/scp_write_nonblock.c 2008-11-10 14:22:13.000000000 +0000
+@@ -4,7 +4,7 @@
+ * Sample showing how to do a simple SCP transfer.
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+
+ #include <libssh2.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftp.c libssh2-0.18.mingw/example/simple/sftp.c
+--- libssh2-0.18.orig/example/simple/sftp.c 2007-09-24 13:14:18.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftp.c 2008-11-10 14:15:47.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftp 192.168.0.1 user password /tmp/secrets -p|-i|-k"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftpdir.c libssh2-0.18.mingw/example/simple/sftpdir.c
+--- libssh2-0.18.orig/example/simple/sftpdir.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftpdir.c 2008-11-10 14:18:41.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftpdir 192.168.0.1 user password /tmp/secretdir"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftpdir_nonblock.c libssh2-0.18.mingw/example/simple/sftpdir_nonblock.c
+--- libssh2-0.18.orig/example/simple/sftpdir_nonblock.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftpdir_nonblock.c 2008-11-10 14:23:35.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftpdir 192.168.0.1 user password /tmp/secretdir"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftp_mkdir.c libssh2-0.18.mingw/example/simple/sftp_mkdir.c
+--- libssh2-0.18.orig/example/simple/sftp_mkdir.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftp_mkdir.c 2008-11-10 14:18:33.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftp 192.168.0.1 user password /tmp/sftp_mkdir"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftp_mkdir_nonblock.c libssh2-0.18.mingw/example/simple/sftp_mkdir_nonblock.c
+--- libssh2-0.18.orig/example/simple/sftp_mkdir_nonblock.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftp_mkdir_nonblock.c 2008-11-10 14:23:03.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftp 192.168.0.1 user password /tmp/sftp_write_nonblock.c"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftp_nonblock.c libssh2-0.18.mingw/example/simple/sftp_nonblock.c
+--- libssh2-0.18.orig/example/simple/sftp_nonblock.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftp_nonblock.c 2008-11-10 14:22:30.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftp 192.168.0.1 user password /tmp/secrets"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftp_RW_nonblock.c libssh2-0.18.mingw/example/simple/sftp_RW_nonblock.c
+--- libssh2-0.18.orig/example/simple/sftp_RW_nonblock.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftp_RW_nonblock.c 2008-11-10 14:23:18.000000000 +0000
+@@ -9,7 +9,7 @@
+ * Using the SFTP server running on 127.0.0.1
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftp_write.c libssh2-0.18.mingw/example/simple/sftp_write.c
+--- libssh2-0.18.orig/example/simple/sftp_write.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftp_write.c 2008-11-10 14:19:09.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftp 192.168.0.1 user password sftp_write.c /tmp/secrets"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/sftp_write_nonblock.c libssh2-0.18.mingw/example/simple/sftp_write_nonblock.c
+--- libssh2-0.18.orig/example/simple/sftp_write_nonblock.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/sftp_write_nonblock.c 2008-11-10 14:22:44.000000000 +0000
+@@ -9,7 +9,7 @@
+ * "sftp 192.168.0.1 user password sftp_write_nonblock.c /tmp/sftp_write_nonblock.c"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
+diff -urN libssh2-0.18.orig/example/simple/ssh2.c libssh2-0.18.mingw/example/simple/ssh2.c
+--- libssh2-0.18.orig/example/simple/ssh2.c 2007-08-12 22:39:56.000000000 +0100
++++ libssh2-0.18.mingw/example/simple/ssh2.c 2008-11-10 14:14:32.000000000 +0000
+@@ -9,10 +9,13 @@
+ * "ssh2 host user password [-p|-i|-k]"
+ */
+
+-#include "config.h"
++#include "libssh2_config.h"
+ #include <libssh2.h>
+ #include <libssh2_sftp.h>
+
++#ifdef HAVE_WINDOWS_H
++# include <windows.h>
++#endif
+ #ifdef HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif