From: Diogo Franco Date: Thu, 28 Jan 2010 04:29:50 +0000 (-0800) Subject: Implement ffms2 version check X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=6bd24a94c06ca81baa0156ff418be247e658a28f;p=x264.git Implement ffms2 version check Depends on ffms2 version 2.13.1 (r272). Tries pkg-config's built-in version checking first. Uses only the preprocessor to avoid cross-compilation issues. --- diff --git a/configure b/configure index 04f357d0..7a534dc6 100755 --- a/configure +++ b/configure @@ -507,10 +507,17 @@ if [ "$lavf_input" = "auto" ] ; then fi if [ "$ffms_input" = "auto" ] ; then + ffms_major="2"; ffms_minor="13"; ffms_micro="1"; ffms_bump="0" + ffms_input="no" - if ${cross_prefix}pkg-config --exists ffms2 2>$DEVNULL; then + [ $ffms_micro -gt 0 -o $ffms_bump -gt 0 ] && vmicro=".$ffms_micro" + [ $ffms_bump -gt 0 ] && vbump=".$ffms_bump" + if ${cross_prefix}pkg-config --atleast-version="$ffms_major.$ffms_minor$vmicro$vbump" ffms2 2>$DEVNULL; then FFMS2_LIBS="$FFMS2_LIBS $(${cross_prefix}pkg-config --libs ffms2)" FFMS2_CFLAGS="$FFMS2_LIBS $(${cross_prefix}pkg-config --cflags ffms2)" + api_check="no" + else + api_check="yes" fi [ -z "$FFMS2_LIBS" ] && FFMS2_LIBS="-lffms2" @@ -520,6 +527,17 @@ if [ "$ffms_input" = "auto" ] ; then ffms_input="yes" FFMS2_LIBS="$FFMS2_LIBS -lstdc++ $LAVF_LIBS" fi + + if [ $api_check = "yes" -a $ffms_input = "yes" ]; then + log_check "whether ffms2 version is at least $ffms_major.$ffms_minor$vmicro$vbump" + $CC $CFLAGS $FFMS2_CFLAGS -c -o conftest -x c - >$DEVNULL 2>&1 < +#if FFMS_VERSION < (($ffms_major << 24) | ($ffms_minor << 16) | ($ffms_micro << 8) | $ffms_bump) +#error Requires ffms2 version 2.13.1 +#endif +EOF + [ $? = 0 ] && log_ok || { ffms_input="no"; log_fail; } + fi fi if [ "$ffms_input" = "yes" ]; then