FreeBSD requires sys/socket.h before net/if.h
authornbk <nbk>
Mon, 28 May 2007 10:46:54 +0000 (10:46 +0000)
committernbk <nbk>
Mon, 28 May 2007 10:46:54 +0000 (10:46 +0000)
Reported by David Wood <david@wood2.org.uk>

configure.in

index e36e9c3..d1d73fd 100644 (file)
@@ -559,7 +559,6 @@ AC_CHECK_HEADERS( \
        sys/security.h \
        fcntl.h \
        sys/fcntl.h \
-       net/if.h \
        prot.h \
        pwd.h \
        grp.h \
@@ -567,6 +566,13 @@ AC_CHECK_HEADERS( \
        siad.h
 )
 
+dnl FreeBSD requires sys/socket.h before net/if.h
+AC_CHECK_HEADERS(net/if.h, [], [],
+[#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+# endif
+])
+
 REGEX=no
 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file]))
 if test "x$ac_cv_header_regex_h" = "xyes"; then