2342. [func] Use getifaddrs() if available under Linux. [RT #17224]

This commit is contained in:
Mark Andrews
2008-03-20 04:51:00 +00:00
parent 55f580c7fc
commit ea8564f68a
7 changed files with 272 additions and 282 deletions

167
configure vendored
View File

@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# $Id: configure,v 1.423 2008/01/30 04:49:59 marka Exp $
# $Id: configure,v 1.424 2008/03/20 04:51:00 marka Exp $
#
# Portions Copyright (C) 1996-2001 Nominum, Inc.
#
@@ -29,7 +29,7 @@
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# From configure.in Revision: 1.438 .
# From configure.in Revision: 1.439 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61.
#
@@ -1632,8 +1632,7 @@ Optional Features:
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-libbind build libbind default=no
--enable-ipv6 use IPv6 default=autodetect
--enable-getifaddrs Enable the use of getifaddrs() [yes|no|glibc].
glibc: Use getifaddrs() in glibc if you know it supports IPv6.
--enable-getifaddrs Enable the use of getifaddrs() [yes|no].
--disable-isc-spnego use SPNEGO from GSSAPI library
--disable-linux-caps disable linux capabilities
--enable-atomic enable machine specific atomic operations
@@ -9581,7 +9580,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 9584 "configure"' > conftest.$ac_ext
echo '#line 9583 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -11703,11 +11702,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11706: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11705: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:11710: \$? = $ac_status" >&5
echo "$as_me:11709: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -11946,11 +11945,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11949: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11948: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:11953: \$? = $ac_status" >&5
echo "$as_me:11952: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -12006,11 +12005,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:12009: $lt_compile\"" >&5)
(eval echo "\"\$as_me:12008: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:12013: \$? = $ac_status" >&5
echo "$as_me:12012: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14154,7 +14153,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 14157 "configure"
#line 14156 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14252,7 +14251,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 14255 "configure"
#line 14254 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16445,11 +16444,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16448: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16447: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16452: \$? = $ac_status" >&5
echo "$as_me:16451: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -16505,11 +16504,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16508: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16507: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:16512: \$? = $ac_status" >&5
echo "$as_me:16511: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17833,7 +17832,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 17836 "configure"
#line 17835 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17931,7 +17930,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 17934 "configure"
#line 17933 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18768,11 +18767,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:18771: $lt_compile\"" >&5)
(eval echo "\"\$as_me:18770: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:18775: \$? = $ac_status" >&5
echo "$as_me:18774: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -18828,11 +18827,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:18831: $lt_compile\"" >&5)
(eval echo "\"\$as_me:18830: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:18835: \$? = $ac_status" >&5
echo "$as_me:18834: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20862,11 +20861,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:20865: $lt_compile\"" >&5)
(eval echo "\"\$as_me:20864: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:20869: \$? = $ac_status" >&5
echo "$as_me:20868: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -21105,11 +21104,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:21108: $lt_compile\"" >&5)
(eval echo "\"\$as_me:21107: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:21112: \$? = $ac_status" >&5
echo "$as_me:21111: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -21165,11 +21164,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:21168: $lt_compile\"" >&5)
(eval echo "\"\$as_me:21167: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:21172: \$? = $ac_status" >&5
echo "$as_me:21171: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -23313,7 +23312,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 23316 "configure"
#line 23315 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -23411,7 +23410,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 23414 "configure"
#line 23413 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -26300,21 +26299,16 @@ else
fi
#
# This interface iteration code for getifaddrs() will fall back to using
# /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
# addresses.
#
case $want_getifaddrs in
yes|glibc)
#
# Do we have getifaddrs() ?
#
case $host in
*-linux*)
# Some recent versions of glibc support getifaddrs() which does not
# provide AF_INET6 addresses while the function provided by the USAGI
# project handles the AF_INET6 case correctly. We need to avoid
# using the former but prefer the latter unless overridden by
# --enable-getifaddrs=glibc.
if test $want_getifaddrs = glibc
then
{ echo "$as_me:$LINENO: checking for getifaddrs" >&5
glibc)
{ echo "$as_me:$LINENO: WARNING: \"--enable-getifaddrs=glibc is no longer required\"" >&5
echo "$as_me: WARNING: \"--enable-getifaddrs=glibc is no longer required\"" >&2;}
{ echo "$as_me:$LINENO: checking for getifaddrs" >&5
echo $ECHO_N "checking for getifaddrs... $ECHO_C" >&6; }
if test "${ac_cv_func_getifaddrs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -26402,84 +26396,9 @@ _ACEOF
fi
else
save_LIBS="$LIBS"
LIBS="-L/usr/local/v6/lib $LIBS"
{ echo "$as_me:$LINENO: checking for getifaddrs in -linet6" >&5
echo $ECHO_N "checking for getifaddrs in -linet6... $ECHO_C" >&6; }
if test "${ac_cv_lib_inet6_getifaddrs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-linet6 $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char getifaddrs ();
int
main ()
{
return getifaddrs ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
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_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); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_inet6_getifaddrs=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_inet6_getifaddrs=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_inet6_getifaddrs" >&5
echo "${ECHO_T}$ac_cv_lib_inet6_getifaddrs" >&6; }
if test $ac_cv_lib_inet6_getifaddrs = yes; then
LIBS="$LIBS -linet6"
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETIFADDRS 1
_ACEOF
else
LIBS=${save_LIBS}
fi
fi
;;
*)
{ echo "$as_me:$LINENO: checking for getifaddrs" >&5
;;
yes)
{ echo "$as_me:$LINENO: checking for getifaddrs" >&5
echo $ECHO_N "checking for getifaddrs... $ECHO_C" >&6; }
if test "${ac_cv_func_getifaddrs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -26567,8 +26486,6 @@ _ACEOF
fi
;;
esac
;;
no)
;;