[FFmpeg-devel] [PATCH] Use pkgconfig for dirac libs

Måns Rullgård mans
Wed Oct 22 22:06:11 CEST 2008

"Ramiro Polla" <ramiro.polla at gmail.com> writes:

> On Wed, Oct 22, 2008 at 5:27 PM, M?ns Rullg?rd <mans at mansr.com> wrote:
>> "Ramiro Polla" <ramiro.polla at gmail.com> writes:
>>> On Wed, Oct 22, 2008 at 4:56 PM, M?ns Rullg?rd <mans at mansr.com> wrote:
>>>> Luca Barbato <lu_zero at gentoo.org> writes:
>>> [...]
>>>>> - cflags and ldflags needed to properly link to the package
>>>> In a proper installation, to use libfoo, one would typically pass
>>>> -lfoo to the linker.
>>> And in FFmpeg's case where we need -lz -lwhatever, how can that be
>>> communicated to the program that's using FFmpeg?
>>> Another example is x264 that might or might not need pthreads...
>> That's what documentation is for.
> Ok, the documentation says: "This library might depend on libz,
> libbz2, libfaac, libfaad, or any combination of those, and might
> depend on many more or many less in the future (or not)."
> What does the configure check look like and how do you add that to
> ldflags?

I admit that the dependencies of static libraries can be a problem.  I
still disagree that pkgconfig is anything resembling a solution.  A
much better solution would be to include a file listing the
dependencies *inside* the library archive.  The "ar" format used on
just about all systems allows arbitrary files to be included, and
linkers simply ignore files they do not recognise.  It would thus be a
simple matter to add support for such a dependency file to your
favourite linker, without worrying about breaking others (presumably
they would adopt the same feature if it became popular).

Anything that needs installation-specific CFLAGS to work is broken by
design.  The only thing you could *ever* need to tell the compiler is
where to find the headers, and relying on pkgconfig to supply this
merely transforms the problem into that of finding the pkgconfig file
for the library (and hope you found the right one), so it's turtles
all the way down.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list