Commit 5270517b authored by Jon Lech Johansen's avatar Jon Lech Johansen

* ./configure.ac.in: Added --with-libmpeg2-tree

parent 089782f7
...@@ -1818,23 +1818,50 @@ AC_ARG_ENABLE(libmpeg2, ...@@ -1818,23 +1818,50 @@ AC_ARG_ENABLE(libmpeg2,
[ --enable-libmpeg2 libmpeg2 decoder support (default enabled)]) [ --enable-libmpeg2 libmpeg2 decoder support (default enabled)])
if test "x${enable_libmpeg2}" != "xno" if test "x${enable_libmpeg2}" != "xno"
then then
AC_CHECK_HEADERS(mpeg2dec/mpeg2.h, [ AC_ARG_WITH(libmpeg2-tree,
AC_MSG_CHECKING(for libmpeg2 version >= 0.3.2) [ --with-libmpeg2-tree=PATH libmpeg2 tree for static linking])
AC_EGREP_CPP(yes, if test "x${with_libmpeg2_tree}" != "x"
[#include <mpeg2dec/mpeg2.h> then
#ifdef MPEG2_RELEASE AC_MSG_CHECKING(for libmpeg2.a in ${with_libmpeg2_tree})
#if MPEG2_RELEASE >= MPEG2_VERSION(0,3,2) real_libmpeg2_tree="`cd ${with_libmpeg2_tree} 2>/dev/null && pwd`"
yes if test "x${real_libmpeg2_tree}" = x
#endif then
#endif], dnl The given directory can't be found
[AC_MSG_RESULT([yes]) AC_MSG_RESULT(no)
PLUGINS="${PLUGINS} libmpeg2" AC_MSG_ERROR([cannot cd to ${with_libmpeg2_tree}])
LDFLAGS_libmpeg2="${LDFLAGS_libmpeg2} -lmpeg2"], fi
[AC_MSG_RESULT([no]) if test -f "${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a"
AC_MSG_ERROR([Your libmpeg2 is too old (you need the cvs version): you may get a more recent one from http://libmpeg2.sf.net/. Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])])], then
dnl Use a custom libmpeg2
[AC_MSG_ERROR([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ (you need the cvs version). Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])] AC_MSG_RESULT(${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a)
) PLUGINS="${PLUGINS} libmpeg2"
LDFLAGS_libmpeg2="${LDFLAGS_libmpeg2} -L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2"
CFLAGS_libmpeg2="${CFLAGS_libmpeg2} -I${real_libmpeg2_tree}/include"
eval "`cd ${real_libmpeg2_tree}/include && ln -sf . mpeg2dec 2>/dev/null`"
else
dnl The given libmpeg2 wasn't built
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a, make sure you compiled libmpeg2 in ${with_libmpeg2_tree}])
fi
else
AC_CHECK_HEADERS(mpeg2dec/mpeg2.h, [
AC_MSG_CHECKING(for libmpeg2 version >= 0.3.2)
AC_EGREP_CPP(yes,
[#include <mpeg2dec/mpeg2.h>
#ifdef MPEG2_RELEASE
#if MPEG2_RELEASE >= MPEG2_VERSION(0,3,2)
yes
#endif
#endif],
[AC_MSG_RESULT([yes])
PLUGINS="${PLUGINS} libmpeg2"
LDFLAGS_libmpeg2="${LDFLAGS_libmpeg2} -lmpeg2"],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Your libmpeg2 is too old (you need the cvs version): you may get a more recent one from http://libmpeg2.sf.net/. Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])])],
[AC_MSG_ERROR([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ (you need the cvs version). Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])]
)
fi
fi fi
dnl dnl
......
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