[FFmpeg-devel] [PATCH] define private libs properly in pkgconfig files

Anssi Hannula anssi.hannula
Fri May 9 20:15:22 CEST 2008

Aurelien Jacobs wrote:
> Anssi Hannula wrote:
>> Aurelien Jacobs wrote:
>>> Anssi Hannula wrote:
>>>> j at v2v.cc wrote:
>>>>> On Thu, 2008-05-08 at 04:46 +0300, Anssi Hannula wrote:
>>>>>> If you are linking statically, you have to use '--static' option
>>>>>> of pkg-config. Then all libraries are printed.
>>>>> how can i do that with ?PKG_CHECK_MODULES?
>>>>> pkg-config does not seam to check or know if only static linking
>>>>> is possible. by default ffmpeg does not install shared libs.
>>>> Indeed, PKG_CHECK_MODULES does not know that.
>>> And thus, PKG_CHECK_MODULES have to be fixed to support static libs.
>>> (aren't you starting to feel the autotools ugliness ? ;-)
>>>> So I guess the way to make it behave correctly is indeed to not
>>>> make $name-uninstalled.pc use Libs.private and only make $name.pc
>>>> use Libs.private when the shared library is created.
>>> Current .pc files seems to be OK. The actual bug is in
>> Unfortunately AFAICS that would not be easy to fix.
> I probably fails to understand something (I don't know pkg-config
> very well). But the problem originally mentioned seems pretty easy
> to solve.
> PKG_CHECK_MODULES should use `pkg-config --libs`, then try to link
> a test program with this, and if it don't work, try again with
> `pkg-config --libs --static`.
> What problem did I missed ?
> Maybe it's not nice that `pkg-config --libs` don't work when only
> static libs are installed, but that shouldn't be a problem for

Well, I think `pkg-config --libs` should print the same that
PKG_CHECK_MODULES puts into _LDFLAGS, for consistency (which it does
now). Not all projects use autotools.
And I'm quite sure making 'pkg-config' from a pure .pc parser program to
a tool that links test programs is something that is not wanted by
pkgconfig people..

> But, now that I understand your patch a bit better, I think it may
> be OK, as long as `pkg-config --libs --static` still always work
> when static libs are installed.

It will.

Anssi Hannula

More information about the ffmpeg-devel mailing list