From 4f9fa02d54f5c46f3bf9bbd93b27234ead265d5e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 18 Apr 2014 17:04:18 +0000 Subject: [PATCH] Allow setting of MK_FOO by anybody. There are too many edge cases that we're preventing now with this policy. However, these edge cases should be rare and all that set MK_FOO directly. WITH_FOO and WITHOUT_FOO both being defined now result in the non-default behavior happening silently. Users needing determinism here fall into the edge case exception for MK_FOO setting. --- share/mk/bsd.opts.mk | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 3c285c67bdeb..30ef7e055d02 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -247,14 +247,7 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP # MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else +.if !defined(MK_${var}) .if defined(WITHOUT_${var}) MK_${var}:= no .else @@ -268,14 +261,7 @@ MK_${var}:= yes # MK_* options which default to "no". # .for var in ${__DEFAULT_NO_OPTIONS} -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else +.if !defined(MK_${var}) .if defined(WITH_${var}) MK_${var}:= yes .else @@ -397,12 +383,6 @@ MK_CLANG_FULL:= no NETGRAPH \ PAM \ WIRELESS -.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) -.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. -.endif -.if defined(MK_${var}_SUPPORT) -.error MK_${var}_SUPPORT can't be set by a user. -.endif .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" MK_${var}_SUPPORT:= no .else @@ -416,12 +396,6 @@ MK_${var}_SUPPORT:= yes .for vv in \ GSSAPI/KERBEROS \ MAN_UTILS/MAN -.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) -.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. -.endif -.if defined(MK_${vv:H}) -.error MK_${vv:H} can't be set by a user. -.endif .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) @@ -437,14 +411,7 @@ MK_${vv:H}:= ${MK_${vv:T}} .include .for var in \ LIBCPLUSPLUS -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else +.if !defined(MK_${var}) .if ${COMPILER_FEATURES:Mc++11} .if defined(WITHOUT_${var}) MK_${var}:= no