OSDN Git Service

This patch adds mingw32 cross-compilation support to HandBrake trunk to
[handbrake-jp/handbrake-jp-git.git] / contrib / libdvdread / P03-mingw-disable-dlopen.patch
1 diff -Naur libdvdread.orig/configure libdvdread/configure
2 --- libdvdread.orig/configure   2006-10-06 04:14:24.000000000 -0400
3 +++ libdvdread/configure        2009-03-10 17:48:56.000000000 -0400
4 @@ -18889,11 +18889,6 @@
5  echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
6  if test $ac_cv_lib_dl_dlopen = yes; then
7     DL_LIBS=-ldl
8 -else
9 -  { { echo "$as_me:$LINENO: error: You need libdl (dlopen)" >&5
10 -echo "$as_me: error: You need libdl (dlopen)" >&2;}
11 -   { (exit 1); exit 1; }; }
12 -
13  fi
14  
15  
16 diff -Naur libdvdread.orig/dvdread/dvd_input.c libdvdread/dvdread/dvd_input.c
17 --- libdvdread.orig/dvdread/dvd_input.c 2005-09-19 09:43:08.000000000 -0400
18 +++ libdvdread/dvdread/dvd_input.c      2009-03-10 18:01:43.000000000 -0400
19 @@ -44,18 +44,6 @@
20  
21  char *      (*dvdinput_error) (dvd_input_t);
22  
23 -#ifdef HAVE_DVDCSS_DVDCSS_H
24 -/* linking to libdvdcss */
25 -#include <dvdcss/dvdcss.h>
26 -#define DVDcss_open(a) dvdcss_open((char*)(a))
27 -#define DVDcss_close   dvdcss_close
28 -#define DVDcss_seek    dvdcss_seek
29 -#define DVDcss_title   dvdcss_title
30 -#define DVDcss_read    dvdcss_read
31 -#define DVDcss_error   dvdcss_error
32 -#else
33 -/* dlopening libdvdcss */
34 -#include <dlfcn.h>
35  typedef struct dvdcss_s *dvdcss_handle;
36  static dvdcss_handle (*DVDcss_open)  (const char *);
37  static int           (*DVDcss_close) (dvdcss_handle);
38 @@ -63,7 +51,6 @@
39  static int           (*DVDcss_title) (dvdcss_handle, int); 
40  static int           (*DVDcss_read)  (dvdcss_handle, void *, int, int);
41  static char *        (*DVDcss_error) (dvdcss_handle);
42 -#endif
43  
44  /* The DVDinput handle, add stuff here for new input methods. */
45  struct dvd_input_s {
46 @@ -290,17 +277,7 @@
47   */
48  void dvdinput_free(void)
49  {
50 -#ifdef HAVE_DVDCSS_DVDCSS_H
51 -  /* linked statically, nothing to free */
52    return;
53 -#else
54 -  if(dvdcss_library) {
55 -    dlclose(dvdcss_library);
56 -    dvdcss_library = NULL;
57 -  }
58 -  dvdcss_library_init = 0;
59 -  return;
60 -#endif
61  }
62  
63  
64 @@ -324,58 +301,6 @@
65  
66    verbose = get_verbose();
67    
68 -#ifdef HAVE_DVDCSS_DVDCSS_H
69 -  /* linking to libdvdcss */
70 -  dvdcss_library = &dvdcss_library;  /* Give it some value != NULL */
71 -  /* the DVDcss_* functions have been #defined at the top */
72 -  dvdcss_version = &dvdcss_interface_2;
73 -
74 -#else
75 -
76 -  dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
77 -
78 -  if(dvdcss_library != NULL) {
79 -#if defined(__OpenBSD__) && !defined(__ELF__)
80 -#define U_S "_"
81 -#else
82 -#define U_S
83 -#endif
84 -    DVDcss_open = (dvdcss_handle (*)(const char*))
85 -      dlsym(dvdcss_library, U_S "dvdcss_open");
86 -    DVDcss_close = (int (*)(dvdcss_handle))
87 -      dlsym(dvdcss_library, U_S "dvdcss_close");
88 -    DVDcss_title = (int (*)(dvdcss_handle, int))
89 -      dlsym(dvdcss_library, U_S "dvdcss_title");
90 -    DVDcss_seek = (int (*)(dvdcss_handle, int, int))
91 -      dlsym(dvdcss_library, U_S "dvdcss_seek");
92 -    DVDcss_read = (int (*)(dvdcss_handle, void*, int, int))
93 -      dlsym(dvdcss_library, U_S "dvdcss_read");
94 -    DVDcss_error = (char* (*)(dvdcss_handle))
95 -      dlsym(dvdcss_library, U_S "dvdcss_error");
96 -    
97 -    dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2");
98 -
99 -    if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
100 -      if(verbose >= 0) {
101 -        fprintf(stderr, 
102 -                "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
103 -                "libdvdread: You should get the latest version from "
104 -                "http://www.videolan.org/\n" );
105 -      }
106 -      dlclose(dvdcss_library);
107 -      dvdcss_library = NULL;
108 -    } else if(!DVDcss_open  || !DVDcss_close || !DVDcss_title || !DVDcss_seek
109 -              || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
110 -      if(verbose >= 0) {
111 -        fprintf(stderr,  "libdvdread: Missing symbols in libdvdcss.so.2, "
112 -                "this shouldn't happen !\n");
113 -      }
114 -      dlclose(dvdcss_library);
115 -      dvdcss_library = NULL;
116 -    }
117 -  }
118 -#endif /* HAVE_DVDCSS_DVDCSS_H */
119 -
120    dvdcss_library_init = 1;
121    
122    if(dvdcss_library) {
123 diff -Naur libdvdread.orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
124 --- libdvdread.orig/dvdread/dvd_reader.c        2006-10-06 03:58:03.000000000 -0400
125 +++ libdvdread/dvdread/dvd_reader.c     2009-03-10 17:51:22.000000000 -0400
126 @@ -183,7 +183,7 @@
127    dev->align = align;
128  }
129  
130 -#ifdef WIN32 /* replacement gettimeofday implementation */
131 +#if defined(WIN32) && !defined(__MINGW32__) /* replacement gettimeofday implementation */
132  #include <sys/timeb.h>
133  static int gettimeofday( struct timeval *tv, void *tz )
134  {