[gnutls-dev] pkg-config file for libgnutls

Andreas Metzler ametzler at downhill.at.eu.org
Thu Feb 15 20:48:11 CET 2007


On 2007-02-14 Pavlov Konstantin <thresh at altlinux.ru> wrote:
> I noticed that my libgnutls-devel package doesn't depend on libtasn1-devel
> one.

Nudge the packager kindly.

> Looks like this is due to that line in .pc file:

I do not think so, setting a development package's dependencies is
usually done semi-manually.

> Libs.private: -L/usr/lib -lgnutls -ltasn1  -lgcrypt -lgpg-error

> Shouldnt it be Libs: -L${libdir} @LIBGNUTLS_LIBS@ instead?

No, absolutely not.

There are archs that require direct linking of dependent libaries
i.e. if your program is using gnutls_init() you'll need to build it by
using

cc  -L/usr/lib -lgnutls -ltasn1  -lgcrypt -lgpg-error foo.c

since libgnutsls itself is linked against libtasn.

However other archs (for example Linux) do not require it, if you
are just using functions from gnutls.h *directly* but none from
libtasn linking against libtasn is not needed and

cc  -L/usr/lib -lgnutls foo.c

will be the right thing to do.

The point of pkg-config is to centralize the knowledge about archs
needing additional linking and which do not, "pkg-config --libs
gnutls" will list the additional dependencies (that is the stuff in
Libs.private) if it is necessary for that arch and won't do otherwise.

(All the above holds for dynamic linking, static linking requires
different stuff, "pkg-config --libs --static"  will help you for
that.)

> Without libtasn1-devel installed, macro AM_PATH_LIBGNUTLS doesnt work.

That is beyond pkg-config's domain.
cu andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'




More information about the Gnutls-devel mailing list