Subject: Re: using BUILD_MAKE_FLAGS with distcc
To: iMil <imil@home.imil.net>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 07/21/2004 14:46:52
On Mon, Jul 19, 2004 at 10:36:18PM +0200, iMil wrote:
> 
> I may be wrong but it seems that pkgsrc, even if it can use distcc as its
> compiler, is not capable of handling directly the -j <maxjobs> flag so
> compilation is really dispatched among hosts. In fact, I realized that the
> build itself do support parallelizing compilation, so I figured out the
> BUILD_MAKE_FLAGS macro which exists on bsd.pkg.mk's "do-build:" target.
> And then I added
> 
> BUILD_MAKE_FLAGS=-j 2
> 
> to my /etc/mk.conf and it works perfectly. I did monitored compilation
> with distccmon-text and it effectively is distributed among both machines.

It should actually be:

	BUILD_MAKE_FLAGS=	${MAKE_FLAGS} -j 2

Note that this won't work with every package since there are some package
Makefiles that directly override the value of BUILD_MAKE_FLAGS.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>