From owner-cvs-all@FreeBSD.ORG Sun Jan 2 11:20:42 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E2D416A4CE; Sun, 2 Jan 2005 11:20:42 +0000 (GMT) Received: from mail2out.barnet.com.au (mail2out.barnet.com.au [202.83.176.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 510D843D2D; Sun, 2 Jan 2005 11:20:41 +0000 (GMT) (envelope-from edwin@mavetju.org) Received: by mail2out.barnet.com.au (Postfix, from userid 27) id C9798707428; Sun, 2 Jan 2005 22:20:39 +1100 (EST) X-Viruscan-Id: <41D7D907000144D2CEE7C1@BarNet> Received: from mail2-auth.barnet.com.au (mail2.barnet.com.au [202.83.176.13]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Authority" (verified OK)) by mail2.barnet.com.au (Postfix) with ESMTP id 6FA98707426; Sun, 2 Jan 2005 22:20:39 +1100 (EST) Received: from k7.mavetju (edwin-3.int.barnet.com.au [10.10.12.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Certificate Authority" (verified OK)) by mail2-auth.barnet.com.au (Postfix) with ESMTP id 90F357073CE; Sun, 2 Jan 2005 22:20:38 +1100 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 555C060EA; Sun, 2 Jan 2005 22:20:37 +1100 (EST) Date: Sun, 2 Jan 2005 22:20:37 +1100 From: Edwin Groothuis To: Kris Kennaway Message-ID: <20050102112037.GE1436@k7.mavetju> References: <200501020116.j021GBqD070105@repoman.freebsd.org> <20050102064857.GA4047@frontfree.net> <20050102065949.GB6250@xor.obsecurity.org> <20050102070800.GA106@frontfree.net> <20050102071136.GD1436@k7.mavetju> <20050102071849.GA31292@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050102071849.GA31292@xor.obsecurity.org> User-Agent: Mutt/1.5.6i cc: cvs-ports@FreeBSD.org cc: ports-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Xin LI Subject: Re: cvs commit: ports/mail/postfix-gps Makefile X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2005 11:20:42 -0000 On Sat, Jan 01, 2005 at 11:18:49PM -0800, Kris Kennaway wrote: > On Sun, Jan 02, 2005 at 06:11:36PM +1100, Edwin Groothuis wrote: > > On Sun, Jan 02, 2005 at 03:08:00PM +0800, Xin LI wrote: > > > I think a better way is to have bsd.port.mk to set WITH_FOO or WITHOUT_FOO > > > according to the defaults set in individual ports' Makefile. It seems that > > > bsd.port.mk will ignore OPTIONS when doing package builds. > > > > They did this on purpose, see the part of bsd.port.mk which starts with: > > ################################################################ > > # > > # Do preliminary work to detect if we need to run the config > > # target or not. > > # > > ################################################################ > > > > I am totally on your side with this, bsd.port.mk should set the > > default WITH_ and WITHOUT_s. > > The problem is that INDEX builds also need to set this or the > dependency list will be all wrong. Doing this the obvious way gives a > huge slowdown. What are the obvious ways? This is what I made in a galaxy far far away when I still had the hope I could change the world. What is does is when PACKAGE_BUILDING is defined it sets the default WITH_ and WITHOUT_ values are being set. For databases/libdbi-drivers, it gives me: $ PACKAGE_BUILDING=1 make all-depends-list /usr/ports/converters/libiconv /usr/ports/databases/libdbi /usr/ports/databases/mysql40-client /usr/ports/databases/postgresql7 /usr/ports/devel/gettext /usr/ports/devel/gmake /usr/ports/devel/libtool13 /usr/ports/devel/libtool15 /usr/ports/lang/perl5 /usr/ports/security/openssl This can be used immediately (...) on the pointyhat building cluster. I don't know what variables are set when the "make index" is set, but I take it that on the building cluster PACKAGE_BUILDING would be set too. --- /home/edwin/cvs/ports/Mk/bsd.port.mk Sun Jan 2 18:42:08 2005 +++ bsd.port.mk Sun Jan 2 22:14:56 2005 @@ -1044,15 +1044,42 @@ .else UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME} .endif + +# Options infrastructure definitions OPTIONSFILE?= ${PORT_DBDIR}/${UNIQUENAME}/options _OPTIONSFILE!= ${ECHO_CMD} "${OPTIONSFILE}" .if defined(OPTIONS) -.if exists(${_OPTIONSFILE}) && !make(rmconfig) -.include "${_OPTIONSFILE}" -.endif -.if exists(${_OPTIONSFILE}.local) -.include "${_OPTIONSFILE}.local" -.endif +. if defined(PACKAGE_BUILDING) +. if defined(OPTIONS) +REALOPTIONS=${OPTIONS:C/".*"//g} +. for O in ${REALOPTIONS} +RO:=${O} +. if ${RO:L} == off +WITHOUT:= ${WITHOUT} ${OPT} +. endif +. if ${RO:L} == on +WITH:= ${WITH} ${OPT} +. endif +OPT:=${RO} +. endfor +. endif +. for W in ${WITH} +WITH_${W}:= true +. endfor +. for W in ${WITHOUT} +WITHOUT_${W}:= true +. endfor +. undef WITH +. undef WITHOUT +. undef RO +. undef REALOPTIONS +. endif +. if exists(${_OPTIONSFILE}) && !make(rmconfig) +. include "${_OPTIONSFILE}" +. endif +. if exists(${_OPTIONSFILE}.local) +. include "${_OPTIONSFILE}.local" +. endif .endif # check for old, crufty, makefile types, part 1: Should I send-pr it? -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/