Subject: Re: Compiling the system with different options.
To: Christos Zoulas <christos@zoulas.com>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-userlevel
Date: 11/16/2004 11:19:46
--Uw+RRa3pmtkgiNaD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Mon, Nov 15, 2004 at 05:49:12PM -0500, Christos Zoulas wrote:
| There was a recent PR mentioning that right now there are too many opti=
ons
| hard-coded in the Makefiles and we cannot easily turn them on and off.
| The example in the PR was -DINET6, but there are many more.
Such as?
INET6 is one of the few remaining ones to fix AFAICT.
| We also commonly specify libraries in the Makefiles as:
|=20
| .if ${USE_SKEY} !=3D "no"
| CPPFLAGS+=3D -DSKEY
| DPADD +=3D ${LIBSKEY}
| LDADD +=3D -lskey
| .endif
|=20
| I suggest that we change all this to be:
|=20
| CPPFLAGS +=3D ${CPPFLAGS_SKEY}
| DPADD +=3D ${DPADD_SKEY}
| LDADD +=3D ${LDADD_SKEY}
|=20
| This way we achieve the following:
|=20
| - the Makefiles become simplified; no more conditionals
| - the variable handling is symmetric; all variables are treated
| the same way.
| - we don't expose implementation specific information such as -lskey.
|=20
| All the magic is handled in bsd.own.mk. We can start with -DINET6 -DSKEY
| etc, which are low hanging fruit and I have a patch for them already,
| and then become more ambitious to fix the rest.
|=20
| What do you think?
I'm not convinced (yet): it doesn't scale well and may not save _that_
much effort given the number of special cases.
E.g, see USE_YP in usr.bin/passwd/Makefile, or the various different
ways that the KERBEROS{,5} knobs enable extra libraries and defines.
I also don't like the namespace pollution for applications.
At a minimum I think the CPPFLAGS_foo variable should instead be
CPPFLAGS_foo?=3D -D_USE_foo
I need to consider this more...
--Uw+RRa3pmtkgiNaD
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
iD8DBQFBmUeipBhtmn8zJHIRApgvAJ4oaF/p3ho+Wb++PxOWWa0jcwyzXACeO3K2
/saIaVYSXEkgQfOSK+1564k=
=2CBK
-----END PGP SIGNATURE-----
--Uw+RRa3pmtkgiNaD--