Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 2009 13:27:55 -0900 (AKST)
From:      Mel <mel.xyzzy@rachie.is-a-geek.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        FreeBSD_MAINTAINER <portmgr@FreeBSD.org>
Subject:   ports/131065: [PATCH] Add -jN support to build target
Message-ID:  <20090127222755.A603A33C1E@squish.rachie.is-a-geek.net>
Resent-Message-ID: <200901272230.n0RMU2Dk066517@freefall.freebsd.org>

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

>Number:         131065
>Category:       ports
>Synopsis:       [PATCH] Add -jN support to build target
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 27 22:30:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Mel
>Release:        FreeBSD 7.1-STABLE i386
>Organization:
>Environment:
System: FreeBSD squish.rachie.is-a-geek.net 7.1-STABLE FreeBSD 7.1-STABLE #6: Fri Jan 23 13:37:29 AKST 2009     root@squish.rachie.is-a-geek.net:/data/obj/data/RELENG_7/src/sys/GENERIC-ICHSMB  i386


>Description:
The build target for many ports are -jX safe, yet there's no officially
supported way to turn on multijob builds.

See also:
http://lists.freebsd.org/pipermail/freebsd-questions/2009-January/191389.html
 
>How-To-Repeat:
N/A
>Fix:
The patch below looks for BUILD_JOBS and NO_PARALLEL. If NO_PARALLEL is set
BUILD_JOBS will be set to 1 explicitedly. This is intended primarily for
port maintainers to set, when they know their port is not multijob safe,
but can also be used by users to (temporarily) disable parallel building.

I'm personally not hung up on the names chosen.

The patch has had mild testing (about a dozen ports compiled without problems).

--- bsd.port.mk.patch begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.609
diff -u -r1.609 bsd.port.mk
--- Mk/bsd.port.mk	23 Jan 2009 16:27:14 -0000	1.609
+++ Mk/bsd.port.mk	27 Jan 2009 00:44:09 -0000
@@ -2127,6 +2127,11 @@
 MD5_FILE?=		${MASTERDIR}/distinfo
 
 MAKE_FLAGS?=	-f
+.if defined(NO_PARALLEL)
+BUILD_JOBS=		1
+.else
+BUILD_JOBS?=	1
+.endif
 MAKEFILE?=		Makefile
 MAKE_ENV+=		PREFIX=${PREFIX} \
 			LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \
@@ -3645,9 +3650,9 @@
 .if !target(do-build)
 do-build:
 .if defined(USE_GMAKE)
-	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} -j${BUILD_JOBS} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .else
-	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} -j ${BUILD_JOBS} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .endif
 .endif
 
--- bsd.port.mk.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



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