diff options
author | Christian Beier <dontmind@freeshell.org> | 2010-07-11 15:31:07 +0200 |
---|---|---|
committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2010-07-14 17:05:09 +0200 |
commit | 79f0f1374cabb3d252e9eda0d13fc21857991b2e (patch) | |
tree | 4bcecda160444de837581f42a8da23da204350bf | |
parent | 68e7696a27b31034876f594f242a229ff2b74fa4 (diff) | |
download | libvncserver-79f0f1374cabb3d252e9eda0d13fc21857991b2e.zip libvncserver-79f0f1374cabb3d252e9eda0d13fc21857991b2e.tar.gz |
Fix MinGW32 checking for IPv6.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | libvncclient/sockets.c | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index b7cfcc1..e7db854 100644 --- a/configure.ac +++ b/configure.ac @@ -703,12 +703,22 @@ AC_ARG_WITH(ipv6, [ --without-ipv6 disable IPv6 support],,) if test "x$with_ipv6" != "xno"; then AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(IPv6,1), - AC_CHECK_LIB(socket, getaddrinfo, AC_DEFINE(IPv6,1))) + AC_CHECK_LIB(socket, getaddrinfo, AC_DEFINE(IPv6,1), [ + AC_MSG_CHECKING([for getaddrinfo in -lws2_32]) + LIBS="$LIBS -lws2_32" + AC_TRY_LINK([#include <ws2tcpip.h>], [getaddrinfo(0, 0, 0, 0);], [ + AC_DEFINE(IPv6,1) + AC_MSG_RESULT([yes]) + ], + AC_MSG_RESULT([no])) + ])) fi + + # Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h]) +AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h ws2tcpip.h]) # x11vnc only: if test "$build_x11vnc" = "yes"; then diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c index ff4fe48..0171a5c 100644 --- a/libvncclient/sockets.c +++ b/libvncclient/sockets.c @@ -37,6 +37,10 @@ #define read(sock,buf,len) recv(sock,buf,len,0) #define write(sock,buf,len) send(sock,buf,len,0) #define socklen_t int +#ifdef LIBVNCSERVER_HAVE_WS2TCPIP_H +#undef socklen_t +#include <ws2tcpip.h> +#endif #else #include <sys/socket.h> #include <netinet/in.h> |