Commit 567df927 authored by Diogo Franco's avatar Diogo Franco Committed by Fiona Glaser
Browse files

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.
parent 453a8ee4
...@@ -507,10 +507,17 @@ if [ "$lavf_input" = "auto" ] ; then ...@@ -507,10 +507,17 @@ if [ "$lavf_input" = "auto" ] ; then
fi fi
if [ "$ffms_input" = "auto" ] ; then if [ "$ffms_input" = "auto" ] ; then
ffms_major="2"; ffms_minor="13"; ffms_micro="1"; ffms_bump="0"
ffms_input="no" 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_LIBS="$FFMS2_LIBS $(${cross_prefix}pkg-config --libs ffms2)"
FFMS2_CFLAGS="$FFMS2_LIBS $(${cross_prefix}pkg-config --cflags ffms2)" FFMS2_CFLAGS="$FFMS2_LIBS $(${cross_prefix}pkg-config --cflags ffms2)"
api_check="no"
else
api_check="yes"
fi fi
[ -z "$FFMS2_LIBS" ] && FFMS2_LIBS="-lffms2" [ -z "$FFMS2_LIBS" ] && FFMS2_LIBS="-lffms2"
...@@ -520,6 +527,17 @@ if [ "$ffms_input" = "auto" ] ; then ...@@ -520,6 +527,17 @@ if [ "$ffms_input" = "auto" ] ; then
ffms_input="yes" ffms_input="yes"
FFMS2_LIBS="$FFMS2_LIBS -lstdc++ $LAVF_LIBS" FFMS2_LIBS="$FFMS2_LIBS -lstdc++ $LAVF_LIBS"
fi 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 fi
if [ "$ffms_input" = "yes" ]; then if [ "$ffms_input" = "yes" ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment