Subject: mk.conf & PKGNAME/PKGBASE
To: None <tech-pkg@netbsd.org>
From: David Brownlee <abs@NetBSD.org>
List: tech-pkg
Date: 09/20/2005 12:04:45
 	There is currently no way for mk.conf to know the package that
 	is currently building, as there is no guarantee that PKGNAME or
 	PKGBASE are set by that point. cpuflags' optimize_gcc.mk needs
 	to know the PKGBASE to determine which flags to exclude from a
 	build, and it does so by trying to look at PKGBASE, PKGNAME,
 	and DISTNAME, but since packages are free to change PKGNAME after
 	mk.conf has been included this cannot work all the time.

 	Some suggestions:

 	1) Mandate that PKGNAME & PKGBASE must be set before including
 	   mk.conf (potentially even add some code to store them away
 	   just before including mk.conf and a line to test they have
 	   not subsequently been changed in the 'build' target)

 	2) If mk.conf sets an appropriate variable then include it
 	   again later to after PKGBASE has definitely been set

 	3) Add another config file included at the right point

 	4) Live with the brokenness.

 	I'm inclined towards 1)
-- 
 		David/absolute       -- www.NetBSD.org: No hype required --