From: wessels <> Date: Wed, 14 Oct 1998 09:04:21 +0000 (+0000) Subject: check for working inet_ntoa() X-Git-Tag: SQUID_3_0_PRE1~2579 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a937d5e3531729bee334d19691a47c3e2d772dd8;p=thirdparty%2Fsquid.git check for working inet_ntoa() --- diff --git a/configure b/configure index 4972af7cdd..5b84d83be3 100755 --- a/configure +++ b/configure @@ -583,7 +583,7 @@ fi -# From configure.in Revision: 1.156 +# From configure.in Revision: 1.157 ac_aux_dir= for ac_dir in cfgaux $srcdir/cfgaux; do if test -f $ac_dir/install-sh; then @@ -4433,6 +4433,51 @@ else fi rm -f conftest* +echo $ac_n "checking if inet_ntoa() actually works""... $ac_c" 1>&6 +echo "configure:4438: checking if inet_ntoa() actually works" >&5 +if test "$cross_compiling" = yes; then + INET_NTOA_RESULT="broken" +else + cat > conftest.$ac_ext < +#include +#include +#include +#include +main () +{ + struct in_addr in; + in.s_addr = inet_addr("1.2.3.4"); + fprintf (fopen("conftestval", "w"), "%s\n", inet_ntoa(in)); + exit(0); +} + +EOF +if { (eval echo configure:4460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + INET_NTOA_RESULT=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + INET_NTOA_RESULT="broken" +fi +rm -fr conftest* +fi + +if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then + echo "$ac_t"""yes"" 1>&6 +else + echo "$ac_t"""no"" 1>&6 + echo "WARNING: This looks bad, and probably prevents Squid from working." + echo " If you're on IRIX and using GCC 2.8, you probably need" + echo " to use the IRIX C compiler instead." + sleep 10 +fi + XTRA_OBJS='' if test "$ac_cv_lib_malloc_main" = "yes" ; then if test -r /usr/lib/debug/malloc.o ; then diff --git a/configure.in b/configure.in index f2940509c6..44afd8d4a9 100644 --- a/configure.in +++ b/configure.in @@ -3,13 +3,13 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.157 1998/10/07 19:34:36 wessels Exp $ +dnl $Id: configure.in,v 1.158 1998/10/14 03:04:21 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.157 $)dnl +AC_REVISION($Revision: 1.158 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(cfgaux) @@ -1130,6 +1130,34 @@ AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;, AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)], AC_MSG_RESULT(no)) +AC_MSG_CHECKING(if inet_ntoa() actually works) +AC_TRY_RUN([ +#include +#include +#include +#include +#include +main () +{ + struct in_addr in; + in.s_addr = inet_addr("1.2.3.4"); + fprintf (fopen("conftestval", "w"), "%s\n", inet_ntoa(in)); + exit(0); +} +], +INET_NTOA_RESULT=`cat conftestval`, +INET_NTOA_RESULT="broken", +INET_NTOA_RESULT="broken") +if test "$INET_NTOA_RESULT" = "1.2.3.4" ; then + AC_MSG_RESULT("yes") +else + AC_MSG_RESULT("no") + echo "WARNING: This looks bad, and probably prevents Squid from working." + echo " If you're on IRIX and using GCC 2.8, you probably need" + echo " to use the IRIX C compiler instead." + sleep 10 +fi + dnl Need the debugging version of malloc if available XTRA_OBJS='' if test "$ac_cv_lib_malloc_main" = "yes" ; then