mkvtoolnix/ac/matroska.m4
Moritz Bunkus c262de4888 configure: require libEBML v1.3.5
libEBML v1.3.5 contains the following change:

------------------------------------------------------------
EbmlMaster::CheckMandatory: only fail for default-value-less mandatory elements

The function EbmlMaster::CheckMandatory() will now only return false
if a mandatory element is missing for which there's no default value
in the specifications. This means that callers such as
EbmlMaster::UpdateSize() and by extension EbmlMaster::Render() will
not insist on all mandatory elements being present anymore, but only
those for which there's no default value.
------------------------------------------------------------

This allows mkvmerge, mkvpropedit and the GUI's header editor to only
actually add those elements that have to be added to a master before
writing it to the file. Adding e.g. the TrackLanguage element isn't
necessary anymore if should be set to "eng" anyway as "eng" is its
default value. Before the change libEBML was insisting on it being
present in the "TrackEntry" master, though, no matter what it was set
to.
2017-08-12 10:51:33 +02:00

77 lines
2.2 KiB
Plaintext

dnl
dnl Test for libEBML and libMatroska, and define MATROSKA_CFLAGS and MATROSKA_LIBS
dnl
EBML_MATROSKA_INTERNAL=no
PKG_CHECK_MODULES([EBML],[libebml >= 1.3.5],[],[EBML_MATROSKA_INTERNAL=yes])
PKG_CHECK_MODULES([MATROSKA],[libmatroska >= 1.4.5],[],[EBML_MATROSKA_INTERNAL=yes])
if test x"$EBML_MATROSKA_INTERNAL" = xyes; then
if ! test -f lib/libebml/ebml/EbmlTypes.h ; then
echo '*** The internal version of the libEBML library is supposed to be used,'
echo '*** but it was not found in "lib/libebml. If this is a clone from the'
echo '*** git repository then submodules have to be initialized with the'
echo '*** following two commands:'
echo '***'
echo '*** git submodule init'
echo '*** git submodule update'
exit 1
fi
if ! test -f lib/libmatroska/matroska/KaxVersion.h ; then
echo '*** The internal version of the libMatroska library is supposed to be used,'
echo '*** but it was not found in "lib/libmatroska". If this is a clone from the'
echo '*** git repository then submodules have to be initialized with the'
echo '*** following two commands:'
echo '***'
echo '*** git submodule init'
echo '*** git submodule update'
exit 1
fi
fi
AC_DEFUN([AX_EBML_FINDNEXTCHILD],[
AC_CACHE_CHECK([if libEBML contains FindNextChild], [ax_cv_ebml_findnextchild],[
CXXFLAGS_SAVED=$CXXFLAGS
if test x"$EBML_MATROSKA_INTERNAL" = xyes; then
CXXFLAGS="-Ilib/libebml -Ilib/libmatroska"
else
CXXFLAGS="$EBML_CFLAGS $MATROSKA_CFLAGS"
fi
export CXXFLAGS
AC_LANG_PUSH(C++)
AC_TRY_COMPILE(
[
#include <matroska/KaxInfo.h>
#include <matroska/KaxSegment.h>
using namespace libebml;
using namespace libmatroska;
],
[
EbmlMaster *m = new KaxSegment;
EbmlElement *e = new KaxTitle;
FindNextChild(*m, *e);
],
[ax_cv_ebml_findnextchild="yes"],
[ax_cv_ebml_findnextchild="no"])
AC_LANG_POP
CXXFLAGS="$CXXFLAGS_SAVED"
])
if test x"$ax_cv_ebml_findnextchild" = xyes; then
AC_DEFINE(HAVE_EBML_FINDNEXTCHILD, 1, [Define if libEBML contains FindNextChild])
fi
])
AX_EBML_FINDNEXTCHILD
AC_SUBST(EBML_MATROSKA_INTERNAL)
AC_SUBST(EBML_CFLAGS)
AC_SUBST(EBML_LIBS)
AC_SUBST(MATROSKA_CFLAGS)
AC_SUBST(MATROSKA_LIBS)