[FFmpeg-devel] [PATCH] create all pkg-config files in their own subdirectory

Aurelien Jacobs aurel
Tue Jul 8 01:43:56 CEST 2008


M?ns Rullg?rd wrote:

> 
> Diego Biurrun wrote:
> > On Sun, Jul 06, 2008 at 10:53:00PM +0200, Aurelien Jacobs wrote:
> >> M?ns Rullg?rd wrote:
> >>
> >> > Jack Jansen <Jack.Jansen at cwi.nl> writes:
> >> >
> >> > > On  28-Jun-2008, at 03:09 , M?ns Rullg?rd wrote:
> >> > >
> >> > >>> -libdir=\${pcfiledir}/$name
> >> > >>> +libdir=\${pcfiledir}
> >> > >>
> >> > >> If that is right, ...
> >> > >>
> >> > >>> includedir=\${pcfiledir}
> >> > >>
> >> > >> then that is wrong.
> >> > >
> >> > > No: the pattern seems to be to do
> >> > >
> >> > > 	#include "libavcodec/avcodec.h"
> >> > >
> >> > > currently. That was different in the past, IIRC, but nowadays this is
> >> > > what most ffmpeg code uses.
> >> >
> >> > Yes, that is how #include directives should look.  Assuming
> >> > ${pcfiledir} is the directory containing the .pc file, supplying
> >> > -I${pcfiledir} is wrong when the .pc file is in the same directory as
> >> > headers/libs.
> >>
> >> True.
> >> Attached patch should fix this issue properly.
> >> I will apply it in a few days if no one cares.
> >>
> >> --- configure	(revision 14095)
> >> +++ configure	(working copy)
> >> @@ -2212,8 +2212,8 @@
> >>  cat <<EOF > $name/$name-uninstalled.pc
> >>  prefix=
> >>  exec_prefix=
> >> -libdir=\${pcfiledir}/$name
> >> -includedir=\${pcfiledir}
> >> +libdir=\${pcfiledir}
> >> +includedir=\${pcfiledir}/..
> >
> > This looks wrong to me.  I don't see the problem in our current
> > pkg-config files...
> 
> The problem is with the -uninstalled.pc files.  They cause pkg-config
> to emit flags like -I/some/path/ffmpeg/libavcodec, when it should be
> -I/some/path/ffmpeg.  The patch changes this to -I/some/path/libavcodec/..
> which is correct, if somewhat ugly.
> 
> Personally, I'm struggling to understand why anyone would want these files
> in the first place.  If they can tell pkg-config where to find them,
> writing the proper -I and -L flags should surely be within the capabilities
> of the user.  Then again, I'm probably over-estimating the intelligence
> of the average coder.  Programming has become far too easy.

Sure, it should always be possible to specify the proper -I -L -l...
But when you are testing x projects depending on ffmpeg libs,
and wants to compile them against y different ffmpeg builds, you may
have to figure out x different ways to specify compile/link flags and
y different list of flags. That can quickly become painful.
Just setting PKG_CONFIG_PATH to the path of the ffmpeg build you want
to use may be significantly simpler.

And anyway, most software will automatically pick the installed
ffmpeg with pkg-config. And if you want to use an uninstalled version
instead (because you are not root but still want to use a more recent
ffmpeg for example), then just setting PKG_CONFIG_PATH is quite simple
and pretty efficient.

Well, obviously, moving *.pc in different subdirectories made this
significantly more painful.
- before:
    export PKG_CONFIG_PATH=$FFMPEG
- after:
    export PKG_CONFIG_PATH=$FFMPEG/libavcodec:$FFMPEG/libavformat:$FFMPEG/libavutil:$FFMPEG/libavdevice:$FFMPEG/libpostproc:$FFMPEG/libswscale:$FFMPEG/libavfilter

Aurel




More information about the ffmpeg-devel mailing list