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

Michael Niedermayer michaelni at gmx.at
Thu Jul 5 12:33:33 CEST 2012

On Tue, Jul 03, 2012 at 02:50:35PM -0400, Kyle Schwarz wrote:
> On 7/2/2012 10:07 PM, Michael Niedermayer wrote:
> >On Mon, Jul 02, 2012 at 03:47:40PM -0400, Kyle Schwarz wrote:
> >>On 7/2/2012 3:42 PM, Michael Niedermayer wrote:
> >>>On Mon, Jul 02, 2012 at 01:37:50PM -0400, Kyle Schwarz wrote:
> >>>>On 7/2/2012 1:03 PM, Michael Niedermayer wrote:
> >>>>>On Fri, Jun 29, 2012 at 10:08:06PM -0400, Kyle Schwarz wrote:
> >>>>>>On 6/29/2012 11:04 AM, Michael Niedermayer wrote:
> >>>>>>>On Fri, Jun 29, 2012 at 10:58:28AM -0400, Derek Buitenhuis wrote:
> >>>>>>>>On 29/06/2012 2:30 AM, Kyle Schwarz wrote:
> >>>>>>>>>The attached patch resolves a pkg-config issue.
> >>>>>>>>>
> >>>>>>>>>When a cross-prefix is used, FFmpeg searches for a cross-prefixed
> >>>>>>>>>pkg-config, and fails to use pkg-config if none if found.
> >>>>>>>>>
> >>>>>>>>>This patch allows a native system pkg-config to be used if a prefixed
> >>>>>>>>>one is not found.
> >>>>>>>>
> >>>>>>>>This seems like it could go quite wrong in some situations...
> >>>>>>>
> >>>>>>>seconded
> >>>>>>
> >>>>>>Can you give me an example of when it could go bad?
> >>>>>
> >>>>>
> >>>>>assume you have libfoo 0.1 installed on your host and you cross
> >>>>>compile and link to libfoo 9.0.
> >>>>>the hosts pkg-config will search the hosts .pc files which will
> >>>>>contain "instructions" to link to libfoo 0.1. Thes 2 libs may depend
> >>>>>on different other libs, need different linker flags and be in
> >>>>>different directories
> >>>>
> >>>>The PKG_CONFIG_PATH is what controls where the .pc files are found.
> >>>>
> >>>>>The problem i see is not using the hosts pkg-config but rather the
> >>>>>hosts installed .pc files. But the hosts pkg-config will use them
> >>>>>by default and i dont see something that would prevent it
> >>>>
> >>>
> >>>>As long as the PKG_CONFIG_PATH is set properly the host system libs
> >>>>will not be used.
> >>>
> >>>who or what would set this path ?
> >>
> >>Everyone using the native pkg-config or installed their libs to a
> >>prefixed dir.
> >
> >I dont use the native pkg-config, thus i dont set the path. with
> >your patch though configure would use the native pkg-config behind my
> >back and silently fail in cryptic ways
> How do you configure FFmpeg? If you aren't using the native
> pkg-config, you would need to specify something else I believe.

i dont use pkg-config at all for the cross compiling i do. But thats
mostly for fate clients. pkg-config is only used for some optional
external libraries which are not really tested by fate anyway so
its not that usefull for my usecase ...

> >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 ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120705/d43746ab/attachment.asc>

More information about the ffmpeg-devel mailing list