[FFmpeg-devel] [PATCH] configure: Factor out some pkg-config hacks.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Jan 1 13:56:02 CET 2015


On 01.01.2015, at 12:49, Clément Bœsch <u at pkh.me> wrote:
> On Thu, Jan 01, 2015 at 12:43:52PM +0100, Reimar Döffinger wrote:
>> On 01.01.2015, at 12:04, Clément Bœsch <u at pkh.me> wrote:
>>> On Thu, Jan 01, 2015 at 11:40:25AM +0100, Reimar Döffinger wrote:
>>>> 
>>>> +enabled libx264           && use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode -lx264 &&
>>>>                             { check_cpp_condition x264.h "X264_BUILD >= 118" ||
>>>>                               die "ERROR: libx264 must be installed and version must be >= 0.118."; }
>>>> enabled libx265           && require_pkg_config x265 x265.h x265_encoder_encode &&
>>> 
>>> Does it work if there is also a version check?
>> 
>> It's just a cleanup of the code we have, which I hoped would be less controversial.
>> If pkg-config doesn't work it can't check against the .pc file version (which I think is what pkg-config does, which is not necessarily the same version as FFmpeg will actually compile against).
>> It "works" in sofar as it adds the necessary flags, which should be fine for advanced users that can figure out build errors on their own.
>> Everyone else definitly should be using pkg-config.
>> I don't think it should matter much at this point, but if you wonder where I am going with this: I'd want us to use pkg-config for everything, but with enough of a (basic! ok to fail in any more advanced cases) fallback that we do not have to continue the pkg-config or not discussion.
> 
> Sorry I think I wasn't clear. I'm wondering if it would still work with
> cases like require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h
> vsMotionDetectInit
> 
> ...where the version is specified in the name.

The fallback is never actually used from require_pkg_config (even though that might not be obvious), but only if you use use_pkg_config with an additional argument.
I.e. only if you changed your example to
> use_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit -lvidstab

Also the name isn't used in any way for the fallback.
Admittedly the messages might be a bit strange/misleading.
There is no auto-generation of the library name from the package name if you were thinking that.
I realized I probably have another bug though, the code I changed will no longer error out if the library is not detected.


More information about the ffmpeg-devel mailing list