diff options
author | imp <imp@FreeBSD.org> | 2014-05-05 22:02:48 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2014-05-05 22:02:48 +0000 |
commit | 8a7cae832363a9f7f8ffa8354b59f13eed8b9ad2 (patch) | |
tree | 5e186a6737b9dd762160b3acdc4d6ff5bc3aa718 /share | |
parent | 59ef450874e95a85592f8134d417aba22621beb9 (diff) | |
download | FreeBSD-src-8a7cae832363a9f7f8ffa8354b59f13eed8b9ad2.zip FreeBSD-src-8a7cae832363a9f7f8ffa8354b59f13eed8b9ad2.tar.gz |
[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].
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.mkopt.mk | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk index c084c7e..cba7249 100644 --- a/share/mk/bsd.mkopt.mk +++ b/share/mk/bsd.mkopt.mk @@ -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 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 in __DEFUALT_NO_OPTIONS, MK_FOO is set to "no", +# unless WITH_FOO is defined, in which case it is set to "yes". # -# 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. +# 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. +# + +# +# 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 |