mk: WITH_FOO=no now generates a warning

Many people are used to gnu configure's behavior of changing
--with-foo=no to --without-foo. At the same time, several folks have
WITH_FOO=no in their config files to enable this ironic form of the
option because of an old meme from IRC, a mailing list or the forums (I
forget which). Add a warning to allow to alert people w/o breaking POLA.

Reviewed by:		allanjude, bdrewery, manu
MFC After:		2 weeks
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30684
This commit is contained in:
Warner Losh 2021-06-09 18:10:12 -06:00
parent 597cc550e7
commit f4d987cd13

View File

@ -36,6 +36,9 @@
#
.for var in ${__DEFAULT_YES_OPTIONS}
.if !defined(MK_${var})
.if defined(WITH_${var}) && ${WITH_${var}} == "no"
.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no"
.endif
.if defined(WITHOUT_${var}) # WITHOUT always wins
MK_${var}:= no
.else
@ -54,6 +57,9 @@ MK_${var}:= yes
#
.for var in ${__DEFAULT_NO_OPTIONS}
.if !defined(MK_${var})
.if defined(WITH_${var}) && ${WITH_${var}} == "no"
.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no"
.endif
.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
MK_${var}:= yes
.else