From: Wouter Wijngaards Date: Fri, 13 Jun 2008 10:32:21 +0000 (+0000) Subject: Configure modifies ldns/net.h so that the include of sys/socket.h only happens if... X-Git-Tag: release-1.4.0~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd8bf311f4b52dbaeea433af0440e4bcc2f6a90b;p=thirdparty%2Fldns.git Configure modifies ldns/net.h so that the include of sys/socket.h only happens if the file is present on the platform. --- diff --git a/configure.ac b/configure.ac index 16b6930a..08d7ea21 100644 --- a/configure.ac +++ b/configure.ac @@ -362,7 +362,7 @@ AC_HEADER_STDC #AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h]) # do the very minimum - we can always extend this AC_CHECK_HEADERS([getopt.h stdarg.h stdbool.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT]) -AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/socket.h,,, +AC_CHECK_HEADERS(sys/param.h sys/mount.h,,, [AC_INCLUDES_DEFAULT [ #if HAVE_SYS_PARAM_H @@ -370,6 +370,20 @@ AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/socket.h,,, #endif ] ]) +AC_CHECK_HEADER(sys/socket.h, +[ +include_sys_socket_h='#include ' +],[ +include_sys_socket_h='' +],[AC_INCLUDES_DEFAULT + [ + #if HAVE_SYS_PARAM_H + # include + #endif + ] +]) +AC_SUBST(include_sys_socket_h) + AC_CHECK_TYPE(socklen_t, , [AC_DEFINE([socklen_t], [int], [Define to 'int' if not defined])], [ AC_INCLUDES_DEFAULT @@ -621,7 +635,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz); #endif ]) -AC_CONFIG_FILES([Makefile ldns/util.h]) +AC_CONFIG_FILES([Makefile ldns/net.h ldns/util.h]) AC_CONFIG_HEADER([ldns/config.h]) AC_OUTPUT diff --git a/ldns/net.h b/ldns/net.h.in similarity index 99% rename from ldns/net.h rename to ldns/net.h.in index 3e4b65fe..3d7876cc 100644 --- a/ldns/net.h +++ b/ldns/net.h.in @@ -14,7 +14,7 @@ #define LDNS_NET_H #include -#include +@include_sys_socket_h@ #define LDNS_DEFAULT_TIMEOUT_SEC 2 #define LDNS_DEFAULT_TIMEOUT_USEC 0