From owner-freebsd-ports@FreeBSD.ORG Wed Mar 31 19:51:55 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 429EF16A4CF for ; Wed, 31 Mar 2004 19:51:55 -0800 (PST) Received: from bes.amduat.net (bes.amduat.net [206.124.149.190]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9AAB43D48 for ; Wed, 31 Mar 2004 19:51:54 -0800 (PST) (envelope-from jbarrett@amduat.net) Received: from osiris.amduat.net (osiris.amduat.net [10.0.0.69]) (AUTH: LOGIN jbarrett, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by bes.amduat.net with esmtp; Wed, 31 Mar 2004 19:51:53 -0800 From: "Jacob S. Barrett" To: ports@freebsd.org Date: Wed, 31 Mar 2004 19:51:52 -0800 User-Agent: KMail/1.6.1 MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_YH5aA8+bpg2Ewzh" Message-Id: <200403311951.52865.jbarrett@amduat.net> Subject: Ports with distcc X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2004 03:51:55 -0000 --Boundary-00=_YH5aA8+bpg2Ewzh Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Has anyone really looked into the feasibility of adding distcc support to the ports system? I realize that not all ports support concurrent make, but those that do could potentially take advantage of it. What I propose is a flag in the port Makefile, SUPPORTS_MAKE_CONCURRENCY. Then users could add WITH_MAKE_CONCURRENCY to make.conf to build ports that support it with make concurrency. Then an additional WITH_DISTCC flag in make.conf to use distcc when making with concurrency. I made a minor change to bsd.ports.mk to do this and it seems to work pretty well. Here is my patch to bsd.ports.mk. What do you guys think? -- Jacob S. Barrett jbarrett@amduat.net www.amduat.net "I don't suffer from insanity, I enjoy every minute of it." --Boundary-00=_YH5aA8+bpg2Ewzh Content-Type: text/x-diff; charset="us-ascii"; name="bsd.port.mk.distcc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bsd.port.mk.distcc.patch" --- bsd.port.mk.orig Wed Mar 31 19:26:46 2004 +++ bsd.port.mk Wed Mar 31 19:27:12 2004 @@ -453,7 +453,16 @@ # If WITH_APACHE2 is defined defaults to www/apache2 # APXS - Full path to the prefered apxs binary to configure # apache modules. Default: ${LOCALBASE}/sbin/apxs -# +# +# SUPPORTS_MAKE_CONCURRENCY - Port flag that indicates that it is compatible with +# make job concurrency. +# WITH_MAKE_CONCURRENCY - If a port has SUPPORTS_MAKE_CONCURRENCY this flag enables +# it to be execute make with -j. +# WITH_DISTCC - If USE_MAKE_CONCURRENCY and SUPPORTS_MAKE_CONCURRENCY are +# are set then this will enable the use of distcc to distribute +# the port build across multiple machines. +# NO_DISTCC - The port supports make concurrency but does not build with +# distcc for some reason. # # # Dependency checking. Use these if your port requires another port @@ -1907,6 +1916,17 @@ MD5_FILE?= ${MASTERDIR}/distinfo MAKE_FLAGS?= -f +.if defined(SUPPORTS_MAKE_CONCURRENCY) +.if defined(WITH_MAKE_CONCURRENCY) +MAKE_CONCURRENCY_JOBS?= 8 +MAKE_FLAGS:= -j${MAKE_CONCURRENCY_JOBS} ${MAKE_FLAGS} +.endif +.if defined(WITH_DISTCC) && !defined(NO_DISTCC) +DISTCC?= /usr/local/bin/distcc +CC:= ${DISTCC} "${CC}" +CXX:= ${DISTCC} "${CXX}" +.endif +.endif MAKEFILE?= Makefile MAKE_ENV+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" MANPREFIX="${MANPREFIX}" --Boundary-00=_YH5aA8+bpg2Ewzh--