summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-04-13 23:11:54 +0000
committerClint Adams <clint@users.sourceforge.net>2000-04-13 23:11:54 +0000
commit5a4a436ddea9e39b71ca9ebd51308728fd62adfd (patch)
tree3b3b139015a5ee30acb025a7db556f7e16804ece
parentc281f5c3bac7dcd38009018f5401c0c43285e140 (diff)
downloadzsh-5a4a436ddea9e39b71ca9ebd51308728fd62adfd.tar.gz
zsh-5a4a436ddea9e39b71ca9ebd51308728fd62adfd.tar.xz
zsh-5a4a436ddea9e39b71ca9ebd51308728fd62adfd.zip
10748: configure-switch for MAXJOB
-rw-r--r--ChangeLog1
-rw-r--r--configure.in61
2 files changed, 41 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index dbf33d956..83ede9092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 2000-04-13  Clint Adams  <schizo@debian.org>
+        * 10748: configure.in: set MAXJOB to whatever you want.
 	* 10745: acconfig.h, configure.in, Src/zsh.h: set MAXJOB
 	to MAX_TASKS_PER_USER if available under Linux.
 
diff --git a/configure.in b/configure.in
index fddc6070f..a165da093 100644
--- a/configure.in
+++ b/configure.in
@@ -498,27 +498,6 @@ fi
  
 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM))
 
-dnl Try to get a sane value for MAXJOB
-linux_tasks_defines_mtpu=no
-AC_MSG_CHECKING(what to set MAXJOB to)
-if test $ac_cv_header_linux_tasks_h = yes; then
-AC_EGREP_CPP(yes,
-[#include <linux/tasks.h>
- #ifdef MAX_TASKS_PER_USER
- yes
- #endif
-], linux_tasks_defines_mtpu=yes)
-fi
-
-if test $linux_tasks_defines_mtpu = yes; then
-AC_DEFINE(MAXJOB, MAX_TASKS_PER_USER)
-AC_DEFINE(NEED_LINUX_TASKS_H)
-AC_MSG_RESULT(${msg}MAX_TASKS_PER_USER)
-else
-AC_DEFINE(MAXJOB, 50)
-AC_MSG_RESULT(${msg}50)
-fi
-
 dnl -------------------
 dnl CHECK FOR LIBRARIES
 dnl -------------------
@@ -1372,6 +1351,46 @@ main() {
     fi
 fi
 
+AC_MSG_CHECKING(what to set MAXJOB to)
+dnl Do you want to alter the maximum job table size?
+undefine([max_jobtable_size])dnl
+AC_ARG_ENABLE(max-jobtable-size,
+[  --enable-max-jobtable-size=MAX   Limit job table size to MAX],
+
+[if test x$enableval = xyes; then
+
+  if test $ac_cv_header_linux_tasks_h = yes; then
+   AC_EGREP_CPP(yes,
+   [#include <linux/tasks.h>
+    #ifdef MAX_TASKS_PER_USER
+    yes
+    #endif
+   ],
+   maxj=max)
+
+   if test x$maxj = xmax; then
+    AC_DEFINE(MAXJOB, MAX_TASKS_PER_USER)
+    AC_DEFINE(NEED_LINUX_TASKS_H)
+    AC_MSG_RESULT(${msg}MAX_TASKS_PER_USER)
+   else
+    AC_DEFINE(MAXJOB, 256)
+    AC_MSG_RESULT(${msg}256)
+   fi
+  fi
+
+ elif test x$enableval = xno; then
+ AC_DEFINE(MAXJOB,512)
+ AC_MSG_RESULT(${msg}512)
+ else
+ AC_DEFINE_UNQUOTED(MAXJOB,$enableval)
+ AC_MSG_RESULT(${msg}${enableval}) 
+fi],
+[
+AC_DEFINE(MAXJOB, 50)
+ AC_MSG_RESULT(${msg}50) 
+])
+
+
 dnl ---------------
 dnl dynamic loading
 dnl ---------------