Commit 61617b87 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Contribs: add dvdread

parent ecd8f220
Index: dvdread/configure.ac
===================================================================
--- dvdread/configure.ac (revision 1162)
+++ dvdread/configure.ac (working copy)
@@ -137,27 +137,59 @@
dnl ---------------------------------------------
dnl dynamic linker
dnl ---------------------------------------------
-case $host in
- *mingw32*)
- CFLAGS="-idirafter \$(top_srcdir)/msvc/include $CFLAGS"
- LDFLAGS="-no-undefined $LDFLAGS"
- ;;
- *cygwin*)
- LDFLAGS="-no-undefined $LDFLAGS"
- ;;
- *os2*)
- LDFLAGS="-no-undefined -Zbin-files $LDFLAGS"
- ;;
- *)
- AC_CHECK_LIB(c, dlopen,
- DYNAMIC_LD_LIBS="",
- AC_CHECK_LIB(dl, dlopen,
- DYNAMIC_LD_LIBS="-ldl",
- AC_MSG_ERROR(dynamic linker needed)))
- AC_SUBST(DYNAMIC_LD_LIBS)
- ;;
-esac
+AC_ARG_WITH( [libdvdcss],
+ [ --with-libdvdcss[=PATH] force linking against libdvdcss],
+ [if test x"$withval" != xno; then
+ link_dvdcss=yes
+ fi
+ if test x"$withval" != xyes; then
+ dvdcss_path=$withval
+ fi])
+if test x"$link_dvdcss" != xyes; then
+dnl dlopen libdvdcss
+ AC_CHECK_FUNC( dlopen,
+ [DL_LIBS="" ],
+ AC_CHECK_LIB( dl, dlopen,
+ [DL_LIBS=-ld ],
+ AC_MSG_ERROR(You need libdl (dlopen))
+ )
+ )
+else
+dnl link with libdvdcss
+ if test -z "$dvdcss_path"; then
+ AC_CHECK_LIB(dvdcss, dvdcss_interface_2,
+ [ CSS_LIBS=-ldvdcss ],
+ AC_MSG_ERROR(You need libdvdcss.so.2 or later)
+ )
+ AC_CHECK_HEADERS(dvdcss/dvdcss.h,
+ [ ],
+ AC_MSG_ERROR(You need libdvdcss (dvdcss.h))
+ )
+ else
+ saved_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -L$dvdcss_path/lib"
+ AC_CHECK_LIB(dvdcss, dvdcss_interface_2,
+ [ CSS_LIBS="-L$dvdcss_path/lib -R$dvdcss_path/lib -ldvdcss"
+ CSS_CFLAGS=-I$dvdcss_path/include ],
+ AC_MSG_ERROR(You need libdvdcss.so.2 or later)
+ )
+ CFLAGS=$saved_CFLAGS
+ dnl -w added to shutup GCC3.1's cpp warning about -I/usr/local
+ saved_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="-w $CPPFLAGS -I$dvdcss_path/include"
+ AC_CHECK_HEADERS(dvdcss/dvdcss.h,
+ [ ],
+ AC_MSG_ERROR(You need libdvdcss (dvdcss.h))
+ )
+ CPPFLAGS=$saved_CPPFLAGS
+ fi
+fi
+
+AC_SUBST(DL_LIBS)
+AC_SUBST(CSS_LIBS)
+AC_SUBST(CSS_CFLAGS)
+
dnl ---------------------------------------------
dnl cflags
dnl ---------------------------------------------
Index: dvdread/src/dvd_reader.c
===================================================================
--- dvdread/src/dvd_reader.c (revision 1157)
+++ dvdread/src/dvd_reader.c (working copy)
@@ -34,6 +34,7 @@
#include <limits.h>
#include <dirent.h>
+#if 0
/* misc win32 helpers */
#ifdef WIN32
#ifndef HAVE_GETTIMEOFDAY
@@ -52,6 +53,7 @@
#include <io.h> /* read() */
#define lseek64 _lseeki64
#endif
+#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__)
#define SYS_BSD 1
Index: dvdread/src/dvdread/ifo_types.h
===================================================================
--- dvdread/src/dvdread/ifo_types.h (révision 1188)
+++ dvdread/src/dvdread/ifo_types.h (copie de travail)
@@ -32,7 +32,7 @@
#if defined(__GNUC__)
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
+#define ATTRIBUTE_PACKED __attribute__ ((packed,gcc_struct))
#define PRAGMA_PACK 0
#endif
#endif
# DVDREAD
$(TARBALLS)/dvdread-svn.tar.xz:
rm -Rf dvdread-svn
$(SVN) export svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread dvdread-svn
tar cvJ dvdread-svn > $@
.sum-dvdread: dvdread-svn.tar.xz
$(warning Integrity check skipped.)
touch $@
dvdread: dvdread-svn.tar.xz .sum-dvdread
$(UNPACK)
$(APPLY) $(SRC)/dvdread/dvdread-css-static.patch
ifdef HAVE_WIN32
$(APPLY) $(SRC)/dvdread/dvdread-win32.patch
endif
$(MOVE)
DEPS_dvdread = dvdcss
.dvdread: dvdread .dvdcss
cd $< && sh autogen.sh noconfig
cd $< && $(HOSTVARS) ./configure $(HOSTCONF) --with-libdvdcss=$(PREFIX)
cd $< && SUBDIRS="src misc m4" $(MAKE) install
touch $@
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