From 9a4bc556be3d8c6bc0b724ae087cd4acd78dcf6d Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Fri, 16 Aug 2013 18:47:18 +0000 Subject: [PATCH] Add .MAKE.ALWAYS_PASS_JOB_QUEUE knob (default yes) for backwards compatability. --- contrib/bmake/job.c | 13 ++++++++++++- contrib/bmake/make.1 | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/contrib/bmake/job.c b/contrib/bmake/job.c index c8af895c4dd0..4d901b0c4710 100644 --- a/contrib/bmake/job.c +++ b/contrib/bmake/job.c @@ -171,6 +171,14 @@ __RCSID("$NetBSD: job.c,v 1.175 2013/07/30 19:09:57 sjg Exp $"); #include "trace.h" # define STATIC static +/* + * FreeBSD: traditionally .MAKE is not required to + * pass jobs queue to sub-makes. + * Use .MAKE.ALWAYS_PASS_JOB_QUEUE=no to disable. + */ +#define MAKE_ALWAYS_PASS_JOB_QUEUE ".MAKE.ALWAYS_PASS_JOB_QUEUE" +static int Always_pass_job_queue = TRUE; + /* * error handling variables */ @@ -1360,7 +1368,7 @@ JobExec(Job *job, char **argv) (void)fcntl(0, F_SETFD, 0); (void)lseek(0, (off_t)0, SEEK_SET); - if (job->node->type & OP_MAKE) { + if (Always_pass_job_queue || (job->node->type & OP_MAKE)) { /* * Pass job token pipe to submakes. */ @@ -2226,6 +2234,9 @@ Job_Init(void) lastNode = NULL; + Always_pass_job_queue = getBoolean(MAKE_ALWAYS_PASS_JOB_QUEUE, + Always_pass_job_queue); + /* * There is a non-zero chance that we already have children. * eg after 'make -f- <