autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNUAutconf IPV6 Testing Strategy (WAS: [Fwd: [Bacula-devel] GNU autconf


From: Brian A. Seklecki
Subject: GNUAutconf IPV6 Testing Strategy (WAS: [Fwd: [Bacula-devel] GNU autconf macro for HAVE_IPV6 check on NetBSD])
Date: Fri, 15 Dec 2006 13:32:25 -0500

This message was original supposed to be CC:'d to the autoconf@ folks,
but was either filtered or forgotten.  Either way, tests on the current
IPv6 Macro.

~BAS

----

It seems that there are actually several permutations of systems by
which the IPv6 checks needs to take into account:

- Systems that don't support ipv6 (Minix)
- Systems that support ipv6 and have both kernel and userland support
  compiled in and headers present
- Systems that shipped/installed with ipv6 userland/kernel, but the
  administrator disabled ipv6 during the _kernel_ profiling process
- Systems that shipped/installed with ipv6 userland/kernel, but the
  administrator disabled ipv6 during the _kernel profiling process_ AND
  recompiled the entire _user-land_ (a la, libc) w/ NO_IPV6=true in
  mk.conf(5) / make.conf(5) but the ipv6 headers/libraries remain 
  although no binaries are linked into them.
- Systems that support ipv6 in the kernel/userland but lack headers
  (Which would be just about every distribution of Linux by default
   since "install every package" never seems to imply ($1)-devel.*
  RPMs.)

The current macro/test simply tries instantiate an ipv6 addr struct; but
doesn't actually try to move between userland and kernel to validate
functionality.

That's what is causing the breakage here in NetBSD. The problem is that
the symbol in question is not contained within libc after a recompile.
In my case, the system has been profiled.

Perhaps additional macros could could be instituted which not only try
to instantiate copies of inet6 address structures but actually utilize
them (perhaps try to bind(2) or connect(2)

The work-around here is to declare:

USE_INET6=no
MKINET6=no
NO_INET6=no
HAVE_IPV6=no

in mk.conf(5)

As for Pkgsrc and buildlink3 magic, it would be nice if:
PKG_DEFAULT_OPTIONS+=-inet6
PKG_OPTIONS.bacula= -inet6

...somehow tricked configure[.sh] about the availability
of /usr/include/netinet6/*

Bacula could help facilitate by implementing a --without-ipv6 or
--disable-ipv6 GNU autoconf flag.

I've filed a bug at http://bugs.bacula.org/ Mantis.  Although this is
not actually a "Bacula Code Bug", this is an excellent opportunity to
improve and feed-back more aggressive ipv6 test macros to the
GNUAutoconf people (who really don't have a bug management system)

TIA,

~BAS

-- 
Brian A. Seklecki <address@hidden>
Collaborative Fusion, Inc.
--- Begin Message --- Subject: [Bacula-devel] GNU autconf macro for HAVE_IPV6 check on NetBSD Date: Thu, 13 Jul 2006 12:51:44 -0400
[not sure if this is a user-@ or devel-@ topic -- the last/only ipv6
discussion I saw was to -users, so when you respond, please choose the
appropriate]

All:

The GNU autoconf macro below is what we use to test for IPv6 in 1.38.10.
It tries simply to instantiate a number of ipv6 structures.

However, on my platform (NetBSD/sparc 3_STABLE), it seems that it's
possible to confuse or mitigate/bypass this test ( I haven't tested
OpenBSD/FreeBSD for his behavior yet, because I know NetBSD does some
special IPV4 to IPV6 address mapping, and has some special IPV6
sysctls).

The IPV6 netinet6 socket family includes can be  in
/usr/include/netinet6 , configure will find them, compile conftest.c
just fine, and pass this test, however the system can be built without
IPV6 support (removed from all of the userland binaries) and the Kernel.

The result is that Bacula compiles and links against IPV6 headers fine,
but when it runs, it fails to compile later on during the build:

==> Entering
directory /usr/pkgsrc/sysutils/bacula-clientonly/work/bacula-1.38.10/src/console

[....SNIP....]

/usr/pkgsrc/sysutils/bacula-clientonly/work/.wrapper/bin/c++ -L/usr/lib
-Wl,-R/usr/lib -pthread -Wl,-R/usr/pkg/lib  -L../lib -L../cats -o
bconsole console.o console_conf.o authenticate.o conio.o   -ltermcap
-lbac -lm -pthread  -lintl   

../lib/libbac.a(address_conf.o)(.text+0x35c): In function
`IPADDR::set_addr_any()':
: undefined reference to `in6addr_any'
../lib/libbac.a(address_conf.o)(.text+0x360): In function
`IPADDR::set_addr_any()':
: undefined reference to `in6addr_any'
../lib/libbac.a(address_conf.o)(.text+0x364): In function
`IPADDR::set_addr_any()':
: undefined reference to `in6addr_any'
*** Error code 1

The work around is to interrupt the build process and manually define
HAVE_INET6 0 in src/config.h in the mean time.

So what we may need  to do is:

A) A more-aggressive ipv6 support test.  
B) A --without-ipv6 or --disable-ipv6 argument that explicity defines
   "HAVE_IPV6 0"
C) Or I may need to put a work-around in place for NetBSD (Bad)


The way some packages do it (Zebra) is:

# Check whether --enable-ipv6 or --disable-ipv6 was given.
if test "${enable_ipv6+set}" = set; then
  enableval="$enable_ipv6"
fi;

----- MACRO ----

echo "$as_me:$LINENO: checking for IPv6 support" >&5
echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6
if test "${ac_cv_ipv6_support+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
 #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
main ()
{
struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s;
t.s6_addr[0] =
 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 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); } &&
         { ac_try='test -z "$ac_c_werror_flag"
                         || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_ipv6_support=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_ipv6_support=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
cat >>confdefs.h <<\_ACEOF
#define HAVE_IPV6 1
_ACEOF

fi


-- 
Brian A. Seklecki <address@hidden>
Collaborative Fusion, Inc.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-devel mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/bacula-devel

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]