Subject: GNUAutconf IPV6 Testing Strategy (WAS: [Fwd: [Bacula-devel] GNU
To: None <pkgsrc-users@netbsd.org, bacula-users@lists.sourceforge.net,>
From: Brian A. Seklecki <bseklecki@collaborativefusion.com>
List: pkgsrc-users
Date: 12/13/2006 10:50:13
This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_wingspan-61249-1166025014-0001-2
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

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 <bseklecki@collaborativefusion.com>
Collaborative Fusion, Inc.

--=_wingspan-61249-1166025014-0001-2
Content-Type: message/rfc822
Content-Disposition: inline
Content-Description: Forwarded message - [Bacula-devel] GNU autconf macro
	for HAVE_IPV6 check on NetBSD

	[206.210.89.201]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with
	esmtp; Thu, 13 Jul 2006 12:52:05 -0400 id 00056403.44B67A35.00014A61
	(66.35.250.225) by mx01 (envelope-from
	bacula-devel-bounces@lists.sourceforge.net) with SMTP; 13 Jul 2006 12:51:14
	-0400
	sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id 4A462131C2; Thu, 13
	Jul 2006 09:52:01 -0700 (PDT)
	helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp
	(Exim 4.43) id 1G14Pt-0007uq-Q7; Thu, 13 Jul 2006 09:51:57 -0700
	mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id
	1G14Ps-0004Fp-Jv; Thu, 13 Jul 2006 09:51:58 -0700
	(pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1
	with cipher RC4-MD5 (128/128 bits)) (No client certificate requested)
	(Authenticated sender: seklecki) by mx02.pub.collaborativefusion.com
	(Postfix) with ESMTP id 6BD24AC826;  Thu, 13 Jul 2006 12:51:25 -0400 (EDT)
From: "Brian A. Seklecki" <bseklecki@collaborativefusion.com>
To: bacula-users@lists.sourceforge.net, bacula-devel@lists.sourceforge.net
Organization: Collaborative Fusion, Inc.
Date: Thu, 13 Jul 2006 12:51:44 -0400
Message-Id: <1152809504.13982.54.camel@soundwave.pgh.priv.collaborativefusion.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=_wingspan-61249-1166025014-0001-3"
	http://spamassassin.org/tag/ for more details. Report problems to
	http://sf.net/tracker/?func=add&group_id=1&atid=200001
Cc: wmoran@potentialtech.com, Ryan Novosielski <novosirj@umdnj.edu>
Subject: [Bacula-devel] GNU autconf macro for HAVE_IPV6 check on NetBSD
List-Id: Developer's email list <bacula-devel.lists.sourceforge.net>
List-Unsubscribe: 
	<https://lists.sourceforge.net/lists/listinfo/bacula-devel>, 
	<mailto:bacula-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: 
	<http://sourceforge.net/mailarchive/forum.php?forum=bacula-devel>
List-Post: <mailto:bacula-devel@lists.sourceforge.net>
List-Help: <mailto:bacula-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: 
	<https://lists.sourceforge.net/lists/listinfo/bacula-devel>,
	<mailto:bacula-devel-request@lists.sourceforge.net?subject=subscribe>
Sender: bacula-devel-bounces@lists.sourceforge.net
Errors-To: bacula-devel-bounces@lists.sourceforge.net
x-commtouch-refid: str=0001.0A090208.44B677D8.0051,ss=1,fgs=0

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_wingspan-61249-1166025014-0001-3
Content-Type: multipart/signed; micalg=sha1; protocol="application/x-pkcs7-signature"; boundary="=_wingspan-61249-1166025014-0001-4"

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_wingspan-61249-1166025014-0001-4
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

[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:

=3D=3D> Entering
directory /usr/pkgsrc/sysutils/bacula-clientonly/work/bacula-1.38.10/src/co=
nsole

[....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  =20

./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. =20
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}" =3D set; then
  enableval=3D"$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}" =3D 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=3Din6addr_any; int i=3DAF_INET6; s=
;
t.s6_addr[0] =3D
 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=3D$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? =3D $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try=3D'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=3D$?
  echo "$as_me:$LINENO: \$? =3D $ac_status" >&5
  (exit $ac_status); }; } &&
         { ac_try=3D'test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=3D$?
  echo "$as_me:$LINENO: \$? =3D $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_ipv6_support=3Dyes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_ipv6_support=3Dno
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


--=20
Brian A. Seklecki <bseklecki@collaborativefusion.com>
Collaborative Fusion, Inc.

--=_wingspan-61249-1166025014-0001-4
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIHYDCCA6ww
ggKUoAMCAQICAS4wDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlVTMRUwEwYDVQQIEwxQZW5u
c3lsdmFuaWExEzARBgNVBAcTClBpdHRzYnVyZ2gxIzAhBgNVBAoTGkNvbGxhYm9yYXRp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IEZ1c2lvbiwgSW5jLjEeMBwGA1UECxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5
MSAwHgYDVQQDExdDb2xsYWJvcmF0aXZlIEZ1c2lvbiBDQQIBLjANBgkqhkiG9w0BAQEFAASBgKyG
28D6QPzFDrCkSIWzlWEdEHLoUC9O2GDTfNdRWjr0g3OReUUY6dqlS5knV+OATGa5VDCM7mKEjYF3
0zFJHi968pvx4ZUBxKFFnzk9BEKkidKaZPi4qgXYqBI+wP2g5HmX/BvL2hyzPrbo5CdoLgSZL3FX
nxUHzgytOw56JrEKAAAAAAAA


--=_wingspan-61249-1166025014-0001-4--

--=_wingspan-61249-1166025014-0001-3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-------------------------------------------------------------------------
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

--=_wingspan-61249-1166025014-0001-3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

--=_wingspan-61249-1166025014-0001-3--

--=_wingspan-61249-1166025014-0001-2--