configure: provide some necessary prerequisites in header checks
authorGarrett Wollman <wollman@csail.mit.edu>
Thu, 28 Jul 2011 05:44:25 +0000 (01:44 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 29 Jul 2011 21:15:08 +0000 (14:15 -0700)
<netinet/in.h> is a prerequisite for <resolv.h> and <netinet/if_ether.h>.
<sys/socket.h> is a prerequisite for <net/if.h>.

Change-Id: I2c974ad863c6ff7eedb3702159399118af8de074
Reviewed-on: http://gerrit.openafs.org/5107
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
src/cf/ressearch.m4

index 1221e66..7e9f103 100644 (file)
@@ -1261,7 +1261,6 @@ AC_CHECK_HEADERS([ \
                   pthread_np.h \
                   pwd.h \
                   regex.h \
-                  resolv.h \
                   security/pam_appl.h \
                   signal.h \
                   stdint.h \
@@ -1303,12 +1302,24 @@ AC_CHECK_HEADERS([ \
                   unistd.h \
                   windows.h \
                ])
+
+AC_CHECK_HEADERS([resolv.h], [], [], [AC_INCLUDES_DEFAULT
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif])
+
 AC_CHECK_HEADERS([net/if.h],[],[],[AC_INCLUDES_DEFAULT
 #ifdef HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif])
 
 AC_CHECK_HEADERS([netinet/if_ether.h],[],[],[AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 #ifdef HAVE_NET_IF_H
 # include <net/if.h>
 #endif])
index 2abd444..7326edb 100644 (file)
@@ -6,6 +6,7 @@ AC_DEFUN([AC_CHECK_RESOLV_RETRANS],[
 #if defined(__sun__)
 #include <inet/ip.h>
 #endif
+#include <netinet/in.h>
 #include <resolv.h>
 ],[
     _res.retrans = 2;