[FFmpeg-devel] [PATCH]Allow libspeex detection also without pkg-config
u at pkh.me
Wed Dec 31 14:38:20 CET 2014
On Wed, Dec 31, 2014 at 02:23:54PM +0100, Reimar Döffinger wrote:
> On Wed, Dec 31, 2014 at 02:09:42PM +0100, Nicolas George wrote:
> > Le primidi 11 nivôse, an CCXXIII, Reimar Döffinger a écrit :
> > > I don't care much, but I still find not having to use pkg-config
> > > somewhat more convenient in a cross-compilation environment where
> > > you don't want to install all dependencies just to make it work with
> > > pkg-config (or alternatively manually hack those files).
> > Can you elaborate on that? I suspect there are ways of making this work
> > easily with pkg-config, but you are to vague about the dependencies you want
> > to avoid, so I can not suggest a way.
> If I just download libspeex, libfdk_aac, libsdl etc. and build them
> with CC=i686-mingw32-gcc ./configure, then without pkg-config I can
> just add a few paths to -I and -L and I can link against them.
> With pkg-config things tend to get inconsistent and more complicated.
> For example some programs (no, I haven't tried lately so I don't
> remember examples) generate them only on install, so you have to
> make install. But to do that you have to figure out how to specify
> a install directory.
The .pc files are obviously generally generated because the library they
depend on (for static stuff) depends on your configure options, so
obviously that's what you want: flags automatically added that way.
> Even if they don't, you still have to add the .pc paths in addition.
> From my point of view it's only more convenient if all you want to
> use are things that are pre-packaged by your distribution.
> Btw. would you be less opposed to a patch that added less obfuscation?
> It looks to me like we would just require an extra "fallback -l" option
> (preferably also a fallback extra cflags one) to use_pkg_config to allow
> hiding all the extra complexity in one place, inside that function.
The problem is that the fallback is really broken. pkg-config has a
mechanism to check for version, it also has a mechanism to raise different
flags depending on the build, and it also has a system to differenciate
the flags necessary for static or dynamic building.
Look at the current multiline and unreliable (no pkg-config + x264 with
opencl will badly break) mess we have for x264, when we could just have 1
line: require_pkg_config "x264 > 0.118" "stdint.h x264.h"
And if the user doesn't have pkg-config, an explicit error is raise: "you
must install pkg-config", which is simpler to solve than a weird linkage
error on opencl in the config.log and an error saying "i can't find x264"
> I agree that it gets messy if we add a special case to more and more
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 473 bytes
Desc: not available
More information about the ffmpeg-devel