Date: Sun, 2 Jan 2005 22:20:37 +1100 From: Edwin Groothuis <edwin@mavetju.org> To: Kris Kennaway <kris@obsecurity.org> Cc: Xin LI <delphij@frontfree.net> Subject: Re: cvs commit: ports/mail/postfix-gps Makefile Message-ID: <20050102112037.GE1436@k7.mavetju> In-Reply-To: <20050102071849.GA31292@xor.obsecurity.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050102112037.GE1436>