summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/getaddrinfo.m49
1 files changed, 9 insertions, 0 deletions
diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4
index f95bb1a93..be44232d7 100644
--- a/m4/getaddrinfo.m4
+++ b/m4/getaddrinfo.m4
@@ -21,6 +21,12 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
AC_REQUIRE([AC_GNU_SOURCE])
AC_CHECK_HEADERS_ONCE(sys/socket.h netdb.h sys/types.h netinet/in.h)
AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror],,,[
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
@@ -29,6 +35,9 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
#endif
])
AC_CHECK_TYPES([struct addrinfo],,,[
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif