[PATCH] Make krb5-config suppress CFLAGS output and omit extra libraries when called with --libs

Greg Hudson ghudson at MIT.EDU
Mon Sep 26 11:17:17 EDT 2011

On Mon, 2011-09-26 at 09:33 -0400, Stéphane Gaudreault wrote:
> 1) Make krb5-config suppress CFLAGS output when called with --libs

I agree with this, after looking over the krb5-config version history.
(Basically, when $(CFLAGS) was added to CC_LINK, a change was made to
substitute $(CFLAGS) with $CFLAGS in krb5-config, but there's no
corresponding definition of CFLAGS earlier in the file as there are for
other variables.  Since I don't think we want to put things like -O2 in
the krb5-config --libs output, we should prune $(CFLAGS) altogether.

> 2) Omit extra libraries because their interfaces are not exposed to
> applications by libkrb5.
> With patched krb5-config, setting do_deps to 1 indicates that the caller wants 
> the whole list.

This is more complicated.  First, is do_deps an established convention?
pkg-config uses the --static flag to decide whether to output dependency
libraries (on the theory that you need them for static linking but not
shared linking).

Second, we already omit -lkrb5support from the displayed list to avoid
creating external dependencies on an internal library.  To properly
support do_deps or --static, we'd have to add -lkrb5support back in.

Third, the provided patch only omits external dependencies, not internal
ones (or com_err).  An app using only GSSAPI functions should depend
only on libgssapi_krb5, not on libkrb5 and libk5crypto.  However, it's
likely that apps have come to expect the current behavior--especially as
we don't appear to properly support things like "krb5-config --libs
gssapi krb5".  So, this problem may be intractable.

For the moment, I will commit the CFLAGS change and the removal of
external deps from --libs krb5, without any support for do_deps.

More information about the krbdev mailing list