From owner-freebsd-arch@FreeBSD.ORG Tue Apr 1 06:43:35 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF0713A9 for ; Tue, 1 Apr 2014 06:43:34 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8459B6BB for ; Tue, 1 Apr 2014 06:43:34 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id k14so6977442wgh.10 for ; Mon, 31 Mar 2014 23:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/DWIJhCHmV/+CpC6vdH7c7UtwpFlDMrRye0MzGbFU2Y=; b=ioYGFq2i8fcgmfg23NyMc7CUsGteGt3bKRy+JafyXOBmwlxZgL63DZscQ8GMykpm0V a2qsyBerujdkQiOLvTGxY7yHASZ9aUhcxRsGSl/hKOv07gBYjyDYGrbc7vFanxfi0PPR xHaAfFMf373f3gyABMNdjQmGsliozIqT2LKoY3lF/Etl7iCUENp7HwRprNuyDSX9wDKR 3E97dh1ccJme+qa7vvQiQttlgs88V7qyUJg4gKsOLf8SLevugR2EVaYK5NuWgN4VOM+R 894EnN05vT+SqUbUWwf9WFzMALwtnk3SzHdjgczpiFH9UKrNQ2kNi5hmdu/f9iOoX9WC cWEA== X-Received: by 10.180.109.107 with SMTP id hr11mr6728723wib.4.1396334612795; Mon, 31 Mar 2014 23:43:32 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id gz1sm31216304wib.14.2014.03.31.23.43.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Mar 2014 23:43:31 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 1 Apr 2014 08:43:16 +0200 From: Baptiste Daroussin To: Simon Gerraty Subject: Re: make WITH[OUT]_* more useful? Message-ID: <20140401064316.GQ99393@ivaldir.etoilebsd.net> References: <20140401051327.F20F958097@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9+VnUxDxRuy97YQ+" Content-Disposition: inline In-Reply-To: <20140401051327.F20F958097@chaos.jnpr.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 06:43:35 -0000 --9+VnUxDxRuy97YQ+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 31, 2014 at 10:13:27PM -0700, Simon Gerraty wrote: > I really like the idea of WITH[OUT]_* knobs translating to MK_* knobs, > but I find the current implementation much less useful than I think it > could be. Not the least of its problems is being implemented in > bsd.own.mk which ties policy and mechanism together. >=20 > It is not always (rarely) safe to include the in-tree bsd.own.mk which > means that in many cases you cannot rely on MK_* at all, but have to > re-implement the WITH_* vs WITHOUT_* logic repeatedly. >=20 > It is also generally bad to include bsd.own.mk from sys.mk, which means > any knobs you need early must re-implement the WITH_* vs WITHOUT_* logic > repeatedly. >=20 > contrib/bmake/mk/options.mk is an example of a more generic > implementation with (I think) some advantages. >=20 > The key semantic changes are (DOMINANT_* is from a newer version > than in contrib): >=20 > # NO_* takes precedence > # If both WITH_* and WITHOUT_* are defined, WITHOUT_ wins unless > # DOMINANT_* is set to "yes" > # Otherwise WITH_* and WITHOUT_* override the default. > and > MK_* can be pre-set without causing an error. >=20 > The key advantage is that the mechanism is separate from the policy. > You can thus have knobs that get set much earlier (eg during sys.mk) > and other knobs that get set later. Ie. both sys.mk and bsd.own.mk can > include options.mk to process options that they care about, allowing > MK_* to be used more consistently - you could use different prefix to > avoid overlap, but that's probably not necessary. >=20 > You can in fact have per-makefile option lists if you want (see > contrib/bmake/Makefile)=20 >=20 > Thoughts? I would be interested in having your opinion on what we did for ports. Basically we have in the end a variable: PORT_OPTIONS that contains the the options that are considered like "MK_*" =3D yes and all the one considerer = as are not it. one can activate variables via make.conf: OPTIONS_SET=3D OPT1 OPT2 OPTIONS_UNSET=3D OPT3 We added a couple of sugar so that options are not on yes/no but can be a selection in a list etc. Can be looked at here: http://svnweb.freebsd.org/ports/head/Mk/bsd.options.= mk Having it creating in the end the MK_* variables would be really realy easy. regards, Bapt --9+VnUxDxRuy97YQ+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlM6YAQACgkQ8kTtMUmk6EwqCwCcC19iLPOR3T7h+CxzzimZZ179 FDEAn3LXCkxynr91lPnVyRGhS9qtWIc3 =YKB2 -----END PGP SIGNATURE----- --9+VnUxDxRuy97YQ+--