Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2014 22:02:48 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265399 - head/share/mk
Message-ID:  <201405052202.s45M2mFH093058@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405052202.s45M2mFH093058>