Index: configure.in =================================================================== RCS file: /cvsroot/squid/squid/configure.in,v retrieving revision 1.42.2.26 diff -u -r1.42.2.26 configure.in --- configure.in 12 Sep 2002 21:45:44 -0000 1.42.2.26 +++ configure.in 15 Sep 2002 21:54:08 -0000 @@ -1072,6 +1072,10 @@ fi ]) +AC_ARG_WITH(filedescs, +[ --with-filedescs=NUMBER Force squid to support NUMBER filedescriptors], +[ squid_filedescs_num=$withval ]) + # Force some compilers to use ANSI features # case "$host" in @@ -1830,17 +1834,22 @@ AC_MSG_RESULT($DEFAULT_FD_SETSIZE) 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([ +if test -n "$squid_filedescs_num" ; then + SQUID_MAXFD=$squid_filedescs_num + AC_MSG_RESULT($SQUID_MAXFD (user-forced)) +else + 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 #include #include /* needed on FreeBSD */ @@ -1896,11 +1905,12 @@ fprintf (fp, "%d\n", i); exit(0); } -], -SQUID_MAXFD=`cat conftestval`, -SQUID_MAXFD=256, -SQUID_MAXFD=256) -AC_MSG_RESULT($SQUID_MAXFD) + ], + SQUID_MAXFD=`cat conftestval`, + SQUID_MAXFD=256, + SQUID_MAXFD=256) + AC_MSG_RESULT($SQUID_MAXFD) +fi AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD) if test "$SQUID_MAXFD" -lt 512 ; then echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your"