OSSP CVS Repository

ossp - Difference in ossp-pkg/pth/aclocal.m4 versions 1.98 and 1.99
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/pth/aclocal.m4 1.98 -> 1.99

--- aclocal.m4   2002/11/03 12:21:00     1.98
+++ aclocal.m4   2002/11/03 16:31:34     1.99
@@ -1168,6 +1168,66 @@
 ])
 
 dnl ##
+dnl ##  Check for FD_SETSIZE
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_CHECK_FDSETSIZE(<varname>)
+
+AC_DEFUN(AC_CHECK_FDSETSIZE,[dnl
+dnl #   1. determine default value
+AC_MSG_CHECKING(for default value of FD_SETSIZE)
+cross_compiling=no
+AC_TRY_RUN(
+changequote(<<, >>)dnl
+<<
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+int main(int argc, char *argv[])
+{
+    FILE *fp;
+    int ac_fdsetsize;
+#if defined(FD_SETSIZE)
+    ac_fdsetsize = FD_SETSIZE;
+#else
+    ac_fdsetsize = (sizeof(fd_set)*8);
+#endif
+    if ((fp = fopen("conftestval", "w")) == NULL)
+        exit(1);
+    fprintf(fp, "%d\n", ac_fdsetsize);
+    fclose(fp);
+    exit(0);
+}
+>>
+changequote([, ])dnl
+,
+ac_fdsetsize=`cat conftestval`,
+ac_fdsetsize=1024,
+ac_fdsetsize=1024
+)
+AC_MSG_RESULT([$ac_fdsetsize])
+$1="$ac_fdsetsize"
+AC_SUBST($1)
+
+dnl #   2. allow user to force a particular value
+AC_ARG_WITH(fdsetsize,dnl
+[  --with-fdsetsize=NUM    set FD_SETSIZE while building GNU Pth],[
+case $withval in
+    [[1-9]][[0-9]]|[[1-9]][[0-9]][[0-9]]|[[1-9]][[0-9]][[0-9]][[0-9]]) $1=$withval ;;
+    * ) AC_ERROR([invalid FD_SETSIZE specified -- allowed: 10-9999]) ;;
+esac
+dnl # we cannot use the usual
+dnl # AC_DEFINE_UNQUOTED(FD_SETSIZE, $$1, [Define to the maximum size of fd_set])
+dnl # here, because FD_SETSIZE has to be defined already before any other
+dnl # system headers are included. Hence we have to use CPPFLAGS.
+CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=$$1"
+AC_MSG_CHECKING([for overridden FD_SETSIZE value])
+AC_MSG_RESULT([$$1])
+])
+
+])
+
+dnl ##
 dnl ##  Check for an external/extension library.
 dnl ##  - is aware of <libname>-config style scripts
 dnl ##  - searches under standard paths include, lib, etc.

CVSTrac 2.0.1