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

Kyle Schwarz kshawkeye at gmail.com
Fri Jul 6 06:33:16 CEST 2012

On 7/5/2012 4:19 PM, Michael Niedermayer wrote:
> On Thu, Jul 05, 2012 at 08:33:58PM +0200, Reimar Döffinger wrote:
>> On Thu, Jul 05, 2012 at 12:33:33PM +0200, Michael Niedermayer wrote:
>>>>> If you want to use the native pkg-config as a fallback then the
>>>>> code you add should check that PKG_CONFIG_LIBDIR is set. If if its not
>>>>> set it shouldnt use the native pkg-config
>>>> So only fall back if PKG_CONFIG_LIBDIR is not set?
>>> if PKG_CONFIG_LIBDIR is set and no prefixed pkg-config is found then
>>> the hosts could probably be used safely otherwise no pkg-config
>>> should be used.
>>> above is IMHO and from a quick look at things, its not tested ...
>> As someone else pointed out: If we ever start using pkg-config to detect
>> host libraries (e.g. because we need them to calculate some hardcoded
>> tables at compile time) we will be breaking that feature badly.
>> It might be better to document a better solution (creating a script
>> that acts as a cross-pkg-config) and make sure its easy to find from
>> configure.
>> Another alternative is that we try creating such a script on the fly,
>> if it's possible to guess a suitable PKG_CONFIG_LIBDIR...
> this is a great idea, actually i dont think a script is needed,
> configure just needs to set the PKG_CONFIG_LIBDIR (and maybe others)
> before calling the host pkg_config for the target and reset it
> afterwards

So would that eliminate the use of a prefixed pkg-config completely? I 
know MinGW uses a prefixed pkg-config with it's native compiler.

Sorry if I misunderstood.

Best regards,
   Kyle Schwarz

More information about the ffmpeg-devel mailing list