From owner-freebsd-current@FreeBSD.ORG Fri Nov 12 11:17:39 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3460416A4CE; Fri, 12 Nov 2004 11:17:39 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D12843D46; Fri, 12 Nov 2004 11:17:38 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id iACBHb3Q013141; Fri, 12 Nov 2004 13:17:37 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 39084-15; Fri, 12 Nov 2004 13:17:36 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id iACBHaCH013138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Nov 2004 13:17:36 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id iACBHa6s085657; Fri, 12 Nov 2004 13:17:36 +0200 (EET) (envelope-from ru) Date: Fri, 12 Nov 2004 13:17:32 +0200 From: Ruslan Ermilov To: Harti Brandt Message-ID: <20041112111732.GH41844@ip.net.ua> References: <95167.1100254152@critter.freebsd.dk> <20041112111357.T42945@beagle.kn.op.dlr.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcXnUX77nabWBLF4" Content-Disposition: inline In-Reply-To: <20041112111357.T42945@beagle.kn.op.dlr.de> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua cc: Poul-Henning Kamp cc: current@freebsd.org Subject: Re: [TEST] make -j patch [take 2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2004 11:17:39 -0000 --HcXnUX77nabWBLF4 Content-Type: multipart/mixed; boundary="XigHxYirkHk2Kxsx" Content-Disposition: inline --XigHxYirkHk2Kxsx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 12, 2004 at 11:24:12AM +0100, Harti Brandt wrote: > It would actually give me _more_ control over make's behaviour. I could,= =20 > for example, build the tool with -j4, but run the tool with -j2. Suppose= =20 > that is a long running regression test that I don't want to occupy my=20 > 4 processor machine, but I want the tool for the test to build fast. >=20 Here's the patch that changes the -j behavior the way I want it: - if a sub-make is given an explicit -jX argument (either on a command line or through a special .MAKEFLAGS target in makefile), it will forget about its current job group membership, - if -jX is given implicitly through the MAKEFLAGS environment variable then a sub-make will respect MAKE_JOBS_FIFO and will join the job group. Of course, like you say, there's always a possibility to unset MAKE_JOBS_FIFO before launching a sub-make. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --XigHxYirkHk2Kxsx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Content-Transfer-Encoding: quoted-printable Index: main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/make/main.c,v retrieving revision 1.96 diff -u -p -r1.96 main.c --- main.c 12 Nov 2004 08:58:07 -0000 1.96 +++ main.c 12 Nov 2004 11:03:56 -0000 @@ -119,7 +119,7 @@ Boolean checkEnvFirst; /* -e flag */ Lst envFirstVars; /* (-E) vars to override from env */ Boolean jobsRunning; /* TRUE if the jobs might be running */ =20 -static void MainParseArgs(int, char **); +static void MainParseArgs(int, int, char **); char * chdir_verify_path(char *, char *); static int ReadMakefile(void *, void *); static void usage(void); @@ -157,7 +157,7 @@ MFLAGS_append(char *flag, char *arg) * given */ static void -MainParseArgs(int argc, char **argv) +MainParseArgs(int override, int argc, char **argv) { char *p; int c; @@ -280,6 +280,8 @@ rearg: while((c =3D getopt(argc, argv, OPT usage(); } MFLAGS_append("-j", optarg); + if (override) + unsetenv("MAKE_JOBS_FIFO"); break; } case 'k': @@ -366,7 +368,7 @@ rearg: while((c =3D getopt(argc, argv, OPT * Only those that come from the various arguments. */ void -Main_ParseArgLine(char *line) +Main_ParseArgLine(int override, char *line) { char **argv; /* Manufactured argument vector */ int argc; /* Number of arguments in argv */ @@ -379,7 +381,7 @@ Main_ParseArgLine(char *line) return; =20 argv =3D brk_string(line, &argc, TRUE); - MainParseArgs(argc, argv); + MainParseArgs(override, argc, argv); } =20 char * @@ -612,12 +614,12 @@ main(int argc, char **argv) * in a different format). */ #ifdef POSIX - Main_ParseArgLine(getenv("MAKEFLAGS")); + Main_ParseArgLine(0, getenv("MAKEFLAGS")); #else - Main_ParseArgLine(getenv("MAKE")); + Main_ParseArgLine(0, getenv("MAKE")); #endif =20 - MainParseArgs(argc, argv); + MainParseArgs(1, argc, argv); =20 /* * Find where we are... Index: nonints.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/make/nonints.h,v retrieving revision 1.23 diff -u -p -r1.23 nonints.h --- nonints.h 12 Aug 2004 11:49:55 -0000 1.23 +++ nonints.h 12 Nov 2004 09:43:10 -0000 @@ -63,7 +63,7 @@ int For_Eval(char *); void For_Run(int); =20 /* main.c */ -void Main_ParseArgLine(char *); +void Main_ParseArgLine(int, char *); char *Cmd_Exec(char *, char **); void Debug(const char *, ...); void Error(const char *, ...); Index: parse.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/make/parse.c,v retrieving revision 1.57 diff -u -p -r1.57 parse.c --- parse.c 22 Jul 2004 11:12:01 -0000 1.57 +++ parse.c 12 Nov 2004 09:43:23 -0000 @@ -1048,7 +1048,7 @@ ParseDoDependency (char *line) * set the initial character to a null-character so the loop to * get sources won't get anything */ - Main_ParseArgLine (line); + Main_ParseArgLine (1, line); *line =3D '\0'; } else if (specType =3D=3D ExShell) { if (Job_ParseShell (line) !=3D SUCCESS) { --XigHxYirkHk2Kxsx-- --HcXnUX77nabWBLF4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBlJvMqRfpzJluFF4RAmPHAJ9iSDtMzaSwkppiwP6wiyOpGBlmbACggCll GXFL2gbOs86p6g/EazL6alA= =Hba+ -----END PGP SIGNATURE----- --HcXnUX77nabWBLF4--