Subject: Re: mk.conf & PKGNAME/PKGBASE
To: David Brownlee <abs@NetBSD.org>
From: Quentin Garnier <cube@cubidou.net>
List: tech-pkg
Date: 09/20/2005 13:33:03
--CYbV4jyGkzCEppMb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Sep 20, 2005 at 12:04:45PM +0100, David Brownlee wrote:
> 	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.
>=20
> 	Some suggestions:
>=20
> 	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)
>=20
> 	2) If mk.conf sets an appropriate variable then include it
> 	   again later to after PKGBASE has definitely been set
>=20
> 	3) Add another config file included at the right point
>=20
> 	4) Live with the brokenness.
>=20
> 	I'm inclined towards 1)

How can 1. be possible?  Consider the python packages.  You might
select a precise version of Python in mk.conf, therefore the final name
of the python module/application package can't be known until the
actual python version used is defined.

Can't you use .CURDIR?

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--CYbV4jyGkzCEppMb
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQy/zb9goQloHrPnoAQI1/Qf+MgbByUk5SN2SIKy6gwPRhqHnQ4ZDSQs2
pGazqrDyLI5H4NwXcYPyk3YxFh9YIilP8SXybHUazwIvIdBJONLMZvoGRL3CB40d
tNpoK2SYm2L/1f6eLcwA+PTnerlIXzT10nXAr37LO2RTuiDN9zofdGVallObT0jm
g2frI4+uHGaLvT6KbAOaEeCY8ahJl0CMV63hxbUaObZ8yAQ5SoFTukJHjcay7O1j
7ZGjh2RwlVP6ZanUDINMSQBxlX8pnjixuVEDy2BmltRsTeHytb5cSpSZp6xpE0Cm
vdG28xgBHkkA7muqKmQFLXten6TKEUVZYKfvX699NGdfL0dL0U9Zrg==
=kUj/
-----END PGP SIGNATURE-----

--CYbV4jyGkzCEppMb--