[FFmpeg-devel] [PATCH] Fix pkg-config detection when using a cross-prefix

Kyle Schwarz kshawkeye at gmail.com
Mon Jul 2 23:20:54 CEST 2012

On 7/2/2012 4:56 PM, Derek Buitenhuis wrote:
> On 02/07/2012 3:47 PM, Kyle Schwarz wrote:
>> No one compiles a pkg-config for a cross toolchain. It has a lot of
>> circular dependency's and is a pain to compile. Everyone simple finds
>> some way to hack the FFmpeg to use the native one. These hacks would not
>> be needed if FFmpeg's configure functioned like other package configures
>> and had a fallback.
> This is a lie and I can think of an exact circumstance this happens.
> Stuff like Yocto/Poky and OpenEmbedded DO.
> Imagine the following scenario:
> I am in an x86_64 eglibc based Linux system. I am using an x86_86
> cross-toolchain to generate x86_64 code for systems using uclibc.
> It fails to find the cross-pkg-config (which these DO provide), and it
> attempts to link to the host's libraries, which output all manner
> of confusing and misleading errors.

Except in that case you would need to already have a hack to get around 
FFmpeg's configure if you even wanted to compile FFmpeg. Meaning, for 
everyone that falls under the "we need some specific pkg-config" 
category, this patch does not effect them. For the rare case that the 
native pkg-config will not work with the cross toolchain, another 
pkg-config can be set.

It makes no sense to punish a ton of cross compilers for one or two rare 
situations where you need to specify your own pkg-config.

With the current FFmpeg, you couldn't even compile if a cross prefixed 
pkg-config is not found.

Also, in the example you gave, does that mean that you have a cross 
prefixed pkg-config built already? If so, then it would use that one by 
default anyway. This patch is only a fallback, and does not effect 
anything that already works.

More information about the ffmpeg-devel mailing list