[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].
This commit is contained in:
imp 2014-05-05 22:02:48 +00:00
parent 59ef450874
commit 8a7cae8323

View File

@ -1,22 +1,34 @@
# #
# $FreeBSD$ # $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 that defaults to YES, MK_FOO is set to yes, unless WITHOUT_FOO # For each option FOO in __DEFUALT_NO_OPTIONS, MK_FOO is set to "no",
# is defined, in which case it is set to no. If both WITH_FOO and WITHOUT_FOO are # unless WITH_FOO is defined, in which case it is set to "yes".
# 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 # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
# is defined, in which case it is set to yes. If both WITH_FOO and WITHOUT_FOO are # MK_FOO is set to "no" regardless of which list it was in.
# defined, WITH_FOO wins. The list of default no options is contained in the #
# __DEFAULT_NO_OPTIONS variable, which is undefined after expansion. # 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.
#
#
# MK_* options which default to "yes".
# #
.for var in ${__DEFAULT_YES_OPTIONS} .for var in ${__DEFAULT_YES_OPTIONS}
.if !defined(MK_${var}) .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 MK_${var}:= no
.else .else
MK_${var}:= yes MK_${var}:= yes
@ -30,7 +42,7 @@ MK_${var}:= yes
# #
.for var in ${__DEFAULT_NO_OPTIONS} .for var in ${__DEFAULT_NO_OPTIONS}
.if !defined(MK_${var}) .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 MK_${var}:= yes
.else .else
MK_${var}:= no MK_${var}:= no