pkg-config and library dependencies

Alexander Leidinger Alexander at
Sat Dec 22 09:26:31 PST 2007

Quoting Ed Schouten <ed at> (Sat, 22 Dec 2007 13:21:49 +0100):

> It turns out that my configure script added some unneeded -lfoo's, so I
> removed those, but there were still a lot of libraries that got added by
> pkg-config and friends. It turns out that a lot of those .pc's add
> rubbish:
> The last case is even worse. Your application will link directly against
> libthr if your use libgthread, voiding the entire idea of abstracting
> the threads library. I guess the reason they were added, is keep things
> working when compiling static binaries, because you can't recursively
> pull dependencies in that case, but that is a wrong argument, because
> you can then add the libraries to Libs.private and use
> `pkg-config --static'.

The problem is even deeper. libtool does not enable the "OS has
recursive resolver" knob on most systems. Debian has a custom patch.
The problem is, that in some cases this doesn't work. I can't remember
them, but have a look at the libtool archive, I asked there about the
problem. libtool-2 is AFAIR supposed to fix the problems.

I also asked the gome maintainers if they are interested in patches to
their libs which fix the issues you mentioned. The outcome is (and I
agree with them), that patches should go to the authors of the
problematic software first, and come into FreeBSD via regular updates
of the software in question.

I also have some patches regarding this, but they are outdated (and
just a proof of concept, as I wanted to play around with this first),
since I haven't updated to the new / GNOME yet. You can find
patches at, feel free to
take some and play around with them.

I would like to see that "the right thing" is done in the software
which is ported, so if someone wants to give this a high priority on
his TODO list, count me in for some help (as time permits).


Ferengi Rule of Acquisition #16:
	 A deal is a deal... until a better one comes along.
		-- ST:DS9, "Melora"  Alexander @ PGP ID = B0063FE7     netchild @  : PGP ID = 72077137

More information about the freebsd-ports mailing list