[FFmpeg-devel] [rfc] cross-pkg-config and cross-sdl-config
Luca Barbato
lu_zero
Sat Feb 26 20:26:29 CET 2011
I'm messing up a bit with cross building ffmpeg with some deps.
Most of the stuff works beside sdl-config expecting to be called using
the cross prefix.
My dirty solution had been using an external var for it:
diff --git a/configure b/configure
index 5795c4b..a72a50a 100755
--- a/configure
+++ b/configure
@@ -2861,7 +2861,7 @@ if enabled libdc1394; then
die "ERROR: No version of libdc1394 found "
fi
-SDL_CONFIG="${cross_prefix}sdl-config"
+SDL_CONFIG="${SDL_CONFIG:-${cross_prefix}sdl-config}"
if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
sdl_cflags=$("${SDL_CONFIG}" --cflags)
sdl_libs=$("${SDL_CONFIG}" --libs)
pkg-config since 0.23 has a correct support for PKG_CONFIG_SYSROOT_DIR
and there is the common practice to have cross-pkg-config wrappers, at
least in gentoo, to make pkg-config provide the right cflags/ldflags.
So I'd first replace sdl-config with pkg-config
diff --git a/configure b/configure
index 5795c4b..598d7b4 100755
--- a/configure
+++ b/configure
@@ -2861,10 +2861,9 @@ if enabled libdc1394; then
die "ERROR: No version of libdc1394 found "
fi
-SDL_CONFIG="${cross_prefix}sdl-config"
-if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
- sdl_cflags=$("${SDL_CONFIG}" --cflags)
- sdl_libs=$("${SDL_CONFIG}" --libs)
+if pkg-config sdl --modversion > /dev/null 2>&1; then
+ sdl_cflags=$(pkg-config sdl --cflags)
+ sdl_libs=$(pkg-config sdl --libs)
check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 |
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
enable sdl &&
and then I'd consider adding ${cross_prefix} to pkg-config as whole if
this practice is widespread enough or add a check for pkg-config and
make it look in the right place using PKG_CONFIG_SYSROOT_DIR if
-with-sysroot is passed.
lu
--
Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero
More information about the ffmpeg-devel
mailing list