Date: Tue, 27 Jun 2006 17:33:26 +0100 From: Florent Thoumie <flz@FreeBSD.org> To: Arseny Nasokin <tarc@tarc.po.cs.msu.su> Cc: freebsd-ports <freebsd-ports@freebsd.org> Subject: Re: HEADSUP: WITH and WITHOUT options knobs checking Message-ID: <1151426006.1116.18.camel@localhost> In-Reply-To: <20060627143756.GS32801@tarc.po.cs.msu.su> References: <20060627143756.GS32801@tarc.po.cs.msu.su>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-f4NJqSTWzBtjropBNtgu Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2006-06-27 at 18:37 +0400, Arseny Nasokin wrote: > It's wrong if you write in your Makefiles something about: > --------------%<---------------- > ... > OPTIONS=3D ABC "Enable abc feature" off=20 > ... > .include <bsd.port.pre.mk> > ... > .if defined (WITH_ABC) > # configure ABC feature > .endif > ... > .include <bsd.port.post.mk> > ------------->%----------------- >=20 > The main reason is that, ${OPTIONSFILE} included as is, and if you enable= ABC(as in example), you have in ${OPTIONSFILE} something about: > --------------%<---------------- > ... > WITH_ABC=3Dtrue > ... > ------------->%----------------- >=20 >=20 > Ok, and now some experiments. > If ABC is feature, that you want enable im many ports (for example, OPTIM= IZED_FLAGS or THREADS, or ESOUND/ESD.....) > you possibly want add it to your /etc/make.conf file. >=20 > cat WITH_ABC=3Dtrue >> /etc/make.conf=20 >=20 > than, you want compile port, without this feature. You do `make config' a= nd as result in your ${OPTIONSFILE} you have: > --------------%<---------------- > ... > WITHOUT_ABC=3Dtrue > ... > ------------->%----------------- >=20 > And now - compile... >=20 > when you type `make build' you have defined BOTH `WITH_ABC' and `WITHOUT_= ABC' knobs >=20 > and as you check _only_ WITH_ABC, this feature included. That's wrong!!! Please don't send such HEADS-UP before you made sure what you propose is correct. What we currently recommend is checking for non-default value. What you propose isn't good either since you just give priority to the default value. The right way to do things (IMHO) would be to mark the port as IGNORE if both WITH/WITHOUT are defined (as it is done in src/ now). > Please, check WITH_ knobs, as it: > .if defined (WITH_ABC) && ! defined(WITHOUT_ABC) I once proposed (I'm not claiming the paternity of the idea, just never heard/read about it before) to just remove WITH/WITHOUT_ prefix from WITH/WITHOUT_FOO and just go with FOO. I was told it wasn't the way we do things and that it's easier to check if a variable is set or not rather than checking its content. I still think this is the way to go. --=20 Florent Thoumie flz@FreeBSD.org FreeBSD Committer --=-f4NJqSTWzBtjropBNtgu Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQBEoV3WMxEkbVFH3PQRAtFtAJ9V9j3PPlhEbAlSRuHPTQTiJmAb3ACgiY4B jNZQTIL/GZggH0ln1M2M0FY= =wKhE -----END PGP SIGNATURE----- --=-f4NJqSTWzBtjropBNtgu--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1151426006.1116.18.camel>