Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Oct 2012 10:52:06 -0700
From:      "Simon J. Gerraty" <sjg@juniper.net>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: bsd.own.mk - just let WITHOUT_* take precedence
Message-ID:  <20121008175206.5961858094@chaos.jnpr.net>
In-Reply-To: <20121008154853.GC23400@lor.one-eyed-alien.net>
References:  <20121007001423.9878F58094@chaos.jnpr.net> <20121008154853.GC23400@lor.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 8 Oct 2012 10:48:53 -0500, Brooks Davis writes:
>I'm not sure if I agree or not, I'll have to think more.  This sort of
>thing that leads to me yelling at my computer "but I @#%$@# set
>WITH_FOO you ^@$@! machine." :)

For default YES options, WITHOUT_ already takes precedence 
(ignoring the fact that you die first if both are set).
The main change is to make default NO options behave the same.

>I think we should at a minimum issue a warning and say what we did.

Sure, something like:

.warning both WITHOUT_${var} and WITH_${var} set; WITHOUT_${var} wins.

>The implementation looks mostly fine.  I do think it skips some options
>with variable defaults (LIBCXX in HEAD for example) so I think you'd need
>to sprinkle more of these changes in.

True, here's a more complte change:

Index: share/mk/bsd.own.mk
===================================================================
--- share/mk/bsd.own.mk	(revision 241871)
+++ share/mk/bsd.own.mk	(working copy)
@@ -469,7 +469,7 @@ __DEFAULT_NO_OPTIONS+=FDT
 #
 .for var in ${__DEFAULT_YES_OPTIONS}
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
-.error WITH_${var} and WITHOUT_${var} can't both be set.
+.warning both WITH_${var} and WITHOUT_${var} set; WITHOUT_${var} wins.
 .endif
 .if defined(MK_${var})
 .error MK_${var} can't be set by a user.
@@ -487,12 +487,12 @@ MK_${var}:=	yes
 #
 .for var in ${__DEFAULT_NO_OPTIONS}
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
-.error WITH_${var} and WITHOUT_${var} can't both be set.
+.warning both WITH_${var} and WITHOUT_${var} set; WITHOUT_${var} wins.
 .endif
 .if defined(MK_${var})
 .error MK_${var} can't be set by a user.
 .endif
-.if defined(WITH_${var})
+.if defined(WITH_${var}) && !defined(WITHOUT_${var})
 MK_${var}:=	yes
 .else
 MK_${var}:=	no
@@ -609,7 +609,7 @@ MK_CLANG_IS_CC:= no
     PAM \
     WIRELESS
 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
-.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
+.warning both WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT set; WITHOUT_${var}_SUPPORT wins.
 .endif
 .if defined(MK_${var}_SUPPORT)
 .error MK_${var}_SUPPORT can't be set by a user.
@@ -628,15 +628,15 @@ MK_${var}_SUPPORT:= yes
     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.
+.warning both WITH_${vv:H} and WITHOUT_${vv:H} set; WITHOUT_${vv:H} wins.
 .endif
 .if defined(MK_${vv:H})
 .error MK_${vv:H} can't be set by a user.
 .endif
-.if defined(WITH_${vv:H})
+.if defined(WITHOUT_${vv:H})
+MK_${vv:H}:=	no
+.elif defined(WITH_${vv:H})
 MK_${vv:H}:=	yes
-.elif defined(WITHOUT_${vv:H})
-MK_${vv:H}:=	no
 .else
 MK_${vv:H}:=	${MK_${vv:T}}
 .endif
@@ -649,7 +649,7 @@ MK_${vv:H}:=	${MK_${vv:T}}
 .for var in \
     LIBCPLUSPLUS
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
-.error WITH_${var} and WITHOUT_${var} can't both be set.
+.warning both WITH_${var} and WITHOUT_${var} set; WITHOUT_${var} wins.
 .endif
 .if defined(MK_${var})
 .error MK_${var} can't be set by a user.
@@ -661,7 +661,7 @@ MK_${var}:=	no
 MK_${var}:=	yes
 .endif
 .else
-.if defined(WITH_${var})
+.if defined(WITH_${var}) && !defined(WITHOUT_${var})
 MK_${var}:=	yes
 .else
 MK_${var}:=	no



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