On Fri, 2014-06-27 at 09:51 +0200, Peter van Dijk wrote:
> Hello,
> 
> On 25 Jun 2014, at 23:06 , Christian Hofstaedtler <z...@debian.org> wrote:
> 
> >> 2) pdns/nameserver.c: IPV6_RECVPKTINFO is not defined on GNU/Hurd, use
> >> IPV6_RXINFO instead.
> >> 
> >> Index: pdns-3.3.1/pdns/nameserver.cc
> >> ===================================================================
> >> --- pdns-3.3.1.orig/pdns/nameserver.cc
> >> +++ pdns-3.3.1/pdns/nameserver.cc

> > Could you turn that into an autoconf thing? I think having it as an 
> > autoconf-
> > detected and aliased thing would be preferred upstream (CC'ed
> > upstream for their opinion).
> 
> We would prefer that, but we would accept something like #ifndef
> IPV6_RECVPKTINFO #define IPV6_RECVPKTINFO IPV6_RXINFO #endif in a
> suitable header file.

Hi, attached is a solution I found out for GNU/Hurd in configure.ac.
AC_EGREP_CPP is used to find out if IPV6_RECVPKTINFO is defined in
<netinet/in.h>. If not it is defined as IPV6_RXINFO.

Since autoreconf is used in the build there is no need to modify
config.h.in, it is generated by autoheader. Build tested on both
GNU/Hurd and GNU/Linux.

Unfortunately I have not found the time to check the latest upstream
from git. Isn't this a little cumbersome to do, adding all the debian/*
to the git sources, etc?

Index: pdns-3.3.1/configure.ac
===================================================================
--- pdns-3.3.1.orig/configure.ac
+++ pdns-3.3.1/configure.ac
@@ -171,6 +171,27 @@ darwin11* | darwin12* | darwin13*)
 	CXXFLAGS="-pthread $CXXFLAGS -D__APPLE_USE_RFC_3542"
 	AM_CONDITIONAL([OS_MACOSX], true)
 	;;
+gnu*)
+	AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
+	AC_MSG_CHECKING(for IPV6_RECVPKTINFO in <netinet/in.h>)
+	AM_CPPFLAGS="-E -dM"
+	AC_EGREP_CPP(yes,
+	[#include netinet/in.h
+	#ifdef IPV6_RECVPKTINFO
+       yes
+       #endif
+	], [
+	AC_MSG_RESULT([yes])
+	], [
+	AC_MSG_RESULT([no])
+	AC_DEFINE(IPV6_RECVPKTINFO,IPV6_RXINFO,
+	[IPV6_RXINFO is the same as IPV6_RECVPKTINFO on GNU/Hurd])
+	])
+	DYNLINKFLAGS="-rdynamic"
+	LDFLAGS="$LDFLAGS -lrt"
+	THREADFLAGS="-pthread"
+	CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
+	;;
 *)
 	AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
 	DYNLINKFLAGS="-rdynamic"

Reply via email to