]> git.sesse.net Git - vlc/commitdiff
Use pkg-config to check for dvdread (the .pc file exist for a long time).
authorRémi Duraffort <ivoire@videolan.org>
Tue, 17 Aug 2010 19:51:30 +0000 (21:51 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Tue, 17 Aug 2010 19:52:43 +0000 (21:52 +0200)
configure.ac
modules/access/dvdread.c

index 341a7e4b44b8cb02671d3137aaa0b0852b766363..cb91f57e4e8285b79365873b29e247310d8e895b 100644 (file)
@@ -1849,80 +1849,10 @@ PKG_ENABLE_MODULES_VLC([DV], [access_dv], [libraw1394 >= 2.0.1 libavc1394 >= 0.5
 dnl
 dnl dvdread module: check for libdvdread
 dnl
-AC_ARG_ENABLE(dvdread,
-[  --enable-dvdread        dvdread input module (default enabled)])
-if test "${enable_dvdread}" != "no"
-then
-  AC_ARG_WITH(dvdread,
-  [  --with-dvdread=PATH     libdvdread headers and libraries])
-  AC_ARG_WITH(dvdread-tree,
-  [  --with-dvdread-tree=PATH libdvdread tree for static linking])
-
-  dnl prepend -ldvdcss on OS that need it
-  AS_CASE(["${SYS}"], [mingw32|darwin|beos], [VLC_ADD_LIBS([dvdread], [-ldvdcss])])
-
-  if test -z "${with_dvdread}"
-  then
-    if test -z "${with_dvdread_tree}"
-    then
-      AC_CHECK_HEADERS(dvdread/dvd_reader.h,
-        [ VLC_ADD_PLUGIN([dvdread])
-          VLC_ADD_LIBS([dvdread],[-ldvdread])
-        ],[
-         AC_CHECK_HEADERS(libdvdread/dvd_reader.h,
-            [ VLC_ADD_PLUGIN([dvdread])
-             VLC_ADD_LIBS([dvdread],[-ldvdread])
-           ],[
-             if test -n "${enable_dvdread}"
-             then
-             AC_MSG_ERROR([cannot find libdvdread headers])
-            fi
-          ])
-       ])
-    else
-      AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
-      real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
-      if test -z "${real_dvdread_tree}"
-      then
-        dnl  The given directory can't be found
-        AC_MSG_RESULT(no)
-        AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
-      fi
-      if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
-      then
-        dnl  Use a custom libdvdread
-        AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
-        VLC_ADD_PLUGIN([dvdread])
-        VLC_ADD_LIBS([dvdread],[-L${real_dvdread_tree}/dvdread/.libs -ldvdread])
-        VLC_ADD_CPPFLAGS([dvdread],[-I${real_dvdread_tree}])
-      else
-        dnl  The given libdvdread wasn't built
-        AC_MSG_RESULT(no)
-        AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
-      fi
-    fi
-  else
-    AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
-    if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
-    then
-      dnl  Use ${with_dvdread}/include/dvdread/dvd_reader.h
-      AC_MSG_RESULT(yes)
-      VLC_ADD_PLUGIN([dvdread])
-      VLC_ADD_LIBS([dvdread],[-L${with_dvdread}/lib -ldvdread])
-      VLC_ADD_CPPFLAGS([dvdread],[-I${with_dvdread}/include])
-    else
-      dnl  No libdvdread could be found, sorry
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
-    fi
-  fi
-
-  dnl append -ldvd on OS that need it
-  AS_CASE(["${SYS}"], [bsdi], [VLC_ADD_LIBS([dvdread], [-ldvd])])
-fi
+PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread], [dvdread input module], [auto])
 
 dnl
-dnl  libdvdnav plugin
+dnl libdvdnav plugin
 dnl
 AC_ARG_ENABLE(dvdnav,
   [  --enable-dvdnav         dvdnav input module (default enabled)])
index 5edf909fb868641d8822a3eea9bcb826f244c6fb..e703abc315ef1758e609aa52f7171383826a99bb 100644 (file)
 
 #include <sys/types.h>
 
-#ifdef HAVE_DVDREAD_DVD_READER_H
-  #include <dvdread/dvd_reader.h>
-  #include <dvdread/ifo_types.h>
-  #include <dvdread/ifo_read.h>
-  #include <dvdread/nav_read.h>
-  #include <dvdread/nav_print.h>
-#else
-  #include <libdvdread/dvd_reader.h>
-  #include <libdvdread/ifo_types.h>
-  #include <libdvdread/ifo_read.h>
-  #include <libdvdread/nav_read.h>
-  #include <libdvdread/nav_print.h>
-#endif
+#include <dvdread/dvd_reader.h>
+#include <dvdread/ifo_types.h>
+#include <dvdread/ifo_read.h>
+#include <dvdread/nav_read.h>
+#include <dvdread/nav_print.h>
 
 #include <assert.h>