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);