Index: configure.ac
===================================================================
--- configure.ac	(revision 9889)
+++ configure.ac	(working copy)
@@ -1756,20 +1756,46 @@
 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
   AC_LANG_PUSH(C++)
   AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
-    AC_CHECK_HEADERS(matroska/KaxVersion.h, [
-      AC_CHECK_HEADERS(matroska/KaxAttachments.h)
-      VLC_ADD_CXXFLAGS([mkv],[])
-      AC_CHECK_LIB(ebml_pic, main, [
-        # We have ebml_pic, that's good, we can build an mkv.so plugin !
-        VLC_ADD_PLUGINS([mkv])
-        VLC_ADD_LDFLAGS([mkv],[-lmatroska_pic -lebml_pic])
-      ], [
-        AC_CHECK_LIB(ebml, main, [
-          # We only have libebml, make mkv.a a builtin
-          VLC_ADD_BUILTINS([mkv])
-          VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml])
+    AC_MSG_CHECKING(for libebml version >= 0.7.3)
+    AC_EGREP_CPP(yes,
+      [#include <ebml/EbmlVersion.h>
+       #ifdef LIBEBML_VERSION
+       #if LIBEBML_VERSION >= 0x000703
+       yes
+       #endif
+       #endif],
+      [AC_MSG_RESULT([yes])
+        AC_CHECK_HEADERS(matroska/KaxVersion.h, [
+          AC_MSG_CHECKING(for libmatroska version >= 0.7.5)
+          AC_EGREP_CPP(yes,
+            [#include <matroska/KaxVersion.h>
+             #ifdef LIBMATROSKA_VERSION
+             #if LIBMATROSKA_VERSION >= 0x000705
+             yes
+             #endif
+             #endif],
+            [AC_MSG_RESULT([yes])
+              AC_CHECK_HEADERS(matroska/KaxAttachments.h)
+              VLC_ADD_CXXFLAGS([mkv],[])
+              AC_CHECK_LIB(ebml_pic, main, [
+                # We have ebml_pic, that's good, we can build an mkv.so plugin !
+                VLC_ADD_PLUGINS([mkv])
+                VLC_ADD_LDFLAGS([mkv],[-lmatroska_pic -lebml_pic])
+              ], [
+                AC_CHECK_LIB(ebml, main, [
+                  # We only have libebml, make mkv.a a builtin
+                  VLC_ADD_BUILTINS([mkv])
+                  VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml])
+                ])
+              ])
+            ],
+            [AC_MSG_RESULT([no])
+              AC_MSG_ERROR([Your libmatroska is too old: you may get a more recent one from http://dl.matroska.org/downloads/libmatroska/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
+          ])
         ])
-      ])
+      ],
+      [AC_MSG_RESULT([no])
+        AC_MSG_ERROR([Your libebml is too old: you may get a more recent one from http://dl.matroska.org/downloads/libebml/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
     ])
   ])
   AC_LANG_POP(C++)
