Commit b08376be authored by Stéphane Borel's avatar Stéphane Borel

*Merged hh patch in libdvdcss from main tree.

*Updated local libdvdread, so that it does not depend on libdvdcss
(ala dummy_dvdcss) and modified configure to reflect changes.
parent b7ee1eea
......@@ -6286,6 +6286,7 @@ if test "${with_dvdcss+set}" = set; then
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
fi
;;
......@@ -6298,6 +6299,7 @@ if test "${with_dvdcss+set}" = set; then
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} -Llib -ldvdcss"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L../../lib -ldvdcss"
LIB_DVDREAD="${LIB_DVD} -Llib -ldvdread -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L../../lib -ldvdcss"
fi
;;
......@@ -6310,6 +6312,7 @@ if test "${with_dvdcss+set}" = set; then
CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
LIB_DVD="${LIB_DVD} -ldl"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
;;
*)
......@@ -6323,7 +6326,8 @@ if test "${with_dvdcss+set}" = set; then
fi
LIB_DVD="${LIB_DVD} -ldvdcss"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldvdcss"
LIB_DVDREAD="${LIB_DVDREAD} -ldvdread -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldvdread -ldvdcss"
esac
else
# user didn't decide, we choose to use local libdvdcss and link statically
......@@ -6336,7 +6340,8 @@ else
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdread.a ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
else
# XXX: no check for libdl is done, don't try this at home !
DUMMY_LIBDVDCSS=1
......@@ -6345,6 +6350,7 @@ else
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
LIB_DVD="${LIB_DVD} -ldl"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
fi
fi
......@@ -6355,11 +6361,8 @@ if test "${enable_dvdread+set}" = set; then
enableval="$enable_dvdread"
if test x$enableval = xyes
then
NEED_LIBDVDCSS=1
STATIC_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a"
CFLAGS_DVDREAD="${CFLAGS_DVD} ${CFLAGS_DVDREAD} -I../../extras/libdvdread"
fi
fi
......@@ -6374,7 +6377,7 @@ fi
if test x$enable_vcd != xno
then
cat > conftest.$ac_ext <<EOF
#line 6378 "configure"
#line 6381 "configure"
#include "confdefs.h"
#include <linux/cdrom.h>
EOF
......@@ -6448,17 +6451,17 @@ if test "${with_mad+set}" = set; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6452: checking for $ac_hdr" >&5
echo "configure:6455: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6457 "configure"
#line 6460 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:6465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -6488,7 +6491,7 @@ fi
done
echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
echo "configure:6492: checking for mad_bit_init in -lmad" >&5
echo "configure:6495: checking for mad_bit_init in -lmad" >&5
ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -6496,7 +6499,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lmad $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6500 "configure"
#line 6503 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
......@@ -6507,7 +6510,7 @@ int main() {
mad_bit_init()
; return 0; }
EOF
if { (eval echo configure:6511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:6514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
......@@ -6574,7 +6577,7 @@ if test "${enable_esd+set}" = set; then
# Extract the first word of "esd-config", so it can be a program name with args.
set dummy esd-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:6578: checking for $ac_word" >&5
echo "configure:6581: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -6625,7 +6628,7 @@ if test "${enable_arts+set}" = set; then
# Extract the first word of "artsc-config", so it can be a program name with args.
set dummy artsc-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:6629: checking for $ac_word" >&5
echo "configure:6632: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -6683,17 +6686,17 @@ else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6687: checking for $ac_hdr" >&5
echo "configure:6690: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6692 "configure"
#line 6695 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:6700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -6738,17 +6741,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6742: checking for $ac_hdr" >&5
echo "configure:6745: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6747 "configure"
#line 6750 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:6755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -6836,7 +6839,7 @@ fi
# Extract the first word of "sdl12-config", so it can be a program name with args.
set dummy sdl12-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:6840: checking for $ac_word" >&5
echo "configure:6843: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -6876,7 +6879,7 @@ fi
# Extract the first word of "sdl11-config", so it can be a program name with args.
set dummy sdl11-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:6880: checking for $ac_word" >&5
echo "configure:6883: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -6917,7 +6920,7 @@ fi
# Extract the first word of "sdl-config", so it can be a program name with args.
set dummy sdl-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:6921: checking for $ac_word" >&5
echo "configure:6924: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -6963,17 +6966,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6967: checking for $ac_hdr" >&5
echo "configure:6970: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6972 "configure"
#line 6975 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:6980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -7043,17 +7046,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7047: checking for $ac_hdr" >&5
echo "configure:7050: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7052 "configure"
#line 7055 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -7082,7 +7085,7 @@ done
else
echo $ac_n "checking for directX headers in ${withval}""... $ac_c" 1>&6
echo "configure:7086: checking for directX headers in ${withval}" >&5
echo "configure:7089: checking for directX headers in ${withval}" >&5
if test -f ${withval}/include/directx.h
then
PLUGINS="${PLUGINS} directx"
......@@ -7179,7 +7182,7 @@ if test "${enable_gnome+set}" = set; then
# Extract the first word of "gnome-config", so it can be a program name with args.
set dummy gnome-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7183: checking for $ac_word" >&5
echo "configure:7186: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7224,17 +7227,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7228: checking for $ac_hdr" >&5
echo "configure:7231: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7233 "configure"
#line 7236 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -7294,7 +7297,7 @@ fi
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7298: checking for $ac_word" >&5
echo "configure:7301: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7344,17 +7347,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7348: checking for $ac_hdr" >&5
echo "configure:7351: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7353 "configure"
#line 7356 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -7411,17 +7414,17 @@ if test x$enable_x11 != xno &&
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7415: checking for $ac_hdr" >&5
echo "configure:7418: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7420 "configure"
#line 7423 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -7474,17 +7477,17 @@ if test x$enable_xvideo != xno &&
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7478: checking for $ac_hdr" >&5
echo "configure:7481: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7483 "configure"
#line 7486 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -7508,7 +7511,7 @@ EOF
saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
echo $ac_n "checking for XvSetPortAttribute in -lXv_pic""... $ac_c" 1>&6
echo "configure:7512: checking for XvSetPortAttribute in -lXv_pic" >&5
echo "configure:7515: checking for XvSetPortAttribute in -lXv_pic" >&5
ac_lib_var=`echo Xv_pic'_'XvSetPortAttribute | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -7516,7 +7519,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXv_pic $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7520 "configure"
#line 7523 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
......@@ -7527,7 +7530,7 @@ int main() {
XvSetPortAttribute()
; return 0; }
EOF
if { (eval echo configure:7531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
......@@ -7571,17 +7574,17 @@ if test "${enable_alsa+set}" = set; then
then
ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
echo "configure:7575: checking for alsa/asoundlib.h" >&5
echo "configure:7578: checking for alsa/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7580 "configure"
#line 7583 "configure"
#include "confdefs.h"
#include <alsa/asoundlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -7598,7 +7601,7 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
echo "configure:7602: checking for main in -lasound" >&5
echo "configure:7605: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -7606,14 +7609,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7610 "configure"
#line 7613 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if { (eval echo configure:7617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:7620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
......
......@@ -767,6 +767,7 @@ AC_ARG_WITH(dvdcss,
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
fi
;;
......@@ -779,6 +780,7 @@ AC_ARG_WITH(dvdcss,
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} -Llib -ldvdcss"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L../../lib -ldvdcss"
LIB_DVDREAD="${LIB_DVD} -Llib -ldvdread -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L../../lib -ldvdcss"
fi
;;
......@@ -791,6 +793,7 @@ AC_ARG_WITH(dvdcss,
CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
LIB_DVD="${LIB_DVD} -ldl"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
;;
*)
......@@ -804,7 +807,8 @@ AC_ARG_WITH(dvdcss,
fi
LIB_DVD="${LIB_DVD} -ldvdcss"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldvdcss"
LIB_DVDREAD="${LIB_DVDREAD} -ldvdread -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldvdread -ldvdcss"
esac ],
# user didn't decide, we choose to use local libdvdcss and link statically
# if libdvdcss is in the archive, or to use the dummy replacement otherwise.
......@@ -816,7 +820,8 @@ AC_ARG_WITH(dvdcss,
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdread.a ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
else
# XXX: no check for libdl is done, don't try this at home !
DUMMY_LIBDVDCSS=1
......@@ -825,6 +830,7 @@ AC_ARG_WITH(dvdcss,
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
LIB_DVD="${LIB_DVD} -ldl"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
fi ])
......@@ -835,11 +841,8 @@ AC_ARG_ENABLE(dvdread,
[ --enable-dvdread Enable dvdread support (default disabled)],
[ if test x$enableval = xyes
then
NEED_LIBDVDCSS=1
STATIC_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a"
CFLAGS_DVDREAD="${CFLAGS_DVD} ${CFLAGS_DVDREAD} -I../../extras/libdvdread"
fi ])
dnl
......
......@@ -2,7 +2,7 @@
* css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: css.c,v 1.21 2002/01/21 07:00:21 gbazin Exp $
* $Id: css.c,v 1.22 2002/01/23 03:15:31 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
* Hkan Hjort <d95hjort@dtek.chalmers.se>
......@@ -54,6 +54,7 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int CSSAuth ( dvdcss_handle dvdcss );
static int CSSGetASF ( dvdcss_handle dvdcss );
static void CSSCryptKey ( int i_key_type, int i_varient,
u8 const * p_challenge, u8* p_key );
......@@ -92,55 +93,56 @@ int CSSTest( dvdcss_handle dvdcss )
}
/*****************************************************************************
* CSSAuth : CSS Structure initialisation and DVD authentication.
* CSSAuth : DVD CSS authentication.
*****************************************************************************
* It simulates the mutual authentication between logical unit and host.
* Since we don't need the disc key to find the title key, we just run the
* basic unavoidable commands to authenticate device and disc.
* It simulates the mutual authentication between logical unit and host,
* and stops when a session key (called bus key) has been established.
* Always do the full auth sequence. Some drives seem to lie and always
* respond with ASF=1. For instance the old DVD roms on Compaq Armada says
* that ASF=1 from the start and then later fail with a 'read of scrambled
* block without authentication' error.
*****************************************************************************/
int CSSAuth( dvdcss_handle dvdcss )
static int CSSAuth( dvdcss_handle dvdcss )
{
/* structures defined in cdrom.h or dvdio.h */
unsigned char p_buffer[10];
char psz_warning[48];
int i_ret = -1;
int i;
dvdcss->css.i_agid = 0;
/* Test authentication success */
switch( CSSGetASF( dvdcss ) )
u8 p_buffer[10];
u8 p_challenge[2*KEY_SIZE];
dvd_key_t p_key1;
dvd_key_t p_key2;
dvd_key_t p_key_check;
u8 i_varient = 0;
char psz_warning[48];
int i_ret = -1;
int i;
/* So this isn't really necessary except for debuging. */
if( CSSGetASF( dvdcss ) < 0 )
{
case -1:
return -1;
case 1:
_dvdcss_debug( dvdcss, "already authenticated" );
break;
case 0:
_dvdcss_debug( dvdcss, "need to authenticate" );
break;
_dvdcss_error( dvdcss, "fatal error in CSSAuth" );
// ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
return -1;
}
/* Init sequence, request AGID */
for( i = 1; i < 4 ; ++i )
{
snprintf( psz_warning, sizeof(psz_warning), "requesting AGID %d", i );
_dvdcss_debug( dvdcss, psz_warning );
_dvdcss_debug( dvdcss, "requesting AGID" );
i_ret = ioctl_ReportAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
i_ret = ioctl_ReportAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
if( i_ret != -1 )
{
/* No error during ioctl: we know the device is authenticated */
break;
}
_dvdcss_error( dvdcss, "ioctl_ReportAgid failed, invalidating" );
dvdcss->css.i_agid = 0;
/* We might have to reset hung authentication processes in the drive
by invalidating the corresponding AGID'. As long as we haven't got
an AGID, invalidate one (in sequence) and try again. */
for( i = 0; i_ret == -1 && i < 4 ; ++i )
{
_dvdcss_debug( dvdcss, "ioctl_ReportAgid failed" );
sprintf( psz_warning, "invalidating AGID %d", i );
_dvdcss_debug( dvdcss, psz_warning );
/* This is really _not good_, should be handled by the OS.
Invalidating an AGID could make another process fail some
where in it's authentication process. */
dvdcss->css.i_agid = i;
ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
_dvdcss_debug( dvdcss, "requesting AGID" );
i_ret = ioctl_ReportAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
}
/* Unable to authenticate without AGID */
......@@ -150,21 +152,23 @@ int CSSAuth( dvdcss_handle dvdcss )
return -1;
}
/* Setup a challenge, any valuse should work */
for( i = 0 ; i < 10; ++i )
{
dvdcss->css.disc.p_challenge[i] = i;
p_challenge[i] = i;
}
/* Get challenge from host */
for( i = 0 ; i < 10 ; ++i )
{
p_buffer[9-i] = dvdcss->css.disc.p_challenge[i];
p_buffer[9-i] = p_challenge[i];
}
/* Send challenge to LU */
if( ioctl_SendChallenge( dvdcss->i_fd, &dvdcss->css.i_agid, p_buffer ) < 0 )
{
_dvdcss_error( dvdcss, "ioctl_SendChallenge failed" );
// ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
return -1;
}
......@@ -172,27 +176,26 @@ int CSSAuth( dvdcss_handle dvdcss )