]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- RT#2955. Fix for cygwin compilation.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 13 Feb 2012 10:42:22 +0000 (10:42 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 13 Feb 2012 10:42:22 +0000 (10:42 +0000)
git-svn-id: file:///svn/unbound/trunk@2617 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
doc/Changelog
util/netevent.c

index c8c0504d401a6792f1ebcef168a3f0e2f365b1db..cacf294b9089ce6da6c7d4437c11f15f489c6532 100644 (file)
 /* Define to 1 if you have the `strptime' function. */
 #undef HAVE_STRPTIME
 
+/* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
+#undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
+
 /* Define if you have Swig libraries and header files. */
 #undef HAVE_SWIG
 
index 0b1d2899a805c826dc18d9483abe1342356a486b..e71c3f0d0f2f386002e90b7f6cb4614787094735 100755 (executable)
--- a/configure
+++ b/configure
@@ -2050,6 +2050,63 @@ $as_echo "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -17372,6 +17429,46 @@ $as_echo "no" >&6; }
 
 fi
 
+fi
+
+ac_fn_c_check_member "$LINENO" "struct in_pktinfo" "ipi_spec_dst" "ac_cv_member_struct_in_pktinfo_ipi_spec_dst" "
+$ac_includes_default
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_in_pktinfo_ipi_spec_dst" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST 1
+_ACEOF
+
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setusercontext" >&5
index a31666aa95c6daf3e77bcf514aed9bad40ab18a8..7eaf47fcd21e84d18ea76a76868b57ccdbd7ad67 100644 (file)
@@ -857,6 +857,36 @@ if test $ac_cv_func_daemon = yes; then
 ])
 fi
 
+AC_CHECK_MEMBERS([struct in_pktinfo.ipi_spec_dst],,,[
+AC_INCLUDES_DEFAULT
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
 AC_SEARCH_LIBS([setusercontext], [util])
 AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex])
 AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
index 15c392749d825fa6b5818b976a91c56d8a4fd794..7cd115c89c48b1c6d17fad5bf4b1b1b41979e787 100644 (file)
@@ -1,3 +1,6 @@
+13 February 2012: Wouter
+       - RT#2955. Fix for cygwin compilation. 
+
 10 February 2012: Wouter
        - Slightly smaller critical region in one case in infra cache.
        - Fix timeouts to keep track of query type, A, AAAA and other, if
index c6f5279f6a7fcbb941d62c915c8d1247d41aa385..a6ac446e91d85556ee369a96b87577468f3ac4ce 100644 (file)
@@ -367,11 +367,15 @@ static void p_ancil(const char* str, struct comm_reply* r)
                        strncpy(buf1, "(inet_ntop error)", sizeof(buf1));
                }
                buf1[sizeof(buf1)-1]=0;
+#ifdef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
                if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_spec_dst, 
                        buf2, (socklen_t)sizeof(buf2)) == 0) {
                        strncpy(buf2, "(inet_ntop error)", sizeof(buf2));
                }
                buf2[sizeof(buf2)-1]=0;
+#else
+               buf2[0]=0;
+#endif
                log_info("%s: %d %s %s", str, r->pktinfo.v4info.ipi_ifindex,
                        buf1, buf2);
 #elif defined(IP_RECVDSTADDR)