Add a patch from Paul Eggert that's been lying around in my directory for
authorPaul Smith <psmith@gnu.org>
Wed, 16 Feb 2005 05:03:42 +0000 (05:03 +0000)
committerPaul Smith <psmith@gnu.org>
Wed, 16 Feb 2005 05:03:42 +0000 (05:03 +0000)
a long time, disabling stack size limits where possible.

Update version to beta2.

ChangeLog
configure.in
doc/make.texi
main.c

index dc4c8993f566945995913688df751777fe2185d9..108cbc0717b1a602d228fb7594d05125cc7a791c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * i18n/ja.po: Installed an updated translation.
 
+2001-09-06  Paul Eggert  <eggert@twinsun.com>
+
+       * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
+       (AC_CHECK_FUNCS): Add getrlimit, setrlimit.
+
+       * main.c: Include <sys/resource.h> if it, getrlimit, and setrlimit
+       are available.
+       (main): Get rid of any avoidable limit on stack size.
+
 2001-09-04  Paul D. Smith  <psmith@gnu.org>
 
        * i18n/da.po: Installed an updated translation.
index 4bad3e207e0327573d7a0526c208d608c96a0496..a8c35ecb4b082354b41500eefba2fbb27b64bd25 100644 (file)
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([GNU make],[3.81beta1],[bug-make@gnu.org])
+AC_INIT([GNU make],[3.81beta2],[bug-make@gnu.org])
 
 AC_PREREQ(2.59)
 AC_REVISION([[$Id$]])
@@ -50,7 +50,7 @@ AC_HEADER_DIRENT
 AC_HEADER_STAT
 AC_HEADER_TIME
 AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
-                memory.h sys/param.h sys/time.h sys/timeb.h)
+                memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h)
 
 # Set a flag if we have an ANSI C compiler
 if test "$ac_cv_prog_cc_stdc" != no; then
@@ -136,7 +136,7 @@ fi
 AC_CHECK_FUNCS(        memcpy memmove strchr strdup mkstemp mktemp fdopen \
                bsd_signal dup2 getcwd realpath sigsetmask sigaction \
                 getgroups seteuid setegid setlinebuf setreuid setregid \
-                setvbuf pipe strerror strsignal)
+                getrlimit setrlimit setvbuf pipe strerror strsignal)
 
 AC_FUNC_SETVBUF_REVERSED
 
index 8c367bae99251c62947954f842a5d8c71af27c1e..9b6f9d8a5a72dcb9ccf75df37c37e358dae62a56 100644 (file)
@@ -2423,8 +2423,10 @@ prog3 : prog3.o sort.o utils.o
 @end example
 
 @noindent
-Now you can say just @samp{make} to remake all three programs, or specify
-as arguments the ones to remake (as in @samp{make prog1 prog3}).
+Now you can say just @samp{make} to remake all three programs, or
+specify as arguments the ones to remake (as in @samp{make prog1
+prog3}).  Phoniness is not inherited: the prerequisites of a phony
+target are not themselves phony, unless explicitly declared to be so.
 
 When one phony target is a prerequisite of another, it serves as a subroutine
 of the other.  For example, here @samp{make cleanall} will delete the
diff --git a/main.c b/main.c
index 726729bec026bddd92d890c302b9a1e01a8a0ce9..33c15b4944c8ee94553e15570683736ce2824d4b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -46,6 +46,14 @@ MA 02111-1307, USA.  */
 # include <fcntl.h>
 #endif
 
+#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+# define SET_STACK_SIZE
+#endif
+
+#ifdef SET_STACK_SIZE
+# include <sys/resource.h>
+#endif
+
 #ifdef _AMIGA
 int __stack = 20000; /* Make sure we have 20K of stack space */
 #endif
@@ -881,6 +889,20 @@ main (int argc, char **argv, char **envp)
   no_default_sh_exe = 1;
 #endif
 
+#ifdef SET_STACK_SIZE
+ /* Get rid of any avoidable limit on stack size.  */
+  {
+    struct rlimit rlim;
+
+    /* Set the stack limit huge so that alloca does not fail.  */
+    if (getrlimit (RLIMIT_STACK, &rlim) == 0)
+      {
+        rlim.rlim_cur = rlim.rlim_max;
+        setrlimit (RLIMIT_STACK, &rlim);
+      }
+  }
+#endif
+
   /* Needed for OS/2 */
   initialize_main(&argc, &argv);