From owner-freebsd-ports@FreeBSD.ORG Tue Jun 27 16:33:41 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F1B516A407 for ; Tue, 27 Jun 2006 16:33:41 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id E010243D53 for ; Tue, 27 Jun 2006 16:33:40 +0000 (GMT) (envelope-from flz@FreeBSD.org) Received: from smtp.xbsd.org (xbsd.org [82.233.2.192]) by smtp6-g19.free.fr (Postfix) with ESMTP id 67425224DB; Tue, 27 Jun 2006 18:33:39 +0200 (CEST) Received: from localhost (localhost.xbsd.org [127.0.0.1]) by smtp.xbsd.org (Postfix) with ESMTP id AD3711196E; Tue, 27 Jun 2006 18:33:38 +0200 (CEST) Received: from smtp.xbsd.org ([127.0.0.1]) by localhost (srv1.xbsd.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24326-03; Tue, 27 Jun 2006 18:33:32 +0200 (CEST) Received: from cream.stl.xbsd.org (unknown [193.120.13.130]) by smtp.xbsd.org (Postfix) with ESMTP id 38A2C11724; Tue, 27 Jun 2006 18:33:31 +0200 (CEST) From: Florent Thoumie To: Arseny Nasokin In-Reply-To: <20060627143756.GS32801@tarc.po.cs.msu.su> References: <20060627143756.GS32801@tarc.po.cs.msu.su> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-f4NJqSTWzBtjropBNtgu" Date: Tue, 27 Jun 2006 17:33:26 +0100 Message-Id: <1151426006.1116.18.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 FreeBSD GNOME Team Port X-Virus-Scanned: amavisd-new at xbsd.org Cc: freebsd-ports Subject: Re: HEADSUP: WITH and WITHOUT options knobs checking X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2006 16:33:41 -0000 --=-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 > ... > .if defined (WITH_ABC) > # configure ABC feature > .endif > ... > .include > ------------->%----------------- >=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--