From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:02:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4B6248E; Mon, 5 May 2014 22:02:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78AF9AF9; Mon, 5 May 2014 22:02:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45M2mF7093059; Mon, 5 May 2014 22:02:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45M2mFH093058; Mon, 5 May 2014 22:02:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405052202.s45M2mFH093058@svn.freebsd.org> From: Warner Losh Date: Mon, 5 May 2014 22:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265399 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:02:48 -0000 Author: imp Date: Mon May 5 22:02:48 2014 New Revision: 265399 URL: http://svnweb.freebsd.org/changeset/base/265399 Log: [1] Make WITHOUT_FOO alway trump WITH_FOO, regardless of the system default. This restores more of the historical expectations that were broken when we started disallowing both WITH_FOO and WITHOUT_FOO to be defined. [2] Document this new behavior, and improve the documentation in general here. Submitted by: sjg@ [1]. Modified: head/share/mk/bsd.mkopt.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Mon May 5 21:49:31 2014 (r265398) +++ head/share/mk/bsd.mkopt.mk Mon May 5 22:02:48 2014 (r265399) @@ -1,22 +1,34 @@ # # $FreeBSD$ # -# Generic mechanism to deal with WITH and WITHOUT options and turn them into MK_ options. +# Generic mechanism to deal with WITH and WITHOUT options and turn +# them into MK_ options. # +# For each option FOO in __DEFUALT_YES_OPTIONS, MK_FOO is set to +# "yes", unless WITHOUT_FOO is defined, in which case it is set to +# "no". +# +# For each option FOO in __DEFUALT_NO_OPTIONS, MK_FOO is set to "no", +# unless WITH_FOO is defined, in which case it is set to "yes". +# +# If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and +# MK_FOO is set to "no" regardless of which list it was in. +# +# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd +# after all this processing, allowing this file to be included +# multiple times with different lists. +# +# Users should generally define WITH_FOO or WITHOUT_FOO, but the build +# system should use MK_FOO={yes,no} when it needs to override the +# user's desires or default behavior. # -# For each option FOO that defaults to YES, MK_FOO is set to yes, unless WITHOUT_FOO -# is defined, in which case it is set to no. If both WITH_FOO and WITHOUT_FOO are -# defined, WITHOUT_FOO wins. The list of default yes options is contained in the -# __DEFAULT_YES_OPTIONS variable, which is undefined after expansion. -# -# For each option FOO that defaults to NO, MK_FOO is set to no, unless WITH_FOO -# is defined, in which case it is set to yes. If both WITH_FOO and WITHOUT_FOO are -# defined, WITH_FOO wins. The list of default no options is contained in the -# __DEFAULT_NO_OPTIONS variable, which is undefined after expansion. + +# +# MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} .if !defined(MK_${var}) -.if defined(WITHOUT_${var}) # IF both WITH and WITHOUT defined, WITHOUT wins. +.if defined(WITHOUT_${var}) # WITHOUT always wins MK_${var}:= no .else MK_${var}:= yes @@ -30,7 +42,7 @@ MK_${var}:= yes # .for var in ${__DEFAULT_NO_OPTIONS} .if !defined(MK_${var}) -.if defined(WITH_${var}) # If both WITH and WITHOUT defined, WITH wins +.if definfed(WITH_${var} && !defined(WITHOUT_${var}) # WITHOUT aways wins MK_${var}:= yes .else MK_${var}:= no