2008-08-27 20:38:55 +00:00
|
|
|
dnl
|
2011-02-06 11:54:56 +00:00
|
|
|
dnl Test for libebml, and define EBML_CFLAGS, EBML_LDFLAGS and EBML_LIBS
|
2008-08-27 20:38:55 +00:00
|
|
|
dnl
|
2010-06-05 11:38:56 +00:00
|
|
|
ebml_ver_req_major=1
|
2011-01-31 10:52:07 +00:00
|
|
|
ebml_ver_req_minor=2
|
2011-09-10 10:18:33 +00:00
|
|
|
ebml_ver_req_micro=1
|
2008-08-27 20:38:55 +00:00
|
|
|
|
|
|
|
AC_CACHE_CHECK([for libEBML headers version >= ${ebml_ver_req_major}.${ebml_ver_req_minor}.${ebml_ver_req_micro}],
|
|
|
|
[ac_cv_ebml_found],[
|
|
|
|
|
|
|
|
EBML_LIBS="-lebml"
|
|
|
|
ac_save_CXXFLAGS="$CXXFLAGS"
|
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $EBML_LIBS"
|
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#include <ebml/EbmlVersion.h>
|
|
|
|
#include <ebml/EbmlDummy.h>
|
|
|
|
|
|
|
|
using namespace libebml;
|
|
|
|
|
|
|
|
#if LIBEBML_VERSION < ((${ebml_ver_req_major} << 16) + (${ebml_ver_req_minor} << 8) + ${ebml_ver_req_micro})
|
|
|
|
# error libebml is too old
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
[],
|
|
|
|
ac_cv_ebml_found=yes,
|
|
|
|
ac_cv_ebml_found=no)
|
|
|
|
|
|
|
|
if test "${ac_cv_ebml_found}" = "no" ; then
|
|
|
|
EBML_CFLAGS="-I/usr/local/include"
|
2011-02-06 11:54:56 +00:00
|
|
|
EBML_LDFLAGS="-L/usr/local/lib"
|
|
|
|
EBML_LIBS="$EBML_LIBS"
|
2008-08-27 20:38:55 +00:00
|
|
|
CXXFLAGS="-I/usr/local/include $CXXFLAGS"
|
|
|
|
LIBS="-L/usr/local/lib $LIBS"
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#include <ebml/EbmlVersion.h>
|
|
|
|
#include <ebml/EbmlDummy.h>
|
|
|
|
|
|
|
|
using namespace libebml;
|
|
|
|
|
|
|
|
#if LIBEBML_VERSION < ((${ebml_ver_req_major} << 16) + (${ebml_ver_req_minor} << 8) + ${ebml_ver_req_micro})
|
|
|
|
# error libebml is too old
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
[],
|
|
|
|
ac_cv_ebml_found=yes,
|
|
|
|
ac_cv_ebml_found=no)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_LANG_POP
|
|
|
|
CXXFLAGS="$ac_save_CXXFLAGS"
|
|
|
|
LIBS="$ac_save_LIBS"
|
2011-01-31 10:52:07 +00:00
|
|
|
|
|
|
|
if test x"${ac_cv_ebml_found}" != "xyes" ; then
|
|
|
|
ac_cv_ebml_found=internal
|
|
|
|
fi
|
2008-08-27 20:38:55 +00:00
|
|
|
])
|
|
|
|
|
2011-01-31 10:52:07 +00:00
|
|
|
if test x"${ac_cv_ebml_found}" = "xinternal" ; then
|
|
|
|
EBML_CFLAGS="-Ilib/libebml"
|
2011-02-06 11:54:56 +00:00
|
|
|
EBML_LDFLAGS="-Llib/libebml/src"
|
|
|
|
EBML_LIBS="-lebml"
|
2008-08-27 20:38:55 +00:00
|
|
|
|
2011-01-31 10:52:07 +00:00
|
|
|
else
|
2008-08-27 20:38:55 +00:00
|
|
|
dnl
|
|
|
|
dnl Test if libebml has to be compiled with -DEBML_DLL on Windows.
|
|
|
|
dnl
|
2011-01-31 10:52:07 +00:00
|
|
|
ebml_check_msg_nodll="yes, without -DEBML_DLL"
|
|
|
|
ebml_check_msg_dll="yes, with -DEBML_DLL"
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([if linking against libEBML works and if it requires -DEBML_DLL],
|
|
|
|
[ac_cv_ebml_dll],[
|
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
ac_save_CXXFLAGS="$CXXFLAGS"
|
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
CXXFLAGS="$CXXFLAGS $EBML_CFLAGS"
|
2011-02-06 11:54:56 +00:00
|
|
|
LIBS="$LIBS $EBML_LDFLAGS $EBML_LIBS"
|
2011-01-31 10:52:07 +00:00
|
|
|
AC_TRY_LINK([
|
2008-08-27 20:38:55 +00:00
|
|
|
#include <ebml/EbmlVersion.h>
|
|
|
|
#include <ebml/EbmlDummy.h>
|
|
|
|
|
|
|
|
using namespace libebml;
|
2011-01-31 10:52:07 +00:00
|
|
|
],
|
|
|
|
[EbmlDummy d;],
|
|
|
|
ac_cv_ebml_dll="${ebml_check_msg_nodll}",
|
|
|
|
ac_cv_ebml_dll="not found")
|
|
|
|
|
|
|
|
if test x"${ac_cv_mingw32}" = "xyes" ; then
|
|
|
|
if test x"${ac_cv_ebml_dll}" != "x${ebml_check_msg_nodll}" ; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -DEBML_DLL"
|
|
|
|
AC_TRY_LINK([
|
2008-08-27 20:38:55 +00:00
|
|
|
#include <ebml/EbmlVersion.h>
|
|
|
|
#include <ebml/EbmlDummy.h>
|
|
|
|
|
|
|
|
using namespace libebml;
|
2011-01-31 10:52:07 +00:00
|
|
|
],
|
|
|
|
[EbmlDummy d;],
|
|
|
|
ac_cv_ebml_dll="${ebml_check_msg_dll}")
|
|
|
|
fi
|
2008-08-27 20:38:55 +00:00
|
|
|
fi
|
2011-01-31 10:52:07 +00:00
|
|
|
AC_LANG_POP
|
|
|
|
CXXFLAGS="${ac_save_CXXFLAGS}"
|
|
|
|
LIBS="${ac_save_LIBS}"
|
|
|
|
])
|
|
|
|
|
|
|
|
if test x"${ac_cv_ebml_dll}" != "x${ebml_check_msg_dll}" -a x"${ac_cv_ebml_dll}" != "x${ebml_check_msg_nodll}" ; then
|
|
|
|
echo '*** The libEBML library was not found.'
|
|
|
|
exit 1
|
|
|
|
fi
|
2008-08-27 20:38:55 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test x"${ac_cv_ebml_dll}" = "x${ebml_check_msg_dll}" ; then
|
|
|
|
EBML_CFLAGS="$EBML_CFLAGS -DEBML_DLL"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(EBML_CFLAGS)
|
2011-02-06 11:54:56 +00:00
|
|
|
AC_SUBST(EBML_LDFLAGS)
|
2008-08-27 20:38:55 +00:00
|
|
|
AC_SUBST(EBML_LIBS)
|