[vlc-devel] commit: Use pkg-config to get the flags for libmpeg2 (Christophe Mutricy )

git version control git at videolan.org
Wed Jul 16 23:20:12 CEST 2008


vlc | branch: master | Christophe Mutricy <xtophe at videolan.org> | Wed Jul 16 19:32:13 2008 +0100| [5889307336d67b11b4988253ec304d335c6bbf57]

Use pkg-config to get the flags for libmpeg2

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5889307336d67b11b4988253ec304d335c6bbf57
---

 configure.ac             |   31 +++++++++----------------------
 modules/codec/libmpeg2.c |    2 +-
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2c28b09..4c4dbc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3395,8 +3395,7 @@ if test "${enable_libmpeg2}" != "no"
 then
   AC_ARG_WITH(libmpeg2-tree,
   [    --with-libmpeg2-tree=PATH libmpeg2 tree for static linking])
-  if test -n "${with_libmpeg2_tree}"
-  then
+  AS_IF([test -n "${with_libmpeg2_tree}"],[
     AC_MSG_CHECKING(for libmpeg2.a in ${with_libmpeg2_tree})
     real_libmpeg2_tree="`cd ${with_libmpeg2_tree} 2>/dev/null && pwd`"
     if test -z "${real_libmpeg2_tree}"
@@ -3409,34 +3408,22 @@ then
     then
       dnl  Use a custom libmpeg2
       AC_MSG_RESULT(${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a)
-      VLC_ADD_BUILTINS([libmpeg2])
+      VLC_ADD_PLUGIN([libmpeg2])
       VLC_ADD_LIBS([libmpeg2],[-L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2])
       VLC_ADD_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])
+  ],[
+   PKG_CHECK_MODULES(LIBMPEG2,[libmpeg2 > 0.3.2],[ 
           VLC_ADD_PLUGIN([libmpeg2])
-          VLC_ADD_LIBS([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
+          VLC_ADD_LIBS([libmpeg2], $LIBMPEG2_LIBS),
+          VLC_ADD_CFLAGS([libmpeg2], $LIBMPEG2_CFLAGS)
+       ], 
+      AC_MSG_WARN([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ . Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.]))
+  ])
 fi
 
 dnl
diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index 72ea956..f088638 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -34,7 +34,7 @@
 #include <vlc_vout.h>
 #include <vlc_codec.h>
 
-#include <mpeg2dec/mpeg2.h>
+#include <mpeg2.h>
 
 #include <vlc_codec_synchro.h>
 




More information about the vlc-devel mailing list