Revamp of kerberos5/ makefiles

Ruslan Ermilov ru at FreeBSD.org
Mon Jan 19 03:23:42 PST 2004


Mark Murray suggested that I leak this here in order to bikeshed
it enough before it meets the tree, so here it goes, for those
interested...

----- Forwarded message from Ruslan Ermilov <ru at FreeBSD.org> -----

Date: Thu, 15 Jan 2004 16:47:24 +0200
From: Ruslan Ermilov <ru at FreeBSD.org>
To: Mark Murray <markm at FreeBSD.org>,
	"Jacques A. Vidrine" <nectar at FreeBSD.org>
Cc: Bruce Evans <bde at FreeBSD.org>
Subject: Re: kerberos5/ makefiles revamp

On Wed, Jan 14, 2004 at 12:41:22AM +0200, Ruslan Ermilov wrote:
> I'd like to spend some time now to revamp the kerberos5/ build
> infrastructure [...]
> 
Attached is the functional diff (style changes omitted) to bring
kerberos5/ makefiles to a normal level, in my definition of
"normal".  ;)

It also accumulates the previous patch to fix dependencies in
the WITH_OPENLDAP case.

The commit log would look alongside this:

: Overhaul of kerberos5/ makefiles.  Most notable changes are:
: 
: - Dropped support for standalone builds, this was only partially
:   supported anyway, and required so much magic in makefiles that
:   made life dangerous (e.g., by using the custom yacc rules).
: 
: - Got rid of .OBJDIR in makefiles -- makes building of individual
:   files possible again.
: 
: - Made the .x.c transformations -j safe.
: 
: - Reprogrammed LDADD to fix static build of some utilities that
:   was broken.
: 
: - Removed redundant .h's from SRCS, only kept those that are
:   generated.
: 
: - libkrb5/ INCS were bogusly installed again with libgssapi/.
: 
: - Made build-tools real tools with their own makefiles in
:   separate directories.  This allows us to properly track
:   their dependencies, etc.
: 
: - Faster build, 21% less of makefile code!

What would probably meet some resistance is dropping support
for standalone builds, so let me explain it in a bit more
detail here (not in the commit log) why I think it should be
removed.

First, the definition.  The standalone build is an ability
to just type "make" from the top-level kerberos5/ directory,
and have everything built.

While the intent seems to be clever, the implementation was
only partial and too painful -- lot of trickery in makefiles
to pick up fresh headers and non-determinism (depending on
the order you make things, different headers may be used).

Most importantly, it just didn't work as coded, because to
build the non-lib/ portion of kerberos5/, you need to at
least have libraries installed, to link against them.  Just
to proof, an attempt to build the stock fresh kerberos5/ on
a 134 days old 5.1-CURRENT machine (9ball.rtp.FreeBSD.org)
fails because it attempts to link with an older Heimdal
library from /usr/lib:

===> libexec/kdc
kerberos4.o: In function `encode_v4_ticket':
kerberos4.o(.text+0x227): undefined reference to `_krb5_krb_time_to_life'
*** Error code 1

OTOH, dropping support for standalone builds doesn't mean
you can't build it manually, no.  It's still possible, just
requires a bit more than just typing "make".  Specifically,
you should just be following the "buildworld" way to build
things:

make obj (optional)
make depend (optional)
make includes				# build and install includes
(cd lib; make all; make install)	# build and install libraries
make all				# build everything else

We could even add this sequence to a top level kerberos5/Makefile,
as a convenience.  ;)

Comments, questions, reviews, suggestions (not about fixing
style at this time) are highly welcome!

Ah, and the last but not least: it has been intensively tested
on two UP and SMP machines, outside and within the buildworld,
for both native and another platform (TARGET_ARCH=sparc64),
with and without -j, and with and without "make depend" in the
non-buildworld mode.

Please note that before attempting to apply this patch you need
to create new src/kerberos5/tools/* directories from the patch
manually.  The patch is available from:

http://people.FreeBSD.org/~ru/patches/kerberos5-makefiles.patch

----- End forwarded message -----

-- 
Ruslan Ermilov
FreeBSD committer
ru at FreeBSD.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20040119/06ed28e3/attachment.bin


More information about the freebsd-arch mailing list