From owner-freebsd-ports Sat Mar 18 15:40: 7 2000 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B98A837BBB6 for ; Sat, 18 Mar 2000 15:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA02340; Sat, 18 Mar 2000 15:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from news-ma.rhein-neckar.de (news-ma.rhein-neckar.de [193.197.90.3]) by hub.freebsd.org (Postfix) with ESMTP id ECCE537B5F5 for ; Sat, 18 Mar 2000 15:31:25 -0800 (PST) (envelope-from naddy@bigeye.rhein-neckar.de) Received: from bigeye.rhein-neckar.de (uucp@localhost) by news-ma.rhein-neckar.de (8.8.8/8.8.8) with bsmtp id AAA22779 for FreeBSD-gnats-submit@freebsd.org; Sun, 19 Mar 2000 00:31:24 +0100 (CET) (envelope-from naddy@bigeye.rhein-neckar.de) Received: (from naddy@localhost) by bigeye.rhein-neckar.de (8.9.3/8.9.3) id XAA21545; Sat, 18 Mar 2000 23:26:34 +0100 (CET) (envelope-from naddy) Message-Id: <200003182226.XAA21545@bigeye.rhein-neckar.de> Date: Sat, 18 Mar 2000 23:26:34 +0100 (CET) From: Christian Weisgerber Reply-To: naddy@mips.rhein-neckar.de To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/17479: bsd.port.mk: PARALLEL_BUILD Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 17479 >Category: ports >Synopsis: bsd.port.mk: PARALLEL_BUILD >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Mar 18 15:40:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Christian Weisgerber >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: SMP users and everybody else who uses make -jX. >Description: Some ports can be built with a parallel make (make -jX), some can't. Currently there is no way to know in advance whether a port can built in parallel. In particular for users with SMP machines, it would be highly desirable to be able to use "make -jX" for port building, including dependencies, and be certain that this just works. I propose to add a variable PARALLEL_BUILD to bsd.port.mk. If defined, no additional action is taken and "-jX" can be inherited. If PARALLEL_BUILD is *not* defined, a non-parallel make will be forced for the port. The simple patch provided below implements this. Since bsd.port.mk itself is parallel-clean, we only need to handle the cases where control passes to ${WRKSRC}/Makefile, i.e. the do-build and do-install targets. This also works for USE_GMAKE. Maintainers could then add PARALLEL_BUILD=yes to their ports if appropriate. Thoughts: * There are several ways to modify ${MAKEFLAGS}. Using the .MAKEFLAGS target seemed most straightforward to me. * With this patch the absence of PARALLEL_BUILD in a port can mean both that the port is not parallel-clean or that the maintainer didn't yet bother to check. An explicit PARALLEL_BUILD=YES, PARALLEL_BUILD=NO would be a better indicator but diverges from common practice for bsd.port.mk variables. >How-To-Repeat: >Fix: --- /usr/ports/Mk/bsd.port.mk Sun Mar 12 06:36:18 2000 +++ bsd.port.mk Sat Mar 18 19:43:39 2000 @@ -97,13 +97,17 @@ # BROKEN_ELF - Port doesn't build on ELF machines. # BROKEN - Port is broken. # -# This variable is a boolean, so you don't need to set it to the reason. +# These variables are booleans, so you don't need to set them to the reason. # # IS_INTERACTIVE - Set this if your port needs to interact with the user # during any step in a package build. User can then decide # to skip this port by setting ${BATCH}, or compiling only # the interactive ports by setting ${INTERACTIVE}. # +# PARALLEL_BUILD - The port can be built with several jobs running in +# parallel (make -j n). If this is not set, parallel mode +# will be disabled for the do-{build,install} targets. +# # Set these if your port only makes sense to certain archetictures. # They are lists containing names for them (e.g., "alpha i386"). # @@ -1704,6 +1708,9 @@ # Build .if !target(do-build) +.if !defined(PARALLEL_BUILD) +.MAKEFLAGS: -j 1 -B +.endif do-build: .if defined(USE_GMAKE) @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) @@ -1715,6 +1722,9 @@ # Install .if !target(do-install) +.if !defined(PARALLEL_BUILD) +.MAKEFLAGS: -j 1 -B +.endif do-install: .if defined(USE_GMAKE) @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message