]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
check for working inet_ntoa()
authorwessels <>
Wed, 14 Oct 1998 09:04:21 +0000 (09:04 +0000)
committerwessels <>
Wed, 14 Oct 1998 09:04:21 +0000 (09:04 +0000)
configure
configure.in

index 4972af7cddc603f5dc8b0d5a8182de24d1167063..5b84d83be38264c44c7bcd878fec057bc84a09e2 100755 (executable)
--- 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 <<EOF
+#line 4443 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+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
index f2940509c635603be6a958285c10e68f0c4ec8a6..44afd8d4a997804530732b69b7dcf4522c82869f 100644 (file)
@@ -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 <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+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