Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2004 19:51:52 -0800
From:      "Jacob S. Barrett" <jbarrett@amduat.net>
To:        ports@freebsd.org
Subject:   Ports with distcc
Message-ID:  <200403311951.52865.jbarrett@amduat.net>

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403311951.52865.jbarrett>