From bff8fe460dcf4b25071fff966d86877b30eeec90 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 28 May 2013 17:54:12 -0700 Subject: [PATCH] Some more configure checks for headers --- configure.ac | 12 ++++++++++++ examples/nfsclient-bcast.c | 6 ++++++ lib/init.c | 9 ++++++--- lib/libnfs-sync.c | 16 ++++++++++++---- lib/libnfs.c | 11 ++++++++--- lib/pdu.c | 8 +++++--- lib/socket.c | 19 ++++++++++++------- 7 files changed, 61 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 1b4b66b..67004e7 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,18 @@ AC_CHECK_HEADERS([poll.h]) dnl Check for unistd.h AC_CHECK_HEADERS([unistd.h]) +# check for netdb.h +dnl Check for netdb.h +AC_CHECK_HEADERS([netdb.h]) + +# check for utime.h +dnl Check for utime.h +AC_CHECK_HEADERS([utime.h]) + +# check for net/if.h +dnl Check for net/if.h +AC_CHECK_HEADERS([net/if.h]) + # check for sys/ioctl.h dnl Check for sys/ioctl.h AC_CHECK_HEADERS([sys/ioctl.h]) diff --git a/examples/nfsclient-bcast.c b/examples/nfsclient-bcast.c index ae08f16..e9974a8 100644 --- a/examples/nfsclient-bcast.c +++ b/examples/nfsclient-bcast.c @@ -38,8 +38,14 @@ #include #include #include + +#ifdef HAVE_NET_IF_H #include +#endif + +#ifdef HAVE_NETDB_H #include +#endif #ifdef HAVE_SYS_IOCTL_H #include diff --git a/lib/init.c b/lib/init.c index 09ab61c..62a8f81 100644 --- a/lib/init.c +++ b/lib/init.c @@ -21,15 +21,18 @@ #ifdef WIN32 #include "win32_compat.h" -#else -#include -#endif/*WIN32*/ +#endif + #define _GNU_SOURCE #ifdef HAVE_UNISTD_H #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif + #include #include #include diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 836e135..7de245f 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -27,11 +27,11 @@ #ifdef WIN32 #include "win32_compat.h" -#else -#include -#include +#endif + +#ifdef HAVE_NET_IF_H #include -#endif /*WIN32*/ +#endif #ifdef ANDROID #define statvfs statfs @@ -57,6 +57,10 @@ #include #endif +#ifdef HAVE_NETDB_H +#include +#endif + #ifdef HAVE_UNISTD_H #include #endif @@ -65,6 +69,10 @@ #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif + #include #include #include diff --git a/lib/libnfs.c b/lib/libnfs.c index 543b0ce..c322c37 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -27,10 +27,11 @@ #ifdef WIN32 #include "win32_compat.h" -#else -#include +#endif + +#ifdef HAVE_UTIME_H #include -#endif /*WIN32*/ +#endif #ifdef ANDROID #define statvfs statfs @@ -54,6 +55,10 @@ #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif + #include #include #include diff --git a/lib/pdu.c b/lib/pdu.c index d25c448..eca054c 100644 --- a/lib/pdu.c +++ b/lib/pdu.c @@ -24,9 +24,7 @@ #ifdef WIN32 #include "win32_compat.h" -#else -#include -#endif/*WIN32*/ +#endif #ifdef HAVE_NETINET_IN_H #include @@ -36,6 +34,10 @@ #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif + #include #include #include diff --git a/lib/socket.c b/lib/socket.c index 6538535..733f1f4 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -26,7 +26,6 @@ #include "win32_compat.h" #else #include -#include #endif/*WIN32*/ #ifdef HAVE_POLL_H @@ -45,18 +44,24 @@ #include #endif -#include -#include -#include -#include -#include -#include +#ifdef HAVE_NETDB_H +#include +#endif + #ifdef HAVE_SYS_FILIO_H #include #endif + #ifdef HAVE_SYS_SOCKIO_H #include #endif + +#include +#include +#include +#include +#include +#include #include #include "libnfs-zdr.h" #include "libnfs.h" -- 2.34.1