[FFmpeg-devel] [PATCH] Use pkgconfig for dirac libs
Wed Oct 22 20:56:00 CEST 2008
Luca Barbato <lu_zero at gentoo.org> writes:
> On 22-10-2008 19:43, Diego Biurrun wrote:
>> On Wed, Oct 22, 2008 at 11:21:51AM +0200, Luca Barbato wrote:
>>> On 22-10-2008 1:23, M?ns Rullg?rd wrote:
>>>> Use of pkgconfig is discouraged; it creates more problems than it
>>>> solves, especially when cross-compiling.
>>> How so?
>> Maybe you can start by answering the following questions:
>> What exactly is the "problem" pkg-config is out to solve?
> Have a low overhead, non timeconsuming way to get:
> - package presence and version
If it's not there, compilation will fail. No test needed. If the
library is optional, let the user disable it if he doesn't have it
installed. The user should be given the option to not use optional
libs, even if they are installed, so there's no extra work needed
> - 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. This is actually *easier* than trying to
keep up with the pkgconfig syntax of the month.
A library may of course allow its users some choices, and use
preprocessor definitions to select among them. The correct settings
for a particular user of the library can of course only be known by
the author of the using package, so pkgconfig cannot possibly help
> - checks for optional deps that may or may not trigger different behaviors.
I don't understand what that's supposed to mean.
>> How did people deal with those "problems" during the previous decades
>> without pkg-config?
> - using package specific foo-config giving in various ways the same
As I already said, that's a recent "invention".
> - using custom m4 macros to give the very same informations using
> various tricks
> - every time redo the various compile&run you may find in the custom m4
> and/or trying random egrep on headers.
You're thinking purely in terms of autohell-style configure scripts.
These scripts are, in fact, largely unnecessary.
> all of them are more time consuming than just having pkg-config and have
> just to produce a .pc file for your library...
All of the malpractices you mentioned are indeed time-consuming. That
does not in any way imply that something else must be done instead.
Indeed, doing nothing is a perfectly viable solution, and takes no
mans at mansr.com
More information about the ffmpeg-devel