shithub: libdvdcss

Download patch

ref: cd0dbd363b2fcd6bab58b9e48bd1130b2a418a9e
parent: 475bc8f7db5a163c8fe2ded0b2dd501396acabc7
author: Sam Hocevar <sam@videolan.org>
date: Fri Dec 21 19:26:17 EST 2001

* Attempt at fixing the Solaris port.


--- a/configure
+++ b/configure
@@ -5613,7 +5613,106 @@
 
 fi
 
+echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:5618: checking for boolean_t in sys/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_c_boolean_t_sys_types_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5623 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+boolean_t foo;
+; return 0; }
+EOF
+if { (eval echo configure:5630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_boolean_t_sys_types_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_boolean_t_sys_types_h=no
+fi
+rm -f conftest*
+fi
 
+echo "$ac_t""$ac_cv_c_boolean_t_sys_types_h" 1>&6
+if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
+    cat >> confdefs.h <<\EOF
+#define BOOLEAN_T_IN_SYS_TYPES_H 1
+EOF
+
+fi
+
+echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
+echo "configure:5651: checking for boolean_t in pthread.h" >&5
+if eval "test \"`echo '$''{'ac_cv_c_boolean_t_pthread_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5656 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+int main() {
+boolean_t foo;
+; return 0; }
+EOF
+if { (eval echo configure:5663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_boolean_t_pthread_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_boolean_t_pthread_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_boolean_t_pthread_h" 1>&6
+if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
+    cat >> confdefs.h <<\EOF
+#define BOOLEAN_T_IN_PTHREAD_H 1
+EOF
+
+fi
+
+echo $ac_n "checking for boolean_t in cthreads.h""... $ac_c" 1>&6
+echo "configure:5684: checking for boolean_t in cthreads.h" >&5
+if eval "test \"`echo '$''{'ac_cv_c_boolean_t_cthreads_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5689 "configure"
+#include "confdefs.h"
+#include <cthreads.h>
+int main() {
+boolean_t foo;
+; return 0; }
+EOF
+if { (eval echo configure:5696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_boolean_t_cthreads_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_boolean_t_cthreads_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_boolean_t_cthreads_h" 1>&6
+if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
+    cat >> confdefs.h <<\EOF
+#define BOOLEAN_T_IN_CTHREADS_H 1
+EOF
+
+fi
+
+
 CAN_BUILD_LIBDVDCSS=0
 
 for ac_hdr in winioctl.h
@@ -5620,17 +5719,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5624: checking for $ac_hdr" >&5
+echo "configure:5723: 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 5629 "configure"
+#line 5728 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5733: \"$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*
@@ -5663,17 +5762,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5667: checking for $ac_hdr" >&5
+echo "configure:5766: 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 5672 "configure"
+#line 5771 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5776: \"$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*
@@ -5699,17 +5798,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5703: checking for $ac_hdr" >&5
+echo "configure:5802: 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 5708 "configure"
+#line 5807 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5812: \"$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*
@@ -5739,7 +5838,7 @@
   LINUX_DVD_STRUCT=0
   OPENBSD_DVD_STRUCT=0
         cat > conftest.$ac_ext <<EOF
-#line 5743 "configure"
+#line 5842 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -5752,7 +5851,7 @@
 EOF
 
     cat > conftest.$ac_ext <<EOF
-#line 5756 "configure"
+#line 5855 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -5772,7 +5871,7 @@
 rm -f conftest*
 
         cat > conftest.$ac_ext <<EOF
-#line 5776 "configure"
+#line 5875 "configure"
 #include "confdefs.h"
 #include <sys/dvdio.h>
 EOF
@@ -5785,7 +5884,7 @@
 EOF
 
     cat > conftest.$ac_ext <<EOF
-#line 5789 "configure"
+#line 5888 "configure"
 #include "confdefs.h"
 #include <sys/dvdio.h>
 EOF
@@ -5805,7 +5904,7 @@
 rm -f conftest*
 
         cat > conftest.$ac_ext <<EOF
-#line 5809 "configure"
+#line 5908 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -5824,7 +5923,7 @@
 
         NEED_BSDI_LIBDVD=0
   cat > conftest.$ac_ext <<EOF
-#line 5828 "configure"
+#line 5927 "configure"
 #include "confdefs.h"
 #include <dvd.h>
 EOF
@@ -5846,17 +5945,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5850: checking for $ac_hdr" >&5
+echo "configure:5949: 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 5855 "configure"
+#line 5954 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5959: \"$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*
@@ -5896,17 +5995,17 @@
 
         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:5900: checking for sys/scsi/scsi_types.h" >&5
+echo "configure:5999: 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 5905 "configure"
+#line 6004 "configure"
 #include "confdefs.h"
 #include <sys/scsi/scsi_types.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6009: \"$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*
@@ -5925,17 +6024,17 @@
   
     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:5929: checking for sys/scsi/impl/uscsi.h" >&5
+echo "configure:6028: 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 5934 "configure"
+#line 6033 "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:5939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6038: \"$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*
@@ -5968,17 +6067,17 @@
 
         ac_safe=`echo "sys/scsi.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/scsi.h""... $ac_c" 1>&6
-echo "configure:5972: checking for sys/scsi.h" >&5
+echo "configure:6071: checking for sys/scsi.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 5977 "configure"
+#line 6076 "configure"
 #include "confdefs.h"
 #include <sys/scsi.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6081: \"$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*
@@ -5996,7 +6095,7 @@
   echo "$ac_t""yes" 1>&6
   
     cat > conftest.$ac_ext <<EOF
-#line 6000 "configure"
+#line 6099 "configure"
 #include "confdefs.h"
 #include <sys/scsi.h>
 EOF
--- a/configure.in
+++ b/configure.in
@@ -18,6 +18,31 @@
   AC_DEFINE(HAVE_CSSKEYS, 1, css decryption with player keys)
 fi
 
+dnl Check for boolean_t
+AC_CACHE_CHECK([for boolean_t in sys/types.h],
+    [ac_cv_c_boolean_t_sys_types_h],
+    [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
+     ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
+if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
+    AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
+fi
+
+AC_CACHE_CHECK([for boolean_t in pthread.h],
+    [ac_cv_c_boolean_t_pthread_h],
+    [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
+     ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
+if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
+    AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
+fi
+
+AC_CACHE_CHECK([for boolean_t in cthreads.h],
+    [ac_cv_c_boolean_t_cthreads_h],
+    [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
+     ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
+if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
+    AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
+fi
+
 dnl
 dnl  libdvdcss: check for DVD ioctls
 dnl
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -49,6 +49,15 @@
 /* css decryption with player keys */
 #undef HAVE_CSSKEYS
 
+/* Define if <sys/types.h> defines boolean_t. */
+#undef BOOLEAN_T_IN_SYS_TYPES_H
+
+/* Define if <pthread.h> defines boolean_t. */
+#undef BOOLEAN_T_IN_PTHREAD_H
+
+/* Define if <cthreads.h> defines boolean_t. */
+#undef BOOLEAN_T_IN_CTHREADS_H
+
 /* Define if <sys/cdio.h> defines dvd_struct. */
 #undef DVD_STRUCT_IN_SYS_CDIO_H