7158488 MAKEFLAGS not being honored always (regression) in 3.82 s11-sru
authorVladimir Marek <Vladimir.Marek@oracle.com>
Tue, 07 Aug 2012 15:30:09 +0200
branchs11-sru
changeset 2322 62b81b3d31fe
parent 2321 87c74fb0d4b7
child 2323 908c7456de72
7158488 MAKEFLAGS not being honored always (regression) in 3.82
components/make/patches/30723.patch
components/make/patches/33873.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/make/patches/30723.patch	Tue Aug 07 15:30:09 2012 +0200
@@ -0,0 +1,20 @@
+This patch is taken from:
+http://cvs.savannah.gnu.org/viewvc/make/main.c?root=make&r1=1.243&r2=1.244
+
+Fix Savannah bug #30723:
+expand MAKEFLAGS before we re-exec after rebuilding makefiles.
+
+bug #30723: implicit re-executing of subdirs breaks $(origin) with make-3.82
+https://savannah.gnu.org/bugs/?30723
+
+--- a/main.c	2010/07/19 07:10:53	1.243
++++ b/main.c	2010/08/10 07:35:34	1.244
+@@ -2093,7 +2093,7 @@
+             const char *pv = define_makeflags (1, 1);
+             char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
+             sprintf (p, "MAKEFLAGS=%s", pv);
+-            putenv (p);
++            putenv (allocated_variable_expand (p));
+           }
+ 
+ 	  if (ISDB (DB_BASIC))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/make/patches/33873.patch	Tue Aug 07 15:30:09 2012 +0200
@@ -0,0 +1,37 @@
+This patch is taken from:
+http://cvs.savannah.gnu.org/viewvc/make/main.c?root=make&r1=1.246&r2=1.247
+
+When we re-exec the master makefile in a jobserver environment, ensure
+that MAKEFLAGS is set properly so the re-exec'd make runs in parallel.
+See Savannah bug #33873.
+
+bug #33873: MAKEFLAGS=-jN gets lost on reexec
+https://savannah.gnu.org/bugs/?33873
+
+sr #107487: MAKEFLAGS not being honored always (regression) in 3.82
+https://savannah.gnu.org/support/index.php?107487
+
+--- a/main.c	2010/08/29 23:05:27	1.246
++++ b/main.c	2011/09/18 23:39:26	1.247
+@@ -2088,6 +2088,11 @@
+ 
+           ++restarts;
+ 
++          /* If we're re-exec'ing the first make, put back the number of
++             job slots so define_makefiles() will get it right.  */
++          if (master_job_slots)
++            job_slots = master_job_slots;
++
+           /* Reset makeflags in case they were changed.  */
+           {
+             const char *pv = define_makeflags (1, 1);
+@@ -2824,9 +2829,6 @@
+ 		       && (*(unsigned int *) cs->value_ptr ==
+ 			   *(unsigned int *) cs->noarg_value))
+ 		ADD_FLAG ("", 0); /* Optional value omitted; see below.  */
+-	      else if (cs->c == 'j')
+-		/* Special case for `-j'.  */
+-		ADD_FLAG ("1", 1);
+ 	      else
+ 		{
+ 		  char *buf = alloca (30);