bsd.own.mk - just let WITHOUT_* take precedence

Brooks Davis brooks at freebsd.org
Mon Oct 8 15:48:56 UTC 2012


On Sat, Oct 06, 2012 at 05:14:23PM -0700, Simon Gerraty wrote:
> After being bitten by:
> 
> make: "/b/sjg/work/fbsd-head/src/share/mk/bsd.own.mk" line 490: WITH_CTF
> and WITHOUT_CTF can't both be set.
> 
> I took a look at bsd.own.mk
> I'm not sure what's so evil about setting both WITH_ and WITHOUT_
> especially when bits of buildworld, buildkernel etc, set WITHOUT_
> (which triggers the problem for me).
> 
> All that seems necessary is a clear rule - "WITHOUT_ wins".
> Thus the patch below solve my problem.

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." :)

I think we should at a minimum issue a warning and say what we did.
It won't help a lot if the output is lost when running "make -j16
-DWITH_FOO buildworld", but at least we'll have told the user that their
make.conf or src.conf setting was why the feature they turned on didn't
work.

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.

-- Brooks

> 
> Index: share/mk/bsd.own.mk
> ===================================================================
> --- share/mk/bsd.own.mk	(revision 241871)
> +++ share/mk/bsd.own.mk	(working copy)
> @@ -468,9 +468,6 @@ __DEFAULT_NO_OPTIONS+=FDT
>  # 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})
>  .error MK_${var} can't be set by a user.
>  .endif
> @@ -486,13 +483,10 @@ 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})
>  .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
> _______________________________________________
> freebsd-arch at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch-unsubscribe at freebsd.org"
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20121008/7c24d3ec/attachment.pgp


More information about the freebsd-arch mailing list