[20478] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Adding external library dependencies to .pc files for static linking

daemon@ATHENA.MIT.EDU (Wolfgang Walther)
Thu Feb 29 00:28:11 2024

Content-Type: multipart/mixed; boundary="------------6YGeyiiIRqNdNGvTT1ZkVZ0u"
Message-ID: <6c809c13-ae2d-4e6e-ace5-d2862912648c@technowledgy.de>
Date: Wed, 28 Feb 2024 19:09:35 +0100
MIME-Version: 1.0
Content-Language: en-US
From: Wolfgang Walther <walther@technowledgy.de>
To: krbdev@mit.edu
Errors-To: krbdev-bounces@mit.edu

This is a multi-part message in MIME format.
--------------6YGeyiiIRqNdNGvTT1ZkVZ0u
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

When building static krb5 libraries --with-keyutils, mit-krb5.pc will 
not contain any references to keyutils. This makes linking statically 
against krb5 fail when relying on pkg-config to provide the linker flags.

A related issue was discussed in [1] but back then, there was no 
pkg-config support to start with. Also, in krb5-config.in there is this 
comment:

     # If we ever support a flag to generate output suitable for static
     # linking, we would output "-lkrb5support $GEN_LIB $LIBS $DL_LIB"
     # here.

Because keyutils does not ship pkg-config files itself, the right place 
to add those is Libs.private. From [2]:

> My library z uses libx internally, but does not expose libx data types in its public API. What do I put in my z.pc file?
> 
> Again, add the module to Requires.private if it supports pkg-config. [...] If libx does not support pkg-config, add the necessary linker flags to Libs.private.

Thus, I came up with the attached.

This fixes my downstream build, but it also does so when I only add 
@LIBS@ and not the other two. I can't really tell whether adding those 3 
is still correct/sufficient in the general case, given that the comment 
above is 13 years old.

Best,

Wolfgang

[1]: https://krbdev.mit.edu/rt/Ticket/Display.html?id=3887
[2]: https://people.freedesktop.org/~dbn/pkg-config-guide.html
--------------6YGeyiiIRqNdNGvTT1ZkVZ0u
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-Add-external-library-dependencies-to-pkg-config-s-Li.patch"
Content-Disposition: attachment;
 filename*0="0001-Add-external-library-dependencies-to-pkg-config-s-Li.pa";
 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JAIEBMSUJTQCBARExfTElCQAotLSAKMi40NC4wCgo=

--------------6YGeyiiIRqNdNGvTT1ZkVZ0u
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

--------------6YGeyiiIRqNdNGvTT1ZkVZ0u--

home help back first fref pref prev next nref lref last post