]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
FreeBSD's pthreads breaks dup2(). This means we can't use dup2()
authorwessels <>
Thu, 27 May 1999 09:26:10 +0000 (09:26 +0000)
committerwessels <>
Thu, 27 May 1999 09:26:10 +0000 (09:26 +0000)
to try to find SQUID_MAXFD in configure.  To get around the bug,
we make a temporary LDFLAGS string and remove -pthread.

configure
configure.in

index 27c2b889025877e6c0baea6b35bb6878c14c6ead..455a934fff62ef593349e62c9a6da7e29aaedf6c 100755 (executable)
--- a/configure
+++ b/configure
@@ -593,7 +593,7 @@ fi
 
 
 
-# From configure.in Revision: 1.174 
+# From configure.in Revision: 1.175 
 ac_aux_dir=
 for ac_dir in cfgaux $srcdir/cfgaux; do
   if test -f $ac_dir/install-sh; then
@@ -4351,11 +4351,18 @@ EOF
 
 echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6
 echo "configure:4354: checking Maximum number of filedescriptors we can open" >&5
+TLDFLAGS="$LDFLAGS"
+case $host in
+i386-unknown-freebsd*)
+    if echo "$LDFLAGS" | grep -q pthread; then
+       LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
+    fi
+esac
 if test "$cross_compiling" = yes; then
   SQUID_MAXFD=256
 else
   cat > conftest.$ac_ext <<EOF
-#line 4359 "configure"
+#line 4366 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4412,7 +4419,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:4416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_MAXFD=`cat conftestval`
 else
@@ -4436,14 +4443,15 @@ if test "$SQUID_MAXFD" -lt 512 ; then
     echo "         on how to increase your filedescriptor limit"
     sleep 10
 fi
+LDFLAGS="$TLDFLAGS"
 
 echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6
-echo "configure:4442: checking Default UDP send buffer size" >&5
+echo "configure:4450: checking Default UDP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 4447 "configure"
+#line 4455 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4464,7 +4472,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_UDP_SO_SNDBUF=`cat conftestval`
 else
@@ -4483,12 +4491,12 @@ EOF
 
 
 echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6
-echo "configure:4487: checking Default UDP receive buffer size" >&5
+echo "configure:4495: checking Default UDP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 4492 "configure"
+#line 4500 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4509,7 +4517,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_UDP_SO_RCVBUF=`cat conftestval`
 else
@@ -4528,12 +4536,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6
-echo "configure:4532: checking Default TCP send buffer size" >&5
+echo "configure:4540: checking Default TCP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 4537 "configure"
+#line 4545 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4554,7 +4562,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_TCP_SO_SNDBUF=`cat conftestval`
 else
@@ -4573,12 +4581,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6
-echo "configure:4577: checking Default TCP receive buffer size" >&5
+echo "configure:4585: checking Default TCP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 4582 "configure"
+#line 4590 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4599,7 +4607,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_TCP_SO_RCVBUF=`cat conftestval`
 else
@@ -4618,19 +4626,19 @@ EOF
 
 
 echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6
-echo "configure:4622: checking if sys_errlist is already defined" >&5
+echo "configure:4630: checking if sys_errlist is already defined" >&5
 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4627 "configure"
+#line 4635 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 char *s = sys_errlist0;
 ; return 0; }
 EOF
-if { (eval echo configure:4634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_needs_sys_errlist="no"
 else
@@ -4652,16 +4660,16 @@ EOF
 fi
 
 echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6
-echo "configure:4656: checking for libresolv _dns_ttl_ hack" >&5
+echo "configure:4664: checking for libresolv _dns_ttl_ hack" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4658 "configure"
+#line 4666 "configure"
 #include "confdefs.h"
 extern int _dns_ttl_;
 int main() {
 return _dns_ttl_;
 ; return 0; }
 EOF
-if { (eval echo configure:4665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 cat >> confdefs.h <<\EOF
@@ -4677,12 +4685,12 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking if inet_ntoa() actually works""... $ac_c" 1>&6
-echo "configure:4681: checking if inet_ntoa() actually works" >&5
+echo "configure:4689: checking if inet_ntoa() actually works" >&5
 if test "$cross_compiling" = yes; then
   INET_NTOA_RESULT="broken"
 else
   cat > conftest.$ac_ext <<EOF
-#line 4686 "configure"
+#line 4694 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4701,7 +4709,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   INET_NTOA_RESULT=`cat conftestval`
 else
@@ -4727,9 +4735,9 @@ fi
 
 if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then
 echo $ac_n "checking for working statvfs() interface""... $ac_c" 1>&6
-echo "configure:4731: checking for working statvfs() interface" >&5
+echo "configure:4739: checking for working statvfs() interface" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4733 "configure"
+#line 4741 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4746,7 +4754,7 @@ statvfs("/tmp", &sfs);
 
 ; return 0; }
 EOF
-if { (eval echo configure:4750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_func_statvfs=yes
 else
@@ -4766,12 +4774,12 @@ fi
 fi
 
 echo $ac_n "checking for _res.nsaddr_list""... $ac_c" 1>&6
-echo "configure:4770: checking for _res.nsaddr_list" >&5
+echo "configure:4778: checking for _res.nsaddr_list" >&5
 if eval "test \"`echo '$''{'ac_cv_have_res_nsaddr_list'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4775 "configure"
+#line 4783 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_TYPES_H
@@ -4794,7 +4802,7 @@ int main() {
 _res.nsaddr_list[0];
 ; return 0; }
 EOF
-if { (eval echo configure:4798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_res_nsaddr_list="yes"
 else
@@ -4816,12 +4824,12 @@ fi
 
 if test $ac_cv_have_res_nsaddr_list = "no" ; then
 echo $ac_n "checking for _res.ns_list""... $ac_c" 1>&6
-echo "configure:4820: checking for _res.ns_list" >&5
+echo "configure:4828: checking for _res.ns_list" >&5
 if eval "test \"`echo '$''{'ac_cv_have_res_ns_list'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4825 "configure"
+#line 4833 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_TYPES_H
@@ -4844,7 +4852,7 @@ int main() {
 _res.ns_list[0].addr;
 ; return 0; }
 EOF
-if { (eval echo configure:4848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_res_ns_list="yes"
 else
index ae96284ddd7880e6d451497b3497d38ad321116c..e62e813380ce94ab9b202ed05a1692dc56c543bc 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.175 1999/05/19 20:15:50 wessels Exp $
+dnl  $Id: configure.in,v 1.176 1999/05/27 03:26:10 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.175 $)dnl
+AC_REVISION($Revision: 1.176 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(cfgaux)
 
@@ -1032,6 +1032,14 @@ AC_DEFINE_UNQUOTED(DEFAULT_FD_SETSIZE, $DEFAULT_FD_SETSIZE)
 
 dnl Not cached since people are likely to tune this
 AC_MSG_CHECKING(Maximum number of filedescriptors we can open)
+dnl damn! FreeBSD's pthreads breaks dup2().
+TLDFLAGS="$LDFLAGS"
+case $host in
+i386-unknown-freebsd*)
+    if echo "$LDFLAGS" | grep -q pthread; then
+       LDFLAGS=`echo $LDFLAGS | sed -e "s/-pthread//"`
+    fi
+esac
 AC_TRY_RUN([
 #include <stdio.h>
 #include <unistd.h>
@@ -1098,6 +1106,7 @@ if test "$SQUID_MAXFD" -lt 512 ; then
     echo "         on how to increase your filedescriptor limit"
     sleep 10
 fi
+LDFLAGS="$TLDFLAGS"
 
 dnl Not cached since people are likely to tune this
 AC_MSG_CHECKING(Default UDP send buffer size)