Subject: Re: testing for USE_DESTDIR in a Makefile
To: None <tech-pkg@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-pkg
Date: 07/02/2007 08:22:53
On Sun, Jul 01, 2007 at 06:51:51PM +0200, Klaus Heinz wrote:
> as far as I can see in bsd.prefs.mk, there are two official values for
> USE_DESTDIR: "yes" and "full". USE_DESTDIR being unset or having any other
> value means the facility is switched off.

USE_DESTDIR always has a value and so does _USE_DESTDIR. The former is
the user-modificable switch, the latter what is actually used by the
infrastructure (e.g. after checking what the package supports and the
user desires).

> I just had a case where I needed to test whether USE_DESTDIR is
> (partially) on or off, so I would rather use

In a package or the infrastructure? In the latter case, please use
_USE_DESTDIR. It might be a good idea to do that in all cases. Indepent
of that, the variable is always set, so no need to check for defined.

Joerg