[FFmpeg-devel] [PATCH]Do not require pkg-config for libx265

Carl Eugen Hoyos cehoyos at ag.or.at
Mon May 26 11:46:43 CEST 2014


On Monday 26 May 2014 11:02:32 am Clément Bœsch wrote:
> On Mon, May 26, 2014 at 10:42:47AM +0200, Carl Eugen Hoyos wrote:
>
> > As HEVC gets more common, this is starting to hit users.

> x265 doesn't require -lstdc++ unless static.

I think I don't understand...
(We add it for example for libgme although it is not "required".)

> And if you have want a static build you actually need -lm and 
> -lrt as well. At least on my system/configuration. 

True, new patch attached.

> It may also differs as x265 continue to be developed.

Yes, and if I remember correctly, we have to write patches 
anyway when they update.

>     [~]☭ pkg-config --libs x265
>     -lx265
>     [~]☭ pkg-config --static --libs x265
>     -lx265 -lstdc++ -lm -lrt
>
> Not relying on pkg-config will break this.
>
> So, what's the problem with pkg-config requirement?

To the best of my knowledge, it only works if you know 
the right incantation (which FFmpeg's configure cannot 
tell you).

> It's 100kb tool available on every system.

Available? Possibly
Installed? No

> I think what you want instead is a configure script that warn 
> for the non presence of pkg-config when an external library 
> is enabled. We have such warning IIRC, but way too late.

The warning cannot help users, they don't (imo cannot) know 
which environment variable they have to set.
--extra-cflags and --extra-ldflags (which are usually not 
required for the default case) are much more straight-forward 
(and we can document them).

Imo, none of the problems that you see can be solved by 
pkg-config, some of them are caused by it. I honestly don't 
understand why we make the user's life more difficult than 
necessary.

Carl Eugen
-------------- next part --------------
diff --git a/Changelog b/Changelog
index 3d416c4..d52f4ea 100644
--- a/Changelog
+++ b/Changelog
@@ -26,6 +26,7 @@ version <next>:
 - native Opus decoder
 - display matrix export and rotation api
 - WebVTT encoder
+- Do not require pkg-config for x265
 
 
 version 2.2:
diff --git a/configure b/configure
index fae2f77..6f326ee 100755
--- a/configure
+++ b/configure
@@ -4695,7 +4695,7 @@ enabled libwebp           && require_pkg_config libwebp webp/encode.h WebPGetEnc
 enabled libx264           && require libx264 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 &&
+enabled libx265           && require libx265 x265.h x265_encoder_encode -lx265 -lstdc++ -lm -lrt &&
                              { check_cpp_condition x265.h "X265_BUILD >= 13" ||
                                die "ERROR: libx265 version must be >= 13."; }
 enabled libxavs           && require libxavs xavs.h xavs_encoder_encode -lxavs


More information about the ffmpeg-devel mailing list