[FFmpeg-devel] [PATCH]Allow libspeex detection also without pkg-config

Timothy Gu timothygu99 at gmail.com
Thu Jan 1 07:27:15 CET 2015


On Wed Dec 31 2014 at 5:02:28 AM Reimar Döffinger <Reimar.Doeffinger at gmx.de>
wrote:
>
> 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).
>

This is simply not true for many people who just want a full featured,
static ffmpeg.exe (and for some reason can't use Zeranoe). When you have 21
*direct* deps, no, pkg-config is a lot easier (assuming everything is
configured correctly), especially for static builds.

Think about it, for a platform like mingw static, if you are going to link
to a lib, that lib most likely depends on other libs. And without
pkg-config, you have to *MANUALLY* link to the "other libs" that the lib
you are linking to depends on. And these "other libs" are different from
sys to sys, so we can't put them all into configure. Say for example
libass. It depends on harfbuzz and fontconfig. It *can* depend on enca. And
harfbuzz depends on icu, glib, freetype (then there's the harfbuzz <->
freetype circular dep problem, out of scope for now), and cairo. And then
there are icu and fontconfig. It is simply not realistic to put everything
into configure. That's where pkg-config can save the day, *especially* for
cross-compilation environments where shared lib is a pain in the "ass".
(Thank God (if He exists) that nobody's complaining about libass not being
usable without pkg-config.)

Plus there are much better pkg-config implementation*S* that don't have the
dep problem.

You can simply use a wrapper that automatically adds proper PKG_CONFIG_PATH
to the pkg-config call. In MXE (a set of makefiles that make it easier to
cross compile stuff (ffmpeg included) for windows [0]) we are doing it like
this [1]:

#!/bin/sh
PKG_CONFIG_LIBDIR='$(PREFIX)/$(TARGET)/lib/pkgconfig' exec
'$(PREFIX)/$(TARGET)/bin/pkgconf' "$@" --static

Done. No more hassle [2].

Timothy

[0]: http://mxe.cc/
[1]: From https://github.com/mxe/mxe/blob/master/src/pkgconf.mk#L38-L41 .
Gross Qt stuff, shared/static switching stuff, and GNU make escaping
removed.
[2]: Assuming the depended library build system is clean enough. If it's
not clean a simple `require` would most possibly fail anyway.


More information about the ffmpeg-devel mailing list