[x264-devel] commit: Implement ffms2 version check (Diogo Franco )

git version control git at videolan.org
Sat Jan 30 13:58:01 CET 2010


x264 | branch: master | Diogo Franco <diogomfranco at gmail.com> | Wed Jan 27 20:29:50 2010 -0800| [6bd24a94c06ca81baa0156ff418be247e658a28f] | committer: Jason Garrett-Glaser 

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=6bd24a94c06ca81baa0156ff418be247e658a28f
---

 configure |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 04f357d..7a534dc 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 <<EOF
+#include <ffms.h>
+#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



More information about the x264-devel mailing list