summaryrefslogtreecommitdiff
path: root/infrastructure/m4/boxbackup_tests.m4
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2012-03-16 00:41:38 +0000
committerChris Wilson <chris+github@qwirx.com>2012-03-16 00:41:38 +0000
commitb3ad06a499260e7c5f781b8c4f6976bc143dd89b (patch)
tree8b280174d0e82987edbd0bee69fc625828b72c94 /infrastructure/m4/boxbackup_tests.m4
parentc5961b01bf9694bf7f6dff86fc8367953dd0b999 (diff)
Hopefully fix TcpNice setsockopt/struct tcp_info compile errors on Windows.
Diffstat (limited to 'infrastructure/m4/boxbackup_tests.m4')
-rw-r--r--infrastructure/m4/boxbackup_tests.m414
1 files changed, 12 insertions, 2 deletions
diff --git a/infrastructure/m4/boxbackup_tests.m4 b/infrastructure/m4/boxbackup_tests.m4
index dce061af..c745b4be 100644
--- a/infrastructure/m4/boxbackup_tests.m4
+++ b/infrastructure/m4/boxbackup_tests.m4
@@ -135,7 +135,8 @@ AC_CHECK_HEADERS([netinet/in.h netinet/tcp.h])
AC_CHECK_HEADERS([sys/file.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h])
AC_CHECK_HEADERS([sys/uio.h sys/xattr.h])
AC_CHECK_HEADERS([bsd/unistd.h])
-
+AC_CHECK_HEADERS([sys/socket.h], [have_sys_socket_h=yes])
+AC_CHECK_HEADERS([winsock2.h], [have_winsock2_h=yes])
AC_CHECK_HEADERS([execinfo.h], [have_execinfo_h=yes])
if test "$have_execinfo_h" = "yes"; then
@@ -197,11 +198,20 @@ AC_CHECK_MEMBERS([struct tcp_info.tcpi_rtt],,, [[#include <netinet/tcp.h>]])
AC_CHECK_DECLS([INFTIM],,, [[#include <poll.h>]])
AC_CHECK_DECLS([SO_PEERCRED],,, [[#include <sys/socket.h>]])
-AC_CHECK_DECLS([SO_SNDBUF],,, [[#include <asm/socket.h>]])
AC_CHECK_DECLS([O_BINARY],,,)
AC_CHECK_DECLS([SOL_TCP],,, [[#include <netinet/tcp.h>]])
AC_CHECK_DECLS([TCP_INFO],,, [[#include <netinet/tcp.h>]])
+if test -n "$have_sys_socket_h"; then
+ AC_CHECK_DECLS([SO_SNDBUF],,, [[#include <sys/socket.h>]])
+elif test -n "$have_winsock2_h"; then
+ AC_CHECK_DECLS([SO_SNDBUF],,, [[#include <winsock2.h>]])
+else
+ # unlikely to succeed, but defined HAVE_DECL_SO_SNDBUF to 0 instead
+ # of leaving it undefined, which makes cpp #ifdefs simpler.
+ AC_CHECK_DECLS([SO_SNDBUF])
+fi
+
# Solaris provides getpeerucred() instead of getpeereid() or SO_PEERCRED
AC_CHECK_HEADERS([ucred.h])
AC_CHECK_FUNCS([getpeerucred])