Remove check for Linux from IPv6 tests. Replace GLIBC version test with

a generic link test for "native" IPv6.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@177 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2012-05-11 12:31:31 +00:00
parent 5d788560a4
commit 0271799a4a
2 changed files with 34 additions and 32 deletions

View File

@@ -1,5 +1,8 @@
[Changes 1.2c01] [Changes 1.2c01]
* Fix known problem with IPv6 on FreeBSD and enable IPv6 on all supporting
platforms. Thanks to brabes and snadge. (caf)
* Improve connect() error handling. (caf) * Improve connect() error handling. (caf)
* Remove obsolete .spec files. (caf) * Remove obsolete .spec files. (caf)

View File

@@ -734,40 +734,39 @@ AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 Enable IPv6 support (Linux only)], [ --enable-ipv6 Enable IPv6 support (Linux only)],
[ case "$enableval" in [ case "$enableval" in
yes) yes)
case "$(uname -s)" in AC_LINK_IFELSE([[
Linux) #include <sys/types.h>
if test -d "/usr/inet6/include"; then #include <sys/socket.h>
CFLAGS="$CFLAGS -I/usr/inet6/include" #include <netinet/in.h>
LIBS="-L/usr/inet6/lib -linet6 $LIBS"
AC_MSG_RESULT(yes (libinet6))
AC_DEFINE(IPV6, 1, Define this if you want IPV6 support.)
else
if test -d "/usr/local/v6/lib"; then
LIBS="-L/usr/local/v6/lib -linet6 $LIBS"
AC_MSG_RESULT(yes (freebsd+kame))
AC_DEFINE(IPV6, 1, Define this if you want IPV6 support.)
else
AC_TRY_RUN([
int main()
{
#if !defined(__GLIBC__) || (__GLIBC__ < 2)
#define NO_GLIBC_2 1
#endif
if (NO_GLIBC_2) int main()
exit(0); {
else struct sockaddr_in6 sin6;
exit(1);
}],[ AC_MSG_RESULT(yes (glibc2)) sin6.sin6_family = AF_INET6;
AC_DEFINE(IPV6, 1, Define this if you want IPV6 support.) sin6.sin6_addr = in6addr_any;
], [AC_MSG_RESULT(no)], [AC_MSG_WARN(cross-compiling: assuming no ipv6)])
fi return sin6.sin6_addr.s6_addr[0];
}]], [ ac_cv_ipv6_type="native" ], [
if test -d "/usr/inet6/include"; then
CFLAGS="$CFLAGS -I/usr/inet6/include"
LIBS="-L/usr/inet6/lib -linet6 $LIBS"
ac_cv_ipv6_type="libinet6"
else
if test -d "/usr/local/v6/lib"; then
LIBS="-L/usr/local/v6/lib -linet6 $LIBS"
ac_cv_ipv6_type="freebsd+kame"
else
ac_cv_ipv6_type="none"
fi fi
;; fi])
*)
AC_MSG_RESULT(no (ipv6 support can currently be enabled on Linux only)) if test x"$ac_cv_ipv6_type" != x"none"; then
;; AC_MSG_RESULT(yes ($ac_cv_ipv6_type))
esac AC_DEFINE(IPV6, 1, Define this if you want IPV6 support.)
else
AC_MSG_RESULT(none found)
fi
;; ;;
no) no)
AC_MSG_RESULT(no) AC_MSG_RESULT(no)