libdvdread.patch 2.37 KB
Newer Older
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1
2
Index: configure.ac
===================================================================
hartman's avatar
hartman committed
3
--- configure.ac	(revision 1157)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
4
+++ configure.ac	(working copy)
hartman's avatar
hartman committed
5
@@ -137,27 +137,59 @@
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
6
7
8
9
10
11
12
13
14
15
16
 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"
-    ;;
hartman's avatar
hartman committed
17
18
19
-  *os2*)
-    LDFLAGS="-no-undefined -Zbin-files $LDFLAGS"
-    ;;
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
20
21
-  *)
-    AC_CHECK_LIB(c, dlopen,
hartman's avatar
hartman committed
22
23
24
25
-                 DYNAMIC_LD_LIBS="",
-                 AC_CHECK_LIB(dl, dlopen,
-                              DYNAMIC_LD_LIBS="-ldl",
-                              AC_MSG_ERROR(dynamic linker needed)))
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
-    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 ---------------------------------------------