Subject: Re: Inconsitency in using USE_*
To: None <tech-pkg@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 01/26/2002 14:45:03
[ On Sunday, January 27, 2002 at 00:55:14 (+0900), Takahiro Kambe wrote: ]
> Subject: Re: Inconsitency in using USE_*
>
> In message <20020126163820.A21009@flis.utech.lublin.pl>
> 	on Sat, 26 Jan 2002 16:38:20 +0100,
> 	Tomasz Luchowski <zuntum@netbsd.org> wrote:
> > > USE_X11BASE=		# defined
> > > 
> > > while others
> > > 
> > > USE_BUILDLINK_ONLY=	YES (or yes)
> > > 
> > > Which is preferred?
> > It doesn't really matter. I'd say use which you feel like.
> Personally, I like former.
> 
> But rather than above problem, I feel "YES" v.s. "yes" might give
> confusion.  OpenBSD introduces converting lower/upper case to macro
> value of make(1), but do we have case ignore comparision scheme?

Since all uses of the above examples are of the form ".if defined()" I
would suggest they should all take the first form.  Given these usages
the latter is misleading, at best.

In pkgsrc only MKCRYPTO allows "YES" or "yes":

	.  if !(${MKCRYPTO} == "YES" || ${MKCRYPTO} == yes)

Unfortunately that test does not match the way MKCRYPTO is used in
/usr/share/mk (which is perhaps the canonical definition of how it
should be used, and is certainly where it is first documented):

	.if defined(NOKERBEROS) || (${MKCRYPTO} == "no")

It would probably be a good idea to think about just using '1' and '0'
to declare settings in/for .mk files.  This would hopefully eliminate
all possibility of confusion (at least once it was uniformly
implemented).  It would also eliminate the issue of where & how a
variable gets defined and how it might be undefined when only ".if
defined()" is used to test it.

In any case if words are to be used for truth/false values then I would
strongly suggest they always use only all lowercase letters.

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>