diff --git a/configure.ac b/configure.ac index cde95ed09..57a60647a 100644 --- a/configure.ac +++ b/configure.ac @@ -397,6 +397,10 @@ fi if test "x$enable_dap" = xyes; then AC_DEFINE([USE_DAP], [1], [if true, build DAP Client]) AC_DEFINE([ENABLE_DAP], [1], [if true, build DAP Client]) +#AC_CHECK_HEADER(sys/socket.h, ,AC_DEFINE([NO_SYS_SOCKET_H], [], [no sys/socket.h])) +#AC_CHECK_HEADER(socket.h, ,AC_DEFINE([NO_SOCKET_H], [], [no socket.h])) +AC_CHECK_HEADERS([sys/socket.h socket.h]) +AC_CHECK_TYPES([socklen_t]) fi if test "x$enable_dap_remote_tests" = xyes; then diff --git a/libdap2/nccommon.h b/libdap2/nccommon.h index 9ffeec498..6ef8f24c8 100644 --- a/libdap2/nccommon.h +++ b/libdap2/nccommon.h @@ -19,7 +19,6 @@ #define nullfree(m) {if((m)!=NULL) {free(m);} else {}} #endif - /* Misc. code controls */ #define FILLCONSTRAINT TRUE diff --git a/libdap2/ncdap.h b/libdap2/ncdap.h index b3ca46071..1a316e5c5 100644 --- a/libdap2/ncdap.h +++ b/libdap2/ncdap.h @@ -15,6 +15,16 @@ #include #include +#ifdef HAVE_SYS_SOCKET_H +#include +#elif defined HAVE_SOCKET_H +#include +#endif + +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif + #include "ncbytes.h" #include "nclist.h" #include "nchashmap.h"