Subject: Pkgs checking for IPv6 .. (and getting it wrong)
To: None <pkgsrc-users@netbsd.org>
From: Martin S. Weber <Ephaeton@gmx.net>
List: pkgsrc-users
Date: 09/12/2007 18:06:47
Hoi.

I'm having a 4.0 RC 1 (and a -current 4.99.31) without IPv6
support, i.e. built with -V MKINET6=no (build.sh). Now I have
packages (like e.g. net/ORBit2) which check for usability of
IPv6 via #ifdef AF_INET6 .

Is this correct for them to do so? I.e. I have to put more
inet6 - related variables into build.sh to make AF_INET6 disappear,
too? Furthermore PKG_DEFAULT_OPTIONS=-inet6 gets ignored but ok...

Let's take ... gnome-media.

gmake[2]: Entering directory `/stuff/netbsd/pkgsrc/multimedia/gnome2-media/work/gnome-media-2.18.0/cddb-slave2'
...
inetaddr.o: In function `gnet_inetaddr_new_any':
inetaddr.c:(.text+0x5bf): undefined reference to `in6addr_any'
inetaddr.c:(.text+0x5d0): undefined reference to `in6addr_any'
inetaddr.c:(.text+0x5d8): undefined reference to `in6addr_any'
inetaddr.c:(.text+0x5e0): undefined reference to `in6addr_any'
gmake[2]: *** [cddb-slave2-properties] Error 1
gmake[2]: Leaving directory `/stuff/netbsd/pkgsrc/multimedia/gnome2-media/work/gnome-media-2.18.0/cddb-slave2'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/stuff/netbsd/pkgsrc/multimedia/gnome2-media/work/gnome-media-2.18.0'
gmake: *** [all] Error 2
*** Error code 2


from the configure:


if test $have_getaddrinfo = yes; then
	
	cat >>confdefs.h <<\_ACEOF
	#define ENABLE_IPV6 1 
	_ACEOF

so getaddrinfo == IPv6 ?

Let's take ... net/ORBit2

it just checks #ifdef AF_INET6

Let's take ... net/vino

../server/libvncserver/.libs/libvncserver.a(sockets.o): In function `ListenOnTCPPort':
sockets.c:(.text+0x791): undefined reference to `in6addr_loopback'
sockets.c:(.text+0x846): undefined reference to `in6addr_any'
gmake[4]: *** [vino-server] Error 1
gmake[4]: Leaving directory `/stuff/netbsd/pkgsrc/net/vino/work/vino-2.18.1/server'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/stuff/netbsd/pkgsrc/net/vino/work/vino-2.18.1/server'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/stuff/netbsd/pkgsrc/net/vino/work/vino-2.18.1/server'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/stuff/netbsd/pkgsrc/net/vino/work/vino-2.18.1'
gmake: *** [all] Error 2
*** Error code 2

from its configure:

cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.*/

#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{

socket(AF_INET6, SOCK_STREAM, 0);

;
return 0;
} 
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile" 
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err 
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
 test -z "$ac_c_werror_flag" ||
 test ! -s conftest.err
 } && test -s conftest.$ac_objext; then
have_ipv6=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

have_ipv6=no
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test "x$have_ipv6" = "xyes"; then

cat >>confdefs.h <<\_ACEOF
#define ENABLE_IPV6
_ACEOF

fi
else
have_ipv6=no
fi


... again : AF_INET6 defined means there's really IPv6 support?

Who's wrong here (besides me, the bad bad bad user who doesn't want ipv6 support) -
the build system or the package checks ?

... hum hom ...

-Martin