Page MenuHomeFreeBSD

krb5: Add build plumbing
Needs ReviewPublic

Authored by cy on Thu, Jun 5, 4:36 AM.
Tags
None
Referenced Files
F120123724: D50695.id156621.diff
Sun, Jun 15, 7:39 AM
F120101747: D50695.id156804.diff
Sun, Jun 15, 2:46 AM
F120072864: D50695.id156702.diff
Sat, Jun 14, 7:37 PM
Unknown Object (File)
Sat, Jun 14, 2:44 PM
Unknown Object (File)
Sat, Jun 14, 2:10 AM
Unknown Object (File)
Thu, Jun 12, 10:10 PM
Unknown Object (File)
Wed, Jun 11, 5:37 PM
Unknown Object (File)
Wed, Jun 11, 12:57 PM
Subscribers

Details

Summary

Add tne necessary Makefiles and header files to facilitate building
MIT KRB5 as part of buildworld. Nothing will build until the
WITH_MITKRB5/MK_MITKRB5 option has been plumbed in Makefile.inc1.

Before any changes to Makefile.inc1 are made to enable MIT KRB5,
additional commits to other affected software will need to be committed.

krb5/Makefile was inspired by kerberos5/Makefile. The Makefiles in
krb5/util and krb5/lib were inspired by those in lib/libc and in
lib/ncurses.

Sponsored by: The FreeBSD Foundation

This group of patches is not enough to build MIT KRB5 within buildworld. Additional patches to openssh, pam_krb5, and other components are also needed. These will be submitted through other reviews.

Test Plan

Currently running here.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

cy requested review of this revision.Thu, Jun 5, 4:36 AM

Much of this work seems to be cribbed from kerberos5/* which is fine, but should be acknowledged. Many of the copyright blocks are obviously unjustified. For example krb5/Makefile is maybe 2 lines different from kerberos5/Makefile.

krb5/Makefile
22

Why do these targets exist? I see they exist in src/kerberos, but they seem quite sketchy so why bring them along.

Much of this work seems to be cribbed from kerberos5/* which is fine, but should be acknowledged. Many of the copyright blocks are obviously unjustified. For example krb5/Makefile is maybe 2 lines different from kerberos5/Makefile.

Some of the initial work was cribbed from lib/libc, lib/ncurses, and kerberos5. After that it evolved to what it is now.

krb5/Makefile is very similar to kerberos5/Makefile. Other Makefiles were inspired by libc and ncurses.

There was some discussion whether Makefiles should have copyright blocks. Those can be removed. What do people think?

krb5/Makefile
17

All this and below is extraneous. I had copied this in to maintain a mental note. Te rest of this file has been removed.

22

Good catch. These were copied from kerberos5/Makefile when the project started a year ago. I had not intended on using them.

Thank you for catching this.

I should attribute this Makefile to the kerberos5 Makefile. The other makefiles in krb5/util and krb5/lib were inspired by libc and ncurses.

Remove extraneous code from krb5/Makefile. It was originally copied from kerberos5/Makefile, while Makefiles in krb5/util and krb5/lib were inspired by those in lib/libc and lib/ncurses.

I can remove the copyright attribution if this is desired.

The new commit message will look like:

Add tne necessary Makefiles and header files to facilitate building
MIT KRB5 as part of buildworld. Nothing will build until the
WITH_MITKRB5/MK_MITKRB5 option has been plumbed in Makefile.inc1.

Before any changes to Makefile.inc1 are made to enable MIT KRB5,
additional commits to other affected software will need to be committed.

krb5/Makefile was inspired by kerberos5/Makefile. The Makefiles in
krb5/util and krb5/lib were inspired by those in lib/libc and in
lib/ncurses.

Sponsored by: The FreeBSD Foundation

Removed top level Makefile attribution.

Re-add missing .include.

Wow, this is a big lift!

A bunch of small comments. Some are local (typos, etc), quite a few are broad issues and I just commented on an arbitrary instance of the issue.

krb5/Makefile.et
13

There is no reason to use classic make syntax.

krb5/Makefile.inc
13–14

AFACT this does nothing, we just have it in a number of legacy makefiles. I've posted D50704 to remove the other cases.

31–51

Surely none of this is needed

53

Yikes!

krb5/README
14

Is this the right date?

krb5/include/Makefile
15

Shouldn't be necessary as bsd.prog.mk pulls it it. There are a whole bunch of these I've not commented on.

38

Why is this not in CLEANFILES?

krb5/include/gssrpc/types.h
2

Maybe to ignore for now, but this file seems to be pointless compat for ancient systems.

krb5/include/krb5/Makefile
12

No opts are being used. There a a bunch of these.

krb5/lib/Makefile
11

style: line is quite long

krb5/lib/apputils/Makefile
20

I think this is the default value?

29

-I. is surprising. There don't seem to be any generated headers.

krb5/lib/crypto/Makefile
51

Forcing -fPIC seems surprising.

krb5/lib/crypto/builtin/Makefile.inc
11–16

Feels like a WIP not something to commit

krb5/lib/crypto/builtin/enc_provider/Makefile.inc
15
17–18

This will always rebuild. Shouldn't it depend on rc4.c instead? md5 etc don't do this.

krb5/lib/crypto/openssl/enc_provider/Makefile.inc
19

Will always rebuild

krb5/lib/kadm5srv/Makefile
107

A whole bunch of files have .SUFFIXES but no suffix rules. Not sure what's going on.

krb5/lib/krb5/Makefile
70–74

If these rules are used then there need to be CLEANFILES entries.

krb5/libexec/kdc/Makefile
79

???

krb5/usr.bin/kadmin/Makefile
32–35

Won't the SUFFIX rules take care of this?

krb5/usr.bin/kpasswd/Makefile
25–26

Duplicate

krb5/usr.bin/sclient/Makefile
32–33

Could all these SUFFIX rules live in a Makefile.inc?

krb5/usr.sbin/kadmin.local/Makefile
20

No rule?

krb5/usr.sbin/kdb5_util/Makefile
37–38

duplicate

51–55

It feels like these should live in a shell script that uses a temp directory rather than churning in .OBJDIR

krb5/util/compile_et/Makefile
29

Should these be hardcoded paths?

cy marked 6 inline comments as done.Fri, Jun 6, 12:53 PM

brooks@,

Thank you very much for such a detailed review. I believe I've addressed everything and will upload a new patch shortly. Your patience is greatly appreciated.

krb5/Makefile.et
13

Thanks. All instances have been standardized to new syntax.

krb5/Makefile.inc
13–14

Removed.

31–51

They've been removed and Makefiles simplified.

53

Yes, it needs this. Tested with others. Plus, the upstream tarball doesn't do much more either.

krb5/README
14

This is when I wrote it. The FF didn't get involved until a couple of months ago. I could update the date to more recent.

krb5/include/Makefile
38

I missed that one.

Thank you for spotting this.

krb5/lib/apputils/Makefile
20

Removed.

krb5/lib/crypto/builtin/enc_provider/Makefile.inc
15

Oops.

cy marked 6 inline comments as done.

I've addressed all of brooks@'s issues. This has been a huge project that has been on my plate for a while, until The Foundation stepped in to light a fire under me. Thank you so very much to brooks@.

krb5/lib/Makefile
7

Typo, sofware, seems to be copy-pasted throughout.

krb5/util/ss/Makefile
49
59

Does "." get used as the current directory? I think it should use ${.CURDIR} instead so that it's easier to see what's happening when reading build logs.

We tend to use ${.TARGET} instead of $@ in system makefiles.

(These comments apply to several makefiles, not just this one.)

cy marked 2 inline comments as done.Mon, Jun 9, 5:39 AM

All instances of legacy $>, $*. and $@ have been replaced by ${.ALLSRC}, ${.PREFIX}, and ${.TARGET} respectively. -I. has been replaced by -I${.CURDIR} and -I.. has been replaced by ${.CURDIR:H}. I will test build and install before uploading a new patch.

krb5/util/ss/Makefile
59

Yes. That argument is a directory. In this case current directory. I will make this change.

cy marked an inline comment as done.Mon, Jun 9, 5:45 AM

Test build failed. Not all -I. and -I.. can be replaced with -I${.CURDIR} or -I${.CURDIR:H}. Some had to be replaced with ${.OBJDIR}. This suggests that -I. is both, i.e. -I${.CURDIR} -I{.OBJDIR}. Using .CURDIR and .OBJDIR explicitly limits the scope to one or the other, which is better.

Replace legacy make variables with current ones. Note that some -I. were replaced with -I${.CURDIR} while others -I${.OBJDIR}.

Updated patch based on a comment by markj@ in another review.