]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Configure modifies ldns/net.h so that the include of sys/socket.h only happens if...
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Fri, 13 Jun 2008 10:32:21 +0000 (10:32 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Fri, 13 Jun 2008 10:32:21 +0000 (10:32 +0000)
configure.ac
ldns/net.h.in [moved from ldns/net.h with 99% similarity]

index 16b6930a9abd125166dc7069cdbbb78b9fd5f540..08d7ea21ca6c0e22742147f989fa96687f95624f 100644 (file)
@@ -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 <sys/socket.h>'
+],[
+include_sys_socket_h=''
+],[AC_INCLUDES_DEFAULT
+  [
+   #if HAVE_SYS_PARAM_H
+   # include <sys/param.h>
+   #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
 
similarity index 99%
rename from ldns/net.h
rename to ldns/net.h.in
index 3e4b65fe2b76e0c3c51dc20e586044d381ea72a2..3d7876cc2e51ba3360214bba6895c82ed156391e 100644 (file)
@@ -14,7 +14,7 @@
 #define LDNS_NET_H
 
 #include <ldns/ldns.h>
-#include <sys/socket.h>
+@include_sys_socket_h@
 
 #define LDNS_DEFAULT_TIMEOUT_SEC 2
 #define LDNS_DEFAULT_TIMEOUT_USEC 0