Subject: Problems with _DEPENDS_TARGET_OVERRIDE
To: None <tech-pkg@netbsd.org>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: tech-pkg
Date: 07/14/2000 04:24:28
This relates to pkg/9980.  When building ghostscript, the real-fetch
target looks approximately like:

	real-fetch: check-depends
	real-fetch: __PORT_USE

	__PORT_USE: .USE
		make build-depends

	check-depends:
		make build-depends _DEPENDS_TARGET_OVERRIDE=1

So "make real-fetch" runs the check-depends target first, then the
macro target __PORT_USE.  For the following:

	BUILD_DEPENDS=	${BUILD_ROOT}/graphics/jpeg/${WRKDIR:T}/jpeg-6b:../../graphics/jpeg:extract

the build-depends target will explode the expression on the right into
something like:

	prog="${BUILD_ROOT}/graphics/jpeg/${WRKDIR:T}/jpeg-6b"
	dir="../../graphics/jpeg"
	if [ ${_DEPENDS_TARGET_OVERRIDE}X != X ]; then
		target=${DEPENDS_TARGET}
	else
		target=extract
	fi

Since check-depends runs build-depends with_DEPENDS_TARGET_OVERRIDE=1,
we will ALWAYS ignore the "extract" target specified on the
BUILD_DEPENDS line.  On my machine, I have DEPENDS_TARGET=package in
/etc/mk.conf, so we ALWAYS try to package jpeg, even we just need to
extract it.

This is pretty obvious breakage.  Can anyone shed light on why
check-depends runs build-depends with _DEPENDS_TARGET_OVERRIDE=1?

     -- Johnny C. Lam <lamj@stat.cmu.edu>
        Department of Statistics, Carnegie Mellon University
        http://www.stat.cmu.edu/~lamj/