]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/libupnp-configure.patch
Contrib: one step further on the Win32 upnp port to compile vlc plugin
[vlc] / extras / contrib / src / Patches / libupnp-configure.patch
1 --- libupnp/configure.ac        2008-04-25 13:41:16.000000000 +0200
2 +++ libupnp_new/configure.ac    2010-08-13 23:21:00.000000000 +0200
3 @@ -286,7 +286,6 @@
4  AC_PROG_MAKE_SET
5  AC_PROG_EGREP
6  
7 -#
8  # Default compilation flags
9  #
10  echo "--------------------- Default compilation flags -------------------------------"
11 @@ -332,19 +331,13 @@
12  # so just abort if a header file is not found.
13  AC_CHECK_HEADERS(
14         [ \
15 -       arpa/inet.h \
16         fcntl.h \
17         inttypes.h \
18         limits.h \
19 -       netdb.h \
20 -       netinet/in.h \
21         stdlib.h \
22         string.h \
23 -       sys/ioctl.h \
24 -       sys/socket.h \
25         sys/time.h \
26         sys/timeb.h \
27 -       syslog.h \
28         unistd.h \
29         ],
30         [],
31 @@ -355,7 +348,7 @@
32  # Checks for typedefs, structures, and compiler characteristics
33  #      
34  AC_C_CONST
35 -TYPE_SOCKLEN_T
36 +#TYPE_SOCKLEN_T
37  
38  
39  #
40 @@ -370,39 +363,46 @@
41  # Checks for POSIX Threads
42  #
43  echo "--------------------------- pthread stuff -------------------------------------"
44 -ACX_PTHREAD(
45 -       [],
46 -       [AC_MSG_ERROR([POSIX threads are required to build this program])])
47 +#ACX_PTHREAD(
48 +#      [],
49 +#      [AC_MSG_ERROR([POSIX threads are required to build this program])])
50  #
51 +PTHREAD_LIBS=" -lpthreadGC2"
52 +PTHREAD_CFLAGS=" -DPTW32_STATIC_LIB -DUPNP_STATIC_LIB"
53  # Update environment variables for pthreads
54  #
55 -CC="$PTHREAD_CC"
56 +#CC="$PTHREAD_CC"
57  CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
58  LIBS="$PTHREAD_LIBS $LIBS"
59 +
60 +AC_SUBST(PTHREAD_LIBS)
61 +AC_SUBST(PTHREAD_CFLAGS)
62 +AC_SUBST(PTHREAD_CC)
63 +
64  #
65  # Determine if pthread_rwlock_t is available
66  #
67 -echo "----------------------- pthread_rwlock_t stuff --------------------------------"
68 -AC_MSG_CHECKING([if pthread_rwlock_t is available])
69 -AC_LANG([C])
70 -AC_COMPILE_IFELSE(
71 -       [AC_LANG_PROGRAM(
72 -               [#include <pthread.h>],
73 -               [pthread_rwlock_t *x;])],
74 -       [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
75 -               AC_MSG_RESULT([yes, supported without any options])],
76 -       [AC_COMPILE_IFELSE(
77 -               [AC_LANG_PROGRAM(
78 -                       [#define _GNU_SOURCE
79 -                       #include <pthread.h>],
80 -                       [pthread_rwlock_t *x;])],
81 -               [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
82 -                       CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
83 -                       AC_MSG_RESULT([yes, definition of _GNU_SOURCE required])],
84 -               [AC_DEFINE([UPNP_USE_RWLOCK], [0], [Do not use pthread_rwlock_t])
85 -                       AC_MSG_RESULT([no, needs to fallback to pthread_mutex])
86 -                       AC_MSG_ERROR([pthread_rwlock_t not available])])])
87 -echo "-------------------------------------------------------------------------------"
88 +#echo "----------------------- pthread_rwlock_t stuff --------------------------------"
89 +#AC_MSG_CHECKING([if pthread_rwlock_t is available])
90 +#AC_LANG([C])
91 +#AC_COMPILE_IFELSE(
92 +#      [AC_LANG_PROGRAM(
93 +#              [#include <pthread.h>],
94 +#              [pthread_rwlock_t *x;])],
95 +#      [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
96 +#              AC_MSG_RESULT([yes, supported without any options])],
97 +#      [AC_COMPILE_IFELSE(
98 +#              [AC_LANG_PROGRAM(
99 +#                      [#define _GNU_SOURCE
100 +#                      #include <pthread.h>],
101 +#                      [pthread_rwlock_t *x;])],
102 +#              [AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
103 +#                      CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
104 +#                      AC_MSG_RESULT([yes, definition of _GNU_SOURCE required])],
105 +#              [AC_DEFINE([UPNP_USE_RWLOCK], [0], [Do not use pthread_rwlock_t])
106 +#                      AC_MSG_RESULT([no, needs to fallback to pthread_mutex])
107 +#                      AC_MSG_ERROR([pthread_rwlock_t not available])])])
108 +#echo "-------------------------------------------------------------------------------"
109  
110  
111  AC_CONFIG_FILES([