Commit 20ff5191 authored by Sam Hocevar's avatar Sam Hocevar

  * Added BSD/OS libdvd by Steven M. Schultz <sms@TO.GD-ES.COM> in
    extras/BSDI_dvdioctl after he suggested it. License is GPL.
  * ./configure now checks for an installed libdvd under BSD/OS and
    falls back to ours if not found.
  * Fixed harmless typos in yesterday's Solaris libdvd patches.
  * Bumped libdvdcss version number up to 0.0.3 ; release will probably
    follow once the BSDI changes have been tested.
parent 301cde4d
......@@ -4,6 +4,12 @@
HEAD
* Added BSD/OS libdvd by Steven M. Schultz <sms@TO.GD-ES.COM> in
extras/BSDI_dvdioctl after he suggested us to do so. License is GPL.
* ./configure now checks for an installed libdvd under BSD/OS and
falls back to ours if not found.
* Fixed harmless typos in yesterday's Solaris libdvd patches.
* Bumped libdvdcss version number up to 0.0.3.
* Added vlc:loop playlist command to go back at the beginning.
Usage: vlc file1.mpeg file2.mpeg ... fileN.mpeg vlc:loop
* Fixed a bug in the gtk interface which caused vlc to go amok after
......
......@@ -50,7 +50,7 @@ C_OBJ := $(INTERFACE:%=src/interface/%.o) \
#
# Misc Objects
#
ifeq ($(GETOPT),1)
ifeq ($(NEED_GETOPT),1)
C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
endif
......
......@@ -39,7 +39,6 @@ STATS = @STATS@
TRACE = @TRACE@
PROFILING = @PROFILING@
OPTIMS = @OPTIMS@
GETOPT = @GETOPT@
#
# Build environment
......@@ -92,14 +91,22 @@ LIB_YUV = @LIB_YUV@
# CFLAGS for special cases
#
CFLAGS_DVD = @CFLAGS_DVD@
CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
CFLAGS_GTK = @CFLAGS_GTK@
CFLAGS_SDL = @CFLAGS_SDL@
CFLAGS_X11 = @CFLAGS_X11@
#
# Other special cases
# Additional objects
#
OBJ_DVD = @OBJ_DVD@
OBJ_LIBDVDCSS = @OBJ_LIBDVDCSS@
#
# Other special cases
#
NEED_GETOPT = @NEED_GETOPT@
NEED_BSDI_LIBDVD = @NEED_BSDI_LIBDVD@
LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
###############################################################################
......
......@@ -644,7 +644,7 @@ fi
HAVE_LIBDVDCSS=0
if test -r extras/libdvdcss/libdvdcss.c; then
HAVE_LIBDVDCSS=1
LIBDVDCSS_VERSION=0.0.2
LIBDVDCSS_VERSION=0.0.3
fi
......@@ -1903,7 +1903,7 @@ fi
done
GETOPT=0
NEED_GETOPT=0
echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
echo "configure:1909: checking for getopt_long" >&5
if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
......@@ -1995,7 +1995,7 @@ EOF
LIB="${LIB} -lgnugetopt"
else
echo "$ac_t""no" 1>&6
GETOPT=1
NEED_GETOPT=1
fi
fi
......@@ -2388,53 +2388,13 @@ else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for dvd_cdrom_ioctl in -ldvd""... $ac_c" 1>&6
echo "configure:2393: checking for dvd_cdrom_ioctl in -ldvd" >&5
ac_lib_var=`echo dvd'_'dvd_cdrom_ioctl | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldvd $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2401 "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
builtin and then its argument prototype would still apply. */
char dvd_cdrom_ioctl();
int main() {
dvd_cdrom_ioctl()
; return 0; }
EOF
if { (eval echo configure:2412: \"$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
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
else
echo "$ac_t""no" 1>&6
fi
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
CFLAGS="${CFLAGS} -I/usr/local/include"
PTHREAD_LIBS=error
echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
echo "configure:2438: checking for pthread_attr_init in -lpthread" >&5
echo "configure:2398: checking for pthread_attr_init in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_attr_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
......@@ -2442,7 +2402,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2446 "configure"
#line 2406 "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
......@@ -2453,7 +2413,7 @@ int main() {
pthread_attr_init()
; return 0; }
EOF
if { (eval echo configure:2457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2417: \"$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
......@@ -2475,7 +2435,7 @@ fi
if test "x${THREAD_LIB}" = xerror; then
echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
echo "configure:2479: checking for pthread_attr_init in -lpthreads" >&5
echo "configure:2439: checking for pthread_attr_init in -lpthreads" >&5
ac_lib_var=`echo pthreads'_'pthread_attr_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
......@@ -2483,7 +2443,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthreads $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2487 "configure"
#line 2447 "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
......@@ -2494,7 +2454,7 @@ int main() {
pthread_attr_init()
; return 0; }
EOF
if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2458: \"$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
......@@ -2517,7 +2477,7 @@ fi
fi
if test "x${THREAD_LIB}" = xerror; then
echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
echo "configure:2521: checking for pthread_attr_init in -lc_r" >&5
echo "configure:2481: checking for pthread_attr_init in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_attr_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
......@@ -2525,7 +2485,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2529 "configure"
#line 2489 "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
......@@ -2536,7 +2496,7 @@ int main() {
pthread_attr_init()
; return 0; }
EOF
if { (eval echo configure:2540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2500: \"$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
......@@ -2560,12 +2520,12 @@ fi
if test "x${THREAD_LIB}" = xerror; then
THREAD_LIBS=""
echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
echo "configure:2564: checking for pthread_attr_init" >&5
echo "configure:2524: checking for pthread_attr_init" >&5
if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2569 "configure"
#line 2529 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_attr_init(); below. */
......@@ -2588,7 +2548,7 @@ pthread_attr_init();
; return 0; }
EOF
if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_pthread_attr_init=yes"
else
......@@ -2610,7 +2570,7 @@ fi
fi
cat > conftest.$ac_ext <<EOF
#line 2614 "configure"
#line 2574 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
......@@ -2626,7 +2586,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 2630 "configure"
#line 2590 "configure"
#include "confdefs.h"
#include <strings.h>
EOF
......@@ -2646,17 +2606,17 @@ for ac_hdr in stddef.h getopt.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2650: checking for $ac_hdr" >&5
echo "configure:2610: 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 2655 "configure"
#line 2615 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2620: \"$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*
......@@ -2686,17 +2646,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2690: checking for $ac_hdr" >&5
echo "configure:2650: 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 2695 "configure"
#line 2655 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2660: \"$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*
......@@ -2726,17 +2686,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2730: checking for $ac_hdr" >&5
echo "configure:2690: 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 2735 "configure"
#line 2695 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2700: \"$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*
......@@ -2766,17 +2726,17 @@ for ac_hdr in dlfcn.h image.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2770: checking for $ac_hdr" >&5
echo "configure:2730: 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 2775 "configure"
#line 2735 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2740: \"$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*
......@@ -2806,17 +2766,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2810: checking for $ac_hdr" >&5
echo "configure:2770: 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 2815 "configure"
#line 2775 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2780: \"$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*
......@@ -2846,17 +2806,17 @@ for ac_hdr in machine/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2850: checking for $ac_hdr" >&5
echo "configure:2810: 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 2855 "configure"
#line 2815 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2820: \"$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*
......@@ -2887,17 +2847,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2891: checking for $ac_hdr" >&5
echo "configure:2851: 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 2896 "configure"
#line 2856 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2861: \"$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*
......@@ -2926,9 +2886,9 @@ done
CFLAGS="${save_CFLAGS} -Wall -Werror"
echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
echo "configure:2930: checking for ntohl in sys/param.h" >&5
echo "configure:2890: checking for ntohl in sys/param.h" >&5
cat > conftest.$ac_ext <<EOF
#line 2932 "configure"
#line 2892 "configure"
#include "confdefs.h"
#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }
......@@ -2936,7 +2896,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define NTOHL_IN_SYS_PARAM_H 1
......@@ -2953,16 +2913,16 @@ rm -f conftest*
CFLAGS="${save_CFLAGS} -finline-limit=31337"
echo $ac_n "checking if \$CC accepts -finline-limit""... $ac_c" 1>&6
echo "configure:2957: checking if \$CC accepts -finline-limit" >&5
echo "configure:2917: checking if \$CC accepts -finline-limit" >&5
cat > conftest.$ac_ext <<EOF
#line 2959 "configure"
#line 2919 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
save_CFLAGS="${save_CFLAGS} -finline-limit=31337"; echo "$ac_t""yes" 1>&6
else
......@@ -2975,16 +2935,16 @@ rm -f conftest*
CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
echo $ac_n "checking if \$CC accepts -bundle -undefined suppress""... $ac_c" 1>&6
echo "configure:2979: checking if \$CC accepts -bundle -undefined suppress" >&5
echo "configure:2939: checking if \$CC accepts -bundle -undefined suppress" >&5
cat > conftest.$ac_ext <<EOF
#line 2981 "configure"
#line 2941 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; echo "$ac_t""yes" 1>&6
else
......@@ -2997,16 +2957,16 @@ rm -f conftest*
CFLAGS="${save_CFLAGS} -shared"
echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6
echo "configure:3001: checking if \$CC accepts -shared" >&5
echo "configure:2961: checking if \$CC accepts -shared" >&5
cat > conftest.$ac_ext <<EOF
#line 3003 "configure"
#line 2963 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:3010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
PLCFLAGS="${PLCFLAGS} -shared"; echo "$ac_t""yes" 1>&6
else
......@@ -3021,16 +2981,16 @@ if test x"${SOFLAGS}" = x; then
try_SOFLAGS="-Wl,-soname -Wl,"
LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
echo $ac_n "checking if linker accepts ${try_SOFLAGS}foo.so.0""... $ac_c" 1>&6
echo "configure:3025: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5
echo "configure:2985: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5
cat > conftest.$ac_ext <<EOF
#line 3027 "configure"
#line 2987 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:3034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
SOFLAGS="${try_SOFLAGS}"; echo "$ac_t""yes" 1>&6
else
......@@ -3046,16 +3006,16 @@ if test x"${SOFLAGS}" = x; then
try_SOFLAGS="-Wl,-h -Wl,"
LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
echo $ac_n "checking if linker accepts ${try_SOFLAGS}foo.so.0""... $ac_c" 1>&6
echo "configure:3050: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5
echo "configure:3010: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5
cat > conftest.$ac_ext <<EOF
#line 3052 "configure"
#line 3012 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:3059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:3019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
SOFLAGS="${try_SOFLAGS}"; echo "$ac_t""yes" 1>&6
else
......@@ -3071,9 +3031,9 @@ CFLAGS="${save_CFLAGS}"
LDFLAGS="${save_LDFLAGS}"
echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
echo "configure:3075: checking for boolean_t in sys/types.h" >&5
echo "configure:3035: checking for boolean_t in sys/types.h" >&5
cat > conftest.$ac_ext <<EOF
#line 3077 "configure"
#line 3037 "configure"
#include "confdefs.h"
#include <sys/types.h>
void quux() { boolean_t foo; }
......@@ -3081,7 +3041,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:3085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define BOOLEAN_T_IN_SYS_TYPES_H 1
......@@ -3096,9 +3056,9 @@ else
fi
rm -f conftest*
echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
echo "configure:3100: checking for boolean_t in pthread.h" >&5
echo "configure:3060: checking for boolean_t in pthread.h" >&5
cat > conftest.$ac_ext <<EOF
#line 3102 "configure"
#line 3062 "configure"
#include "confdefs.h"
#include <pthread.h>
void quux() { boolean_t foo; }
......@@ -3106,7 +3066,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:3110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define BOOLEAN_T_IN_PTHREAD_H 1
......@@ -3122,12 +3082,12 @@ fi
rm -f conftest*
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:3126: checking for working const" >&5
echo "configure:3086: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3131 "configure"
#line 3091 "configure"
#include "confdefs.h"
int main() {
......@@ -3176,7 +3136,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:3180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
......@@ -3197,12 +3157,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:3201: checking for ANSI C header files" >&5
echo "configure:3161: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3206 "configure"
#line 3166 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
......@@ -3210,7 +3170,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3174: \"$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*
......@@ -3227,7 +3187,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 3231 "configure"
#line 3191 "configure"
#include "confdefs.h"
#include <string.h>
EOF
......@@ -3245,7 +3205,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 3249 "configure"
#line 3209 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
......@@ -3266,7 +3226,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 3270 "configure"
#line 3230 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
......@@ -3277,7 +3237,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:3281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
......@@ -3301,12 +3261,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:3305: checking for size_t" >&5
echo "configure:3265: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3310 "configure"
#line 3270 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
......@@ -3334,12 +3294,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:3338: checking whether time.h and sys/time.h may both be included" >&5
echo "configure:3298: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3343 "configure"
#line 3303 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
......@@ -3348,7 +3308,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:3352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
......@@ -3378,16 +3338,16 @@ MMX_MODULES="yuvmmx idctmmx motionmmx"
MMXEXT_MODULES="idctmmxext motionmmxext imdct3dn imdctsse downmix3dn downmixsse"
echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
echo "configure:3382: checking if \$CC groks MMX inline assembly" >&5
echo "configure:3342: checking if \$CC groks MMX inline assembly" >&5
cat > conftest.$ac_ext <<EOF
#line 3384 "configure"
#line 3344 "configure"
#include "confdefs.h"
void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}
int main() {
; return 0; }
EOF
if { (eval echo configure:3391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
echo "$ac_t""yes" 1>&6
......@@ -3400,16 +3360,16 @@ fi
rm -f conftest*
echo $ac_n "checking if \$CC groks MMX EXT or SSE inline assembly""... $ac_c" 1>&6
echo "configure:3404: checking if \$CC groks MMX EXT or SSE inline assembly" >&5
echo "configure:3364: checking if \$CC groks MMX EXT or SSE inline assembly" >&5
cat > conftest.$ac_ext <<EOF
#line 3406 "configure"
#line 3366 "configure"
#include "confdefs.h"
void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}
int main() {
; return 0; }
EOF
if { (eval echo configure:3413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
echo "$ac_t""yes" 1>&6
......@@ -3428,17 +3388,17 @@ for ac_hdr in winioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3432: checking for $ac_hdr" >&5
echo "configure:3392: 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 3437 "configure"
#line 3397 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3402: \"$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*
......@@ -3471,17 +3431,17 @@ for ac_hdr in sys/ioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3475: checking for $ac_hdr" >&5
echo "configure:3435: 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 3480 "configure"
#line 3440 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3445: \"$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*
......@@ -3507,17 +3467,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3511: checking for $ac_hdr" >&5
echo "configure:3471: 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 3516 "configure"
#line 3476 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3481: \"$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*
......@@ -3546,7 +3506,7 @@ done
BSD_DVD_STRUCT=0
LINUX_DVD_STRUCT=0
cat > conftest.$ac_ext <<EOF
#line 3550 "configure"
#line 3510 "configure"
#include "confdefs.h"
#include <sys/dvdio.h>
EOF
......@@ -3564,7 +3524,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 3568 "configure"
#line 3528 "configure"
#include "confdefs.h"
#include <sys/cdio.h>
EOF
......@@ -3582,7 +3542,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 3586 "configure"
#line 3546 "configure"
#include "confdefs.h"
#include <linux/cdrom.h>
EOF
......@@ -3599,8 +3559,9 @@ EOF
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 3604 "configure"
NEED_BSDI_LIBDVD=0
cat > conftest.$ac_ext <<EOF
#line 3565 "configure"
#include "confdefs.h"
#include <dvd.h>
EOF
......@@ -3613,23 +3574,73 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
EOF
LINUX_DVD_STRUCT=1
OBJ_LIBDVDCSS="${OBJ_LIBDVDCSS} bsdi_dvdioctl.o"
LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
CFLAGS_LIBDVDCSS="${CFLAGS_LIBDVDCSS} -I../BSDI_ioctl"
else
rm -rf conftest*
for ac_hdr in /sys/dev/scsi/scsi_ioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3589: 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 3594 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3599: \"$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*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
NEED_BSDI_LIBDVD=1
LINUX_DVD_STRUCT=1
else
echo "$ac_t""no" 1>&6
fi
done
ac_safe=`echo "/usr/include/sys/scsi/scsi_types.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for /usr/include/sys/scsi/scsi_types.h""... $ac_c" 1>&6
echo "configure:3623: checking for /usr/include/sys/scsi/scsi_types.h" >&5
fi
rm -f conftest*
ac_safe=`echo "sys/scsi/scsi_types.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/scsi/scsi_types.h""... $ac_c" 1>&6
echo "configure:3634: checking for sys/scsi/scsi_types.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 3628 "configure"
#line 3639 "configure"
#include "confdefs.h"
#include </usr/include/sys/scsi/scsi_types.h>
#include <sys/scsi/scsi_types.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3644: \"$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*
......@@ -3648,17 +3659,17 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
ac_safe=`echo "sys/scsi/impl/uscsi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/scsi/impl/uscsi.h""... $ac_c" 1>&6
echo "configure:3652: checking for sys/scsi/impl/uscsi.h" >&5
echo "configure:3663: checking for sys/scsi/impl/uscsi.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 3657 "configure"
#line 3668 "configure"
#include "confdefs.h"
#include <sys/scsi/impl/uscsi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3673: \"$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*
......@@ -3799,7 +3810,7 @@ if test "${enable_pth+set}" = set; then
enableval="$enable_pth"
if test x$enableval = xyes; then
echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
echo "configure:3803: checking for pth_init in -lpth" >&5
echo "configure:3814: checking for pth_init in -lpth" >&5
ac_lib_var=`echo pth'_'pth_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
......@@ -3807,7 +3818,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpth $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3811 "configure"
#line 3822 "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
......@@ -3818,7 +3829,7 @@ int main() {
pth_init()
; return 0; }
EOF
if { (eval echo configure:3822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:3833: \"$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
......@@ -3846,7 +3857,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
#line 3850 "configure"
#line 3861 "configure"
#include "confdefs.h"
#include <pth.h>
EOF
......@@ -4010,7 +4021,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:4014: checking for $ac_word" >&5
echo "configure:4025: 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
......@@ -4077,17 +4088,17 @@ else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4081: checking for $ac_hdr" >&5
echo "configure:4092: 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 4086 "configure"
#line 4097 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4102: \"$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*
......@@ -4132,17 +4143,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4136: checking for $ac_hdr" >&5
echo "configure:4147: 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 4141 "configure"
#line 4152 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4157: \"$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*
......@@ -4210,7 +4221,7 @@ then
# 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:4214: checking for $ac_word" >&5
echo "configure:4225: 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
......@@ -4250,7 +4261,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:4254: checking for $ac_word" >&5
echo "configure:4265: 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
......@@ -4291,7 +4302,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:4295: checking for $ac_word" >&5
echo "configure:4306: 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
......@@ -4337,17 +4348,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4341: checking for $ac_hdr" >&5
echo "configure:4352: 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 4346 "configure"
#line 4357 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4362: \"$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*
......@@ -4410,17 +4421,17 @@ if test "${with_directx+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:4414: checking for $ac_hdr" >&5
echo "configure:4425: 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 4419 "configure"
#line 4430 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4435: \"$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*
......@@ -4458,17 +4469,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4462: checking for $ac_hdr" >&5
echo "configure:4473: 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 4467 "configure"
#line 4478 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4483: \"$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*
......@@ -4580,7 +4591,7 @@ then
# 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:4584: checking for $ac_word" >&5
echo "configure:4595: 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
......@@ -4625,17 +4636,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4629: checking for $ac_hdr" >&5
echo "configure:4640: 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 4634 "configure"
#line 4645 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4650: \"$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*
......@@ -4686,17 +4697,17 @@ if test x$enable_x11 != xno; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4690: checking for $ac_hdr" >&5
echo "configure:4701: 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 4695 "configure"
#line 4706 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4711: \"$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*
......@@ -4748,17 +4759,17 @@ if test x$enable_xvideo != xno; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4752: checking for $ac_hdr" >&5
echo "configure:4763: 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 4757 "configure"
#line 4768 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4773: \"$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*
......@@ -4798,17 +4809,17 @@ if test "${enable_alsa+set}" = set; then
then
ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
echo "configure:4802: checking for sys/asoundlib.h" >&5
echo "configure:4813: checking for sys/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 4807 "configure"
#line 4818 "configure"
#include "confdefs.h"
#include <sys/asoundlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4823: \"$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*
......@@ -4825,7 +4836,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:4829: checking for main in -lasound" >&5
echo "configure:4840: 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
......@@ -4833,14 +4844,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4837 "configure"
#line 4848 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4855: \"$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
......@@ -4929,6 +4940,9 @@ fi
......@@ -5099,7 +5113,8 @@ s%@ASM@%$ASM%g
s%@TRACE@%$TRACE%g
s%@PROFILING@%$PROFILING%g
s%@OPTIMS@%$OPTIMS%g
s%@GETOPT@%$GETOPT%g
s%@NEED_GETOPT@%$NEED_GETOPT%g
s%@NEED_BSDI_LIBDVD@%$NEED_BSDI_LIBDVD%g
s%@MOC@%$MOC%g
s%@WINDRES@%$WINDRES%g
s%@LCFLAGS@%$LCFLAGS%g
......@@ -5131,10 +5146,12 @@ s%@LIB_XVIDEO@%$LIB_XVIDEO%g
s%@LIB_YUV@%$LIB_YUV%g
s%@CFLAGS_VLC@%$CFLAGS_VLC%g
s%@CFLAGS_DVD@%$CFLAGS_DVD%g
s%@CFLAGS_LIBDVDCSS@%$CFLAGS_LIBDVDCSS%g
s%@CFLAGS_GTK@%$CFLAGS_GTK%g
s%@CFLAGS_SDL@%$CFLAGS_SDL%g
s%@CFLAGS_X11@%$CFLAGS_X11%g
s%@OBJ_DVD@%$OBJ_DVD%g
s%@OBJ_LIBDVDCSS@%$OBJ_LIBDVDCSS%g
s%@LOCAL_LIBDVDCSS@%$LOCAL_LIBDVDCSS%g
CEOF
......@@ -5373,7 +5390,7 @@ debug mode : ${DEBUG}
statistics : ${STATS}
trace mode : ${TRACE}
profiling : ${PROFILING}
need builtin getopt : ${GETOPT}
need builtin getopt : ${NEED_GETOPT}
built-in modules :${BUILTINS}
plugin modules :${PLUGINS}
vlc aliases :${ALIASES}"
......@@ -5386,6 +5403,7 @@ can be built : ${CAN_BUILD_LIBDVDCSS}
will be built : ${LOCAL_LIBDVDCSS}"
if test x${LOCAL_LIBDVDCSS} = x1
then
echo "need BSDI libdvd : ${NEED_BSDI_LIBDVD}"
echo "link statically : ${STATIC_LIBDVDCSS}"
else
echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
......
......@@ -16,7 +16,7 @@ fi
HAVE_LIBDVDCSS=0
if test -r extras/libdvdcss/libdvdcss.c; then
HAVE_LIBDVDCSS=1
LIBDVDCSS_VERSION=0.0.2
LIBDVDCSS_VERSION=0.0.3
AC_SUBST(LIBDVDCSS_VERSION)
fi
......@@ -62,18 +62,17 @@ AC_CHECK_FUNCS(swab)
AC_CHECK_FUNCS(sigrelse)
dnl Check for getopt
GETOPT=0
NEED_GETOPT=0
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB="${LIB} -lgnugetopt"],
[GETOPT=1])])
[NEED_GETOPT=1])])
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
AC_CHECK_LIB(m,pow,LIB_YUV="${LIB_YUV} -lm")
AC_CHECK_LIB(dvd,dvd_cdrom_ioctl,LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd")
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
CFLAGS="${CFLAGS} -I/usr/local/include"
......@@ -250,15 +249,27 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
dnl
dnl BSDI: dvd.h
dnl
NEED_BSDI_LIBDVD=0
AC_EGREP_HEADER(dvd_struct,dvd.h,[
AC_DEFINE(DVD_STRUCT_IN_DVD_H, 1,
Define if <dvd.h> defines DVD_STRUCT.)
LINUX_DVD_STRUCT=1
OBJ_LIBDVDCSS="${OBJ_LIBDVDCSS} bsdi_dvdioctl.o"
LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
CFLAGS_LIBDVDCSS="${CFLAGS_LIBDVDCSS} -I../BSDI_ioctl"
],[
dnl
dnl BSDI: /sys/dev/scsi/scsi_ioctl.h, using our own libdvd
dnl
AC_CHECK_HEADERS(/sys/dev/scsi/scsi_ioctl.h,[
NEED_BSDI_LIBDVD=1
LINUX_DVD_STRUCT=1
])
])
dnl
dnl Solaris: sys/scsi/generic/commands.h sys/scsi/impl/uscsi.h
dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
dnl
AC_CHECK_HEADER(/usr/include/sys/scsi/scsi_types.h,[
AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
AC_CHECK_HEADER(sys/scsi/impl/uscsi.h,[
AC_DEFINE(SOLARIS_USCSI, 1, Have userspace SCSI headers.)
])
......@@ -837,7 +848,8 @@ AC_SUBST(ASM)
AC_SUBST(TRACE)
AC_SUBST(PROFILING)
AC_SUBST(OPTIMS)
AC_SUBST(GETOPT)
AC_SUBST(NEED_GETOPT)
AC_SUBST(NEED_BSDI_LIBDVD)
AC_SUBST(MOC)
AC_SUBST(WINDRES)
......@@ -872,11 +884,13 @@ AC_SUBST(LIB_YUV)
AC_SUBST(CFLAGS_VLC)
AC_SUBST(CFLAGS_DVD)
AC_SUBST(CFLAGS_LIBDVDCSS)
AC_SUBST(CFLAGS_GTK)
AC_SUBST(CFLAGS_SDL)
AC_SUBST(CFLAGS_X11)
AC_SUBST(OBJ_DVD)
AC_SUBST(OBJ_LIBDVDCSS)
AC_SUBST(LOCAL_LIBDVDCSS)
......@@ -899,7 +913,7 @@ debug mode : ${DEBUG}
statistics : ${STATS}
trace mode : ${TRACE}
profiling : ${PROFILING}
need builtin getopt : ${GETOPT}
need builtin getopt : ${NEED_GETOPT}
built-in modules :${BUILTINS}
plugin modules :${PLUGINS}
vlc aliases :${ALIASES}"
......@@ -912,6 +926,7 @@ can be built : ${CAN_BUILD_LIBDVDCSS}
will be built : ${LOCAL_LIBDVDCSS}"
if test x${LOCAL_LIBDVDCSS} = x1
then
echo "need BSDI libdvd : ${NEED_BSDI_LIBDVD}"
echo "link statically : ${STATIC_LIBDVDCSS}"
else
echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
......
......@@ -15,7 +15,7 @@ Description: a free MPEG and DVD player
This is vlc, the VideoLAN Client. It plays MPEG and MPEG2 files,
DVDs, or MPEG streams from a network source.
Package: libdvdcss0.0.2
Package: libdvdcss0.0.3
Architecture: any
Depends: ${shlibs:Depends}
Description: a portable abstraction library for DVD decryption
......@@ -24,9 +24,9 @@ Description: a portable abstraction library for DVD decryption
.
This package contains the libdvdcss0 runtime library.
Package: libdvdcss0.0.2-dev
Package: libdvdcss0.0.3-dev
Architecture: any
Depends: libdvdcss0.0.2 (= ${Source-Version}), libc6-dev
Depends: libdvdcss0.0.3 (= ${Source-Version}), libc6-dev
Description: development files for libdvdcss0
libdvdcss is a portable abstraction library for DVD decryption, it
provides a simple API to access a DVD device as a block device.
......
......@@ -16,8 +16,8 @@ export PIXDIR="usr/share/pixmaps"
export GNOMEDIR="usr/share/gnome/apps/Multimedia"
# Library options
version=0.0.2
major=0
version=$(shell grep '^ *LIBDVDCSS_VERSION=' configure.in | cut -f2 -d=)
major=$(shell echo $(version) | cut -f1 -d.)
build: build-stamp
build-stamp:
......
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
all: libdvd.a libdvd.so blkreset
blkreset: libdvd.a blkreset.c
cc -O2 -g -o blkreset blkreset.c libdvd.a
dvdioctl.o: dvdioctl.c dvd.h
cc -O2 -g -c -I. dvdioctl.c
dvdioctl.po: dvdioctl.c dvd.h
cc -O2 -fPIC -DPIC -g -c -o dvdioctl.po -I. dvdioctl.c
libdvd.a: dvdioctl.o
ar rcv libdvd.a dvdioctl.o
libdvd.so: dvdioctl.po
cc -shared -o libdvd.so dvdioctl.po
install: libdvd.a libdvd.so blkreset
install -c -m 644 libdvd.a /usr/local/lib/libdvd.a
install -c -m 755 libdvd.so /usr/local/lib/libdvd.so
ranlib /usr/local/lib/libdvd.a
install -c -m 644 dvd.h /usr/local/include/dvd.h
install -c -m 755 blkreset /usr/local/bin/blkreset
clean:
rm -f *.a *.o *.so *.po blkreset
/*
* This is a (very) simple program to be used when the blocksize on a CDrom
* drive gets set to something other than 2048 (such as 2336 when ripping
* VCDs).
*
* Uses the 'cdrom_blocksize' routine from libdvd
*/
#include <stdio.h>
#include <err.h>
#include <fcntl.h>
main(int argc, char **argv)
{
int fd;
char *device = "/dev/rsr1c";
if (argc != 2)
errx(1, "raw device name of CDROM drive needed as arg");
device = argv[1];
fd = open(device, O_RDONLY, 0);
if (fd < 0)
err(1, "open(%s)", device);
if (cdrom_blocksize(fd, 2048))
errx(1, "cdrom_blocksize for %s failed\n", device);
exit(0);
}
#ifndef _DVD_H_
#define _DVD_H_
#include <sys/cdefs.h>
#include <machine/endian.h>
#include <sys/ioctl.h>
__BEGIN_DECLS
int dvd_cdrom_ioctl(int, unsigned long, void *);
int cdrom_blocksize(int, int);
void dvd_cdrom_debug(int);
__END_DECLS
#define ioctl(a,b,c) dvd_cdrom_ioctl((a),(b),(c))
typedef unsigned char __u8;
typedef unsigned short __u16;
typedef unsigned int __u32;
#define DVD_READ_STRUCT 0x5390 /* Read structure */
#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
#define DVD_AUTH 0x5392 /* Authentication */
#define DVD_STRUCT_PHYSICAL 0x00
#define DVD_STRUCT_COPYRIGHT 0x01
#define DVD_STRUCT_DISCKEY 0x02
#define DVD_STRUCT_BCA 0x03
#define DVD_STRUCT_MANUFACT 0x04
struct dvd_layer {
__u8 book_version : 4;
__u8 book_type : 4;
__u8 min_rate : 4;
__u8 disc_size : 4;
__u8 layer_type : 4;
__u8 track_path : 1;
__u8 nlayers : 2;
__u8 track_density : 4;
__u8 linear_density : 4;
__u8 bca : 1;
__u32 start_sector;
__u32 end_sector;
__u32 end_sector_l0;
};
struct dvd_physical {
__u8 type;
__u8 layer_num;
struct dvd_layer layer[4];
};
struct dvd_copyright {
__u8 type;
__u8 layer_num;
__u8 cpst;
__u8 rmi;
};
struct dvd_disckey {
__u8 type;
unsigned agid : 2;
__u8 value[2048];
};
struct dvd_bca {
__u8 type;
int len;
__u8 value[188];
};
struct dvd_manufact {
__u8 type;
__u8 layer_num;
int len;
__u8 value[2048];
};
typedef union {
__u8 type;
struct dvd_physical physical;
struct dvd_copyright copyright;
struct dvd_disckey disckey;
struct dvd_bca bca;
struct dvd_manufact manufact;
} dvd_struct;
/*
* DVD authentication ioctl
*/
/* Authentication states */
#define DVD_LU_SEND_AGID 0
#define DVD_HOST_SEND_CHALLENGE 1
#define DVD_LU_SEND_KEY1 2
#define DVD_LU_SEND_CHALLENGE 3
#define DVD_HOST_SEND_KEY2 4
/* Termination states */
#define DVD_AUTH_ESTABLISHED 5
#define DVD_AUTH_FAILURE 6
/* Other functions */
#define DVD_LU_SEND_TITLE_KEY 7
#define DVD_LU_SEND_ASF 8
#define DVD_INVALIDATE_AGID 9
#define DVD_LU_SEND_RPC_STATE 10
#define DVD_HOST_SEND_RPC_STATE 11
/* State data */
typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */
struct dvd_lu_send_agid {
__u8 type;
unsigned agid : 2;
};
struct dvd_host_send_challenge {
__u8 type;
unsigned agid : 2;
dvd_challenge chal;
};
struct dvd_send_key {
__u8 type;
unsigned agid : 2;
dvd_key key;
};
struct dvd_lu_send_challenge {
__u8 type;
unsigned agid : 2;
dvd_challenge chal;
};
#define DVD_CPM_NO_COPYRIGHT 0
#define DVD_CPM_COPYRIGHTED 1
#define DVD_CP_SEC_NONE 0
#define DVD_CP_SEC_EXIST 1
#define DVD_CGMS_UNRESTRICTED 0
#define DVD_CGMS_SINGLE 2
#define DVD_CGMS_RESTRICTED 3
struct dvd_lu_send_title_key {
__u8 type;
unsigned agid : 2;
dvd_key title_key;
int lba;
unsigned cpm : 1;
unsigned cp_sec : 1;
unsigned cgms : 2;
};
struct dvd_lu_send_asf {
__u8 type;
unsigned agid : 2;
unsigned asf : 1;
};
struct dvd_host_send_rpcstate {
__u8 type;
__u8 pdrc;
};
struct dvd_lu_send_rpcstate {
__u8 type : 2;
__u8 vra : 3;
__u8 ucca : 3;
__u8 region_mask;
__u8 rpc_scheme;
};
typedef union {
__u8 type;
struct dvd_lu_send_agid lsa;
struct dvd_host_send_challenge hsc;
struct dvd_send_key lsk;
struct dvd_lu_send_challenge lsc;
struct dvd_send_key hsk;
struct dvd_lu_send_title_key lstk;
struct dvd_lu_send_asf lsasf;
struct dvd_host_send_rpcstate hrpcs;
struct dvd_lu_send_rpcstate lrpcs;
} dvd_authinfo;
typedef struct {
__u16 report_key_length;
__u8 reserved1;
__u8 reserved2;
#if BYTE_ORDER == BIG_ENDIAN
__u8 type_code : 2;
__u8 vra : 3;
__u8 ucca : 3;
#elif BYTE_ORDER == LITTLE_ENDIAN
__u8 ucca : 3;
__u8 vra : 3;
__u8 type_code : 2;
#endif
__u8 region_mask;
__u8 rpc_scheme;
__u8 reserved3;
} rpc_state_t;
/*
* Stuff for the CDROM ioctls
*/
#define CDROMREADTOCHDR 0x5305 /* Read TOC header (cdrom_tochdr) */
#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry (cdrom_tocentry) */
#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
#define CDROMCLOSETRAY 0x5319 /* Reverse of CDROMEJECT */
#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes) */
#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes) */
#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 bytes) */
#define CD_MINS 74 /* max. minutes per CD, not really a limit */
#define CD_SECS 60 /* seconds per minute */
#define CD_FRAMES 75 /* frames per second */
#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
/* CD-ROM address types (cdrom_tocentry.cdte_format) */
#define CDROM_LBA 0x01 /* logical block: first frame is #0 */
#define CDROM_MSF 0x02 /* minute-second-frame: binary. not bcd here!*/
/* The leadout track is always 0xAA, regardless of # of tracks on disc */
#define CDROM_LEADOUT 0xAA
/* drive status returned by CDROM_DRIVE_STATUS ioctl */
#define CDS_NO_INFO 0 /* if not implemented */
#define CDS_NO_DISC 1
#define CDS_TRAY_OPEN 2
#define CDS_DRIVE_NOT_READY 3
#define CDS_DISC_OK 4
/* For compile compatibility only - we don't support changers */
#define CDSL_NONE ((int) (~0U>>1)-1)
#define CDSL_CURRENT ((int) (~0U>>1))
struct cdrom_msf
{
__u8 cdmsf_min0; /* start minute */
__u8 cdmsf_sec0; /* start second */
__u8 cdmsf_frame0; /* start frame */
__u8 cdmsf_min1; /* end minute */
__u8 cdmsf_sec1; /* end second */
__u8 cdmsf_frame1; /* end frame */
};
struct cdrom_tochdr
{
__u8 cdth_trk0; /* start track */
__u8 cdth_trk1; /* end track */
};
struct cdrom_msf0
{
__u8 minute;
__u8 second;
__u8 frame;
};
union cdrom_addr
{
struct cdrom_msf0 msf;
int lba;
};
struct cdrom_tocentry
{
__u8 cdte_track;
__u8 cdte_adr :4;
__u8 cdte_ctrl :4;
__u8 cdte_format;
union cdrom_addr cdte_addr;
__u8 cdte_datamode;
};
struct modesel_head
{
__u8 reserved1;
__u8 medium;
__u8 reserved2;
__u8 block_desc_length;
__u8 density;
__u8 number_of_blocks_hi;
__u8 number_of_blocks_med;
__u8 number_of_blocks_lo;
__u8 reserved3;
__u8 block_length_hi;
__u8 block_length_med;
__u8 block_length_lo;
};
#endif /* _DVD_H_ */
/*
* Hacked version of the linux cdrom.c kernel module - everything except the
* DVD handling ripped out and the rest rewritten to use raw SCSI commands
* on BSD/OS 4.2 (but should work with earlier versions as well).
*/
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include </sys/dev/scsi/scsi.h>
#include </sys/dev/scsi/scsi_ioctl.h>
#include "dvd.h"
/*
* Now get rid of the override/intercept macro so we can call the real ioctl()
* routine!
*/
#undef ioctl
#define CMD_READ_10 0x28
#define CMD_READ_TOC_PMA_ATIP 0x43
#define CMD_READ_CD 0xbe
#define CMD_START_STOP_UNIT 0x1b
#define CMD_SEND_KEY 0xa3
#define CMD_REPORT_KEY 0xa4
#define CMD_READ_DVD_STRUCTURE 0xad
#define copy_key(dest,src) memcpy((dest), (src), sizeof(dvd_key))
#define copy_chal(dest,src) memcpy((dest), (src), sizeof(dvd_challenge))
/* Define the Cdrom Generic Command structure */
typedef struct cgc
{
u_char cdb[12];
u_char *buf;
int buflen;
int rw;
int timeout;
struct scsi_user_cdb *sus;
} cgc_t;
static int scsi_cmd(int, cgc_t *);
static int cdrom_ioctl(int, u_long, void *);
static int cdrom_tray_move(int, int);
static int dvd_ioctl(int, u_long, void *);
static int debug;
void dvd_cdrom_debug(int flag)
{
debug = flag;
}
/*
* This is the published entry point. Actually applications should simply
* include <dvd.h> and not refer to this at all.
*/
int dvd_cdrom_ioctl(int fd, unsigned long cmd, void *arg)
{
switch (cmd)
{
case DVD_AUTH:
case DVD_READ_STRUCT:
return(dvd_ioctl(fd, cmd, arg));
case CDROMREADTOCHDR:
case CDROMREADTOCENTRY:
case CDROMEJECT:
case CDROMREADRAW:
case CDROMREADMODE2:
case CDROMCLOSETRAY:
case CDROM_DRIVE_STATUS:
return(cdrom_ioctl(fd, cmd, arg));
default:
return(ioctl(fd, cmd, arg));
}
}
static void setup_report_key(cgc_t *cgc, u_int agid, u_int type)
{
cgc->cdb[0] = CMD_REPORT_KEY;
cgc->cdb[10] = type | (agid << 6);
switch (type)
{
case 0:
case 5:
case 8:
cgc->buflen = 8;
break;
case 1:
cgc->buflen = 16;
break;
case 2:
case 4:
cgc->buflen = 12;
break;
}
cgc->cdb[9] = cgc->buflen;
cgc->rw = SUC_READ;;
}
static void setup_send_key(cgc_t *cgc, u_int agid, u_int type)
{
cgc->cdb[0] = CMD_SEND_KEY;
cgc->cdb[10] = type | (agid << 6);
switch (type)
{
case 1:
cgc->buflen = 16;
break;
case 3:
cgc->buflen = 12;
break;
case 6:
cgc->buflen = 8;
break;
}
cgc->cdb[9] = cgc->buflen;
cgc->rw = SUC_WRITE;
}
static void cgc_init(cgc_t *cgc, void *buf, int len, int type)
{
memset(cgc, 0, sizeof (*cgc));
if (buf)
memset(buf, 0, len);
cgc->buf = (u_char *)buf;
cgc->buflen = len;
cgc->rw = type;
cgc->timeout = 5; /* 5 second timeout */
}
static int dvd_do_auth(int fd, dvd_authinfo *ai)
{
int ret;
u_char buf[20];
cgc_t cgc;
rpc_state_t rpc_state;
memset(buf, 0, sizeof(buf));
cgc_init(&cgc, buf, 0, SUC_READ);
switch (ai->type)
{
case DVD_LU_SEND_AGID: /* LU data send */
setup_report_key(&cgc, ai->lsa.agid, 0);
if (ret = scsi_cmd(fd, &cgc))
return ret;
ai->lsa.agid = buf[7] >> 6;
break;
case DVD_LU_SEND_KEY1:
setup_report_key(&cgc, ai->lsk.agid, 2);
if (ret = scsi_cmd(fd, &cgc))
return ret;
copy_key(ai->lsk.key, &buf[4]);
break;
case DVD_LU_SEND_CHALLENGE:
setup_report_key(&cgc, ai->lsc.agid, 1);
if (ret = scsi_cmd(fd, &cgc))
return ret;
copy_chal(ai->lsc.chal, &buf[4]);
break;
case DVD_LU_SEND_TITLE_KEY: /* Post-auth key */
setup_report_key(&cgc, ai->lstk.agid, 4);
cgc.cdb[5] = ai->lstk.lba;
cgc.cdb[4] = ai->lstk.lba >> 8;
cgc.cdb[3] = ai->lstk.lba >> 16;
cgc.cdb[2] = ai->lstk.lba >> 24;
if (ret = scsi_cmd(fd, &cgc))
return ret;
ai->lstk.cpm = (buf[4] >> 7) & 1;
ai->lstk.cp_sec = (buf[4] >> 6) & 1;
ai->lstk.cgms = (buf[4] >> 4) & 3;
copy_key(ai->lstk.title_key, &buf[5]);
break;
case DVD_LU_SEND_ASF:
setup_report_key(&cgc, ai->lsasf.agid, 5);
if (ret = scsi_cmd(fd, &cgc))
return ret;
ai->lsasf.asf = buf[7] & 1;
break;
case DVD_HOST_SEND_CHALLENGE: /* LU data receive (LU changes state) */
setup_send_key(&cgc, ai->hsc.agid, 1);
buf[1] = 0xe;
copy_chal(&buf[4], ai->hsc.chal);
if (ret = scsi_cmd(fd, &cgc))
return ret;
ai->type = DVD_LU_SEND_KEY1;
break;
case DVD_HOST_SEND_KEY2:
setup_send_key(&cgc, ai->hsk.agid, 3);
buf[1] = 0xa;
copy_key(&buf[4], ai->hsk.key);
if (ret = scsi_cmd(fd, &cgc))
{
ai->type = DVD_AUTH_FAILURE;
return ret;
}
ai->type = DVD_AUTH_ESTABLISHED;
break;
case DVD_INVALIDATE_AGID:
setup_report_key(&cgc, ai->lsa.agid, 0x3f);
if (ret = scsi_cmd(fd, &cgc))
return ret;
break;
case DVD_LU_SEND_RPC_STATE: /* Get region settings */
setup_report_key(&cgc, 0, 8);
memset(&rpc_state, 0, sizeof(rpc_state_t));
cgc.buf = (char *) &rpc_state;
if (ret = scsi_cmd(fd, &cgc))
{
ai->lrpcs.type = 0;
ai->lrpcs.rpc_scheme = 0;
}
else
{
ai->lrpcs.type = rpc_state.type_code;
ai->lrpcs.vra = rpc_state.vra;
ai->lrpcs.ucca = rpc_state.ucca;
ai->lrpcs.region_mask = rpc_state.region_mask;
ai->lrpcs.rpc_scheme = rpc_state.rpc_scheme;
}
break;
case DVD_HOST_SEND_RPC_STATE: /* Set region settings */
setup_send_key(&cgc, 0, 6);
buf[1] = 6;
buf[4] = ai->hrpcs.pdrc;
if (ret = scsi_cmd(fd, &cgc))
return ret;
break;
default:
return EINVAL;
}
return 0;
}
static int dvd_read_physical(int fd, dvd_struct *s)
{
int ret, i;
u_char buf[4 + 4 * 20], *base;
struct dvd_layer *layer;
cgc_t cgc;
cgc_init(&cgc, buf, sizeof(buf), SUC_READ);
cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
cgc.cdb[6] = s->physical.layer_num;
cgc.cdb[7] = s->type;
cgc.cdb[9] = cgc.buflen & 0xff;
if (ret = scsi_cmd(fd, &cgc))
return ret;
base = &buf[4];
layer = &s->physical.layer[0];
/* place the data... really ugly, but at least we won't have to
worry about endianess in userspace or here. */
for (i = 0; i < 4; ++i, base += 20, ++layer)
{
memset(layer, 0, sizeof(*layer));
layer->book_version = base[0] & 0xf;
layer->book_type = base[0] >> 4;
layer->min_rate = base[1] & 0xf;
layer->disc_size = base[1] >> 4;
layer->layer_type = base[2] & 0xf;
layer->track_path = (base[2] >> 4) & 1;
layer->nlayers = (base[2] >> 5) & 3;
layer->track_density = base[3] & 0xf;
layer->linear_density = base[3] >> 4;
layer->start_sector = base[5] << 16 | base[6] << 8 | base[7];
layer->end_sector = base[9] << 16 | base[10] << 8 | base[11];
layer->end_sector_l0 = base[13] << 16 | base[14] << 8 | base[15];
layer->bca = base[16] >> 7;
}
return 0;
}
static int dvd_read_copyright(int fd, dvd_struct *s)
{
int ret;
u_char buf[8];
cgc_t cgc;
cgc_init(&cgc, buf, sizeof(buf), SUC_READ);
cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
cgc.cdb[6] = s->copyright.layer_num;
cgc.cdb[7] = s->type;
cgc.cdb[8] = cgc.buflen >> 8;
cgc.cdb[9] = cgc.buflen & 0xff;
if (ret = scsi_cmd(fd, &cgc))
return ret;
s->copyright.cpst = buf[4];
s->copyright.rmi = buf[5];
return 0;
}
static int dvd_read_disckey(int fd, dvd_struct *s)
{
int ret, size;
u_char *buf;
cgc_t cgc;
size = sizeof(s->disckey.value) + 4;
if ((buf = (u_char *) malloc(size)) == NULL)
return ENOMEM;
cgc_init(&cgc, buf, size, SUC_READ);
cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
cgc.cdb[7] = s->type;
cgc.cdb[8] = size >> 8;
cgc.cdb[9] = size & 0xff;
cgc.cdb[10] = s->disckey.agid << 6;
if (!(ret = scsi_cmd(fd, &cgc)))
memcpy(s->disckey.value, &buf[4], sizeof(s->disckey.value));
free(buf);
return ret;
}
static int dvd_read_bca(int fd, dvd_struct *s)
{
int ret;
u_char buf[4 + 188];
cgc_t cgc;
cgc_init(&cgc, buf, sizeof(buf), SUC_READ);
cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
cgc.cdb[7] = s->type;
cgc.cdb[9] = cgc.buflen = 0xff;
if (ret = scsi_cmd(fd, &cgc))
return ret;
s->bca.len = buf[0] << 8 | buf[1];
if (s->bca.len < 12 || s->bca.len > 188)
return EIO;
memcpy(s->bca.value, &buf[4], s->bca.len);
return 0;
}
static int dvd_read_manufact(int fd, dvd_struct *s)
{
int ret = 0, size;
u_char *buf;
cgc_t cgc;
size = sizeof(s->manufact.value) + 4;
if ((buf = (u_char *) malloc(size)) == NULL)
return ENOMEM;
cgc_init(&cgc, buf, size, SUC_READ);
cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
cgc.cdb[7] = s->type;
cgc.cdb[8] = size >> 8;
cgc.cdb[9] = size & 0xff;
if (ret = scsi_cmd(fd, &cgc))
{
free(buf);
return ret;
}
s->manufact.len = buf[0] << 8 | buf[1];
if (s->manufact.len < 0 || s->manufact.len > 2048)
ret = -EIO;
else
memcpy(s->manufact.value, &buf[4], s->manufact.len);
free(buf);
return ret;
}
static int dvd_read_struct(int fd, dvd_struct *s)
{
switch (s->type)
{
case DVD_STRUCT_PHYSICAL:
return dvd_read_physical(fd, s);
case DVD_STRUCT_COPYRIGHT:
return dvd_read_copyright(fd, s);
case DVD_STRUCT_DISCKEY:
return dvd_read_disckey(fd, s);
case DVD_STRUCT_BCA:
return dvd_read_bca(fd, s);
case DVD_STRUCT_MANUFACT:
return dvd_read_manufact(fd, s);
default:
return EINVAL;
}
}
static u_char scsi_cdblen[8] = {6, 10, 10, 12, 12, 12, 10, 10};
static int scsi_cmd(int fd, cgc_t *cgc)
{
int scsistatus, cdblen;
unsigned char *cp;
struct scsi_user_cdb suc;
/* safety checks */
if (cgc->rw != SUC_READ && cgc->rw != SUC_WRITE)
return(EINVAL);
suc.suc_flags = cgc->rw;
cdblen = scsi_cdblen[(cgc->cdb[0] >> 5) & 7];
suc.suc_cdblen = cdblen;
bcopy(cgc->cdb, suc.suc_cdb, cdblen);
suc.suc_data = cgc->buf;
suc.suc_datalen = cgc->buflen;
suc.suc_timeout = cgc->timeout;
if (ioctl(fd, SCSIRAWCDB, &suc) == -1)
return(errno);
scsistatus = suc.suc_sus.sus_status;
/*
* If the device returns a scsi sense error and debugging is enabled print
* some hopefully useful information on stderr.
*/
if (scsistatus && debug)
{
cp = suc.suc_sus.sus_sense;
fprintf(stderr,"scsistatus = %x cmd = %x\n",
scsistatus, cgc->cdb[0]);
fprintf(stderr, "sense %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n",
cp[0], cp[1], cp[2], cp[3], cp[4], cp[5],
cp[6], cp[7], cp[8], cp[9], cp[10], cp[11],
cp[12], cp[13], cp[14], cp[15]);
}
if (cgc->sus)
bcopy(&suc, cgc->sus, sizeof (struct scsi_user_cdb));
if (scsistatus)
return(EIO); /* generic i/o error for unsuccessful status */
return(0);
}
/*
* The entry point for the DVDioctls for BSD/OS.
*/
static int dvd_ioctl(int fd, u_long cmd, void *arg)
{
int ret;
switch (cmd)
{
case DVD_READ_STRUCT:
ret = dvd_read_struct(fd, (dvd_struct *)arg);
if (ret)
errno = ret;
return(ret ? -1 : 0);
case DVD_AUTH:
ret = dvd_do_auth (fd, (dvd_authinfo *)arg);
if (ret)
errno = ret;
return(ret ? -1 : 0);
default:
errno = EINVAL;
return(-1);
}
}
/*
* The entry point for the CDROMioctls for BSD/OS
*/
static int cdrom_read_block(int, cgc_t *, int, int, int, int);
static int cdrom_read_cd(int, cgc_t *, int, int, int );
int cdrom_blocksize(int, int );
static inline
int msf_to_lba(char m, char s, char f)
{
return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
}
cdrom_ioctl(int fd, u_long cmd, void *arg)
{
int ret;
cgc_t cgc;
switch (cmd)
{
case CDROMREADRAW:
case CDROMREADMODE1:
case CDROMREADMODE2:
{
struct cdrom_msf *msf;
int blocksize = 0, format = 0, lba;
switch (cmd)
{
case CDROMREADRAW:
blocksize = CD_FRAMESIZE_RAW;
break;
case CDROMREADMODE1:
blocksize = CD_FRAMESIZE;
format = 2;
break;
case CDROMREADMODE2:
blocksize = CD_FRAMESIZE_RAW0;
break;
}
msf = (struct cdrom_msf *)arg;
lba = msf_to_lba(msf->cdmsf_min0,msf->cdmsf_sec0,
msf->cdmsf_frame0);
ret = EINVAL;
if (lba < 0)
break;
cgc_init(&cgc, arg, blocksize, SUC_READ);
ret = cdrom_read_block(fd, &cgc, lba, 1, format, blocksize);
if (ret)
{
/*
* SCSI-II devices are not required to support CMD_READ_CD (which specifies
* the blocksize to read) so try switching the block size with a mode select,
* doing the normal read sector command and then changing the sector size back
* to 2048.
*
* If the program dies before changing the blocksize back sdopen()
* in the kernel will fail opens with a message that looks something like:
*
* "sr1: blksize 2336 not multiple of 512: cannot use"
*
* At that point the drive has to be power cycled (or reset in some other way).
*/
if (ret = cdrom_blocksize(fd, blocksize))
break;
ret = cdrom_read_cd(fd, &cgc, lba, blocksize, 1);
ret |= cdrom_blocksize(fd, 2048);
}
break;
}
case CDROMREADTOCHDR:
{
struct cdrom_tochdr *tochdr = (struct cdrom_tochdr *) arg;
u_char buffer[12];
cgc_init(&cgc, buffer, sizeof (buffer), SUC_READ);
cgc.cdb[0] = CMD_READ_TOC_PMA_ATIP;
cgc.cdb[1] = 0x2; /* MSF */
cgc.cdb[8] = 12; /* LSB of length */
ret = scsi_cmd(fd, &cgc);
if (!ret)
{
tochdr->cdth_trk0 = buffer[2];
tochdr->cdth_trk1 = buffer[3];
}
break;
}
case CDROMREADTOCENTRY:
{
struct cdrom_tocentry *tocentry = (struct cdrom_tocentry *) arg;
u_char buffer[12];
cgc_init(&cgc, buffer, sizeof (buffer), SUC_READ);
cgc.cdb[0] = CMD_READ_TOC_PMA_ATIP;
cgc.cdb[1] = (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0;
cgc.cdb[6] = tocentry->cdte_track;
cgc.cdb[8] = 12; /* LSB of length */
ret = scsi_cmd(fd, &cgc);
if (ret)
break;
tocentry->cdte_ctrl = buffer[5] & 0xf;
tocentry->cdte_adr = buffer[5] >> 4;
tocentry->cdte_datamode = (tocentry->cdte_ctrl & 0x04) ? 1 : 0;
if (tocentry->cdte_format == CDROM_MSF)
{
tocentry->cdte_addr.msf.minute = buffer[9];
tocentry->cdte_addr.msf.second = buffer[10];
tocentry->cdte_addr.msf.frame = buffer[11];
}
else
tocentry->cdte_addr.lba = (((((buffer[8] << 8)
+ buffer[9]) << 8)
+ buffer[10]) << 8)
+ buffer[11];
break;
}
case CDROMEJECT: /* NO-OP for now */
ret = cdrom_tray_move(fd, 1);
break;
case CDROMCLOSETRAY:
ret = cdrom_tray_move(fd, 0);
break;
/*
* This sucks but emulates the expected behaviour. Instead of the return
* value being the actual status a success/fail indicator should have been
* returned and the 3rd arg to the ioctl should have been an 'int *' to update
* with the actual status.
*/
case CDROM_DRIVE_STATUS:
return(CDS_NO_INFO);
break;
}
errno = ret;
return(ret ? -1 : 0);
}
static int cdrom_read_cd(int fd, cgc_t *cgc, int lba, int blocksize, int nblocks)
{
memset(&cgc->cdb, 0, sizeof(cgc->cdb));
cgc->cdb[0] = CMD_READ_10;
cgc->cdb[2] = (lba >> 24) & 0xff;
cgc->cdb[3] = (lba >> 16) & 0xff;
cgc->cdb[4] = (lba >> 8) & 0xff;
cgc->cdb[5] = lba & 0xff;
cgc->cdb[6] = (nblocks >> 16) & 0xff;
cgc->cdb[7] = (nblocks >> 8) & 0xff;
cgc->cdb[8] = nblocks & 0xff;
cgc->buflen = blocksize * nblocks;
return(scsi_cmd(fd, cgc));
}
static int cdrom_read_block(int fd, cgc_t *cgc,
int lba, int nblocks, int format, int blksize)
{
memset(&cgc->cdb, 0, sizeof(cgc->cdb));
cgc->cdb[0] = CMD_READ_CD;
/* expected sector size - cdda,mode1,etc. */
cgc->cdb[1] = format << 2;
/* starting address */
cgc->cdb[2] = (lba >> 24) & 0xff;
cgc->cdb[3] = (lba >> 16) & 0xff;
cgc->cdb[4] = (lba >> 8) & 0xff;
cgc->cdb[5] = lba & 0xff;
/* number of blocks */
cgc->cdb[6] = (nblocks >> 16) & 0xff;
cgc->cdb[7] = (nblocks >> 8) & 0xff;
cgc->cdb[8] = nblocks & 0xff;
cgc->buflen = blksize * nblocks;
/* set the header info returned */
switch (blksize)
{
case CD_FRAMESIZE_RAW0:
cgc->cdb[9] = 0x58;
break;
case CD_FRAMESIZE_RAW1:
cgc->cdb[9] = 0x78;
break;
case CD_FRAMESIZE_RAW:
cgc->cdb[9] = 0xf8;
break;
default:
cgc->cdb[9] = 0x10;
}
return(scsi_cmd(fd, cgc));
}
static int cdrom_tray_move(int fd, int flag)
{
cgc_t cgc;
cgc_init(&cgc, NULL, 0, SUC_READ);
cgc.cdb[0] = CMD_START_STOP_UNIT;
cgc.cdb[1] = 1; /* immediate */
cgc.cdb[4] = flag ? 0x2 : 0x3; /* eject : close */
return(scsi_cmd(fd, &cgc));
}
/*
* Required when we need to use READ_10 to issue other than 2048 block
* reads
*/
int cdrom_blocksize(int fd, int size)
{
cgc_t cgc;
struct modesel_head mh;
memset(&mh, 0, sizeof(mh));
mh.block_desc_length = 0x08;
mh.block_length_med = (size >> 8) & 0xff;
mh.block_length_lo = size & 0xff;
memset(&cgc, 0, sizeof(cgc));
cgc.cdb[0] = 0x15;
cgc.cdb[1] = 1 << 4;
cgc.cdb[4] = 12;
cgc.buflen = sizeof(mh);
cgc.buf = (u_char *) &mh;
cgc.rw = SUC_WRITE;
mh.block_desc_length = 0x08;
mh.block_length_med = (size >> 8) & 0xff;
mh.block_length_lo = size & 0xff;
return(scsi_cmd(fd, &cgc));
}
......@@ -9,30 +9,38 @@ MAJOR_SO := libdvdcss.so.$(shell echo $(LIBDVDCSS_VERSION) | cut -f1 -d.)
FULL_SO := libdvdcss.so.$(LIBDVDCSS_VERSION)
ifneq (,$(SOFLAGS))
ALL_SOFLAGS := $(SOFLAGS)$(MAJOR_SO)
SOFLAGS :=
endif
#
# Objects
#
LIBDVDCSS_O = libdvdcss.o css.o ioctl.o
ALL_OBJ = $(LIBDVDCSS_O)
OBJ_C = libdvdcss.o css.o ioctl.o
ALL_OBJ = $(OBJ_C) $(OBJ_LIBDVDCSS)
include ../../Makefile.modules
$(LIBDVDCSS_O): %.o: .dep/%.d
$(LIBDVDCSS_O): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(OBJ_C): %.o: .dep/%.d
$(OBJ_C): %.o: %.c
$(CC) $(CFLAGS) $(CFLAGS_LIBDVDCSS) $(PCFLAGS) -c -o $@ $<
bsdi_dvdioctl.o: ../BSDI_ioctl/dvdioctl.c
$(CC) $(CFLAGS) $(CFLAGS_LIBDVDCSS) $(PCFLAGS) -c -o $@ $<
../../lib/$(FULL_SO): $(LIBDVDCSS_O)
../../lib/$(FULL_SO): $(OBJ_C) $(OBJ_LIBDVDCSS)
$(CC) $(PCFLAGS) $(ALL_SOFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_LIBDVDCSS)
rm -f ../../lib/$(BASE_SO) && ln -s $(FULL_SO) ../../lib/$(BASE_SO)
rm -f ../../lib/$(MAJOR_SO) && ln -s $(FULL_SO) ../../lib/$(MAJOR_SO)
../../lib/$(BASE_A): $(LIBDVDCSS_O)
../../lib/$(BASE_A): $(OBJ_C) $(OBJ_LIBDVDCSS)
ar r $@ $^
$(RANLIB) $@
#
# Virtual targets
#
all: ../../lib/$(FULL_SO) ../../lib/$(BASE_A)
install:
......
......@@ -2,7 +2,7 @@
* ioctl.c: DVD ioctl replacement function
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ioctl.c,v 1.9 2001/08/09 08:20:26 sam Exp $
* $Id: ioctl.c,v 1.10 2001/08/09 23:12:36 sam Exp $
*
* Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
* Samuel Hocevar <sam@zoy.org>
......@@ -59,7 +59,7 @@
#ifdef SOLARIS_USCSI
# include <unistd.h>
# include <stropts.h>
# include </usr/include/sys/scsi/scsi_types.h>
# include <sys/scsi/scsi_types.h>
# include <sys/scsi/impl/uscsi.h>
#endif
......@@ -67,7 +67,7 @@
#include "common.h"
#ifdef SYS_DARWIN
# include "DVDioctl/DVDioctl.h"
# include "MacOSX_dvdioctl/DVDioctl.h"
#endif
#include "ioctl.h"
......
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