summaryrefslogtreecommitdiff
path: root/devel/pwlib/files/patch-configureac
blob: 511517dc16aebd3a21d409cb11da0cdeaab4ea9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
--- configure.ac.orig	Wed Feb 22 06:53:28 2006
+++ configure.ac	Wed May 23 22:03:00 2007
@@ -136,7 +136,7 @@ case "$target_cpu" in
    x86 | i686 | i586 | i486 | i386 ) MACHTYPE=x86
                    ;;
 
-   x86_64)	   MACHTYPE=x86_64 ;
+   x86_64|amd64)   MACHTYPE=x86_64 ;
 		   P_64BIT=1 ;
                    LIB64=1 ;
 		   ;;
@@ -278,7 +278,7 @@ fi
 
 AC_MSG_CHECKING(if linker accepts -Wreorder)
 AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
-$STDCXX $CXXFLAGS -Wreorder conftest.cc > /dev/null 2>&1
+$CXX $CXXFLAGS -Wreorder conftest.cc > /dev/null 2>&1
 if test $? = 0 ; then
   AC_MSG_RESULT(yes)
   STDCXXFLAGS="$STDCXXFLAGS -Wreorder"
@@ -291,7 +291,7 @@ fi
 # $CXX $CFLAGS -Woverloaded-virtual conftest.cc > /dev/null 2>&1
 # if test $? = 0 ; then
 #   AC_MSG_RESULT(yes)
-#   STDCCFLAGS="$STDCCFLAGS -Woverloaded-virtual"
+#   STDCXXFLAGS="$STDCCFLAGS -Woverloaded-virtual"
 # else
 #   AC_MSG_RESULT(no)
 # fi
@@ -320,7 +320,7 @@ if test "$DEFAULT_RTTI" = "1" ; then
   AC_MSG_RESULT(yes)
 else
   AC_MSG_RESULT(no)
-  STDCXXFLAGS="$STDCCFLAGS -rtti"
+  STDCXXFLAGS="$STDCXXFLAGS -rtti"
 fi
 
 GCSECTIONS=0
@@ -341,7 +341,7 @@ if test 0 = 1 ;  then
   $CXX $CFLAGS -ffunction-sections -c conftest.cc > /dev/null 2>&1
   if test $? = 0 ; then
     AC_MSG_RESULT(yes)
-    STDCCFLAGS="$STDCCFLAGS -ffunction-sections"
+    STDCXXFLAGS="$STDCXXFLAGS -ffunction-sections"
     GCSECTIONS=1
   else
     AC_MSG_RESULT(no)
@@ -357,7 +357,7 @@ if test 0 = 1 ;  then
   dnl $CXX $CFLAGS -fdata-sections -c conftest.cc > /dev/null 2>&1
   dnl if test $? = 0 ; then
   dnl   AC_MSG_RESULT(yes)
-  dnl   STDCCFLAGS="$STDCCFLAGS -fdata-sections"
+  dnl   STDCXXFLAGS="$STDCXXFLAGS -fdata-sections"
   dnl   GCSECTIONS=1
   dnl else
   dnl   AC_MSG_RESULT(no)
@@ -370,7 +370,7 @@ if test 0 = 1 ;  then
   dnl $CXX $CFLAGS -fvtable-gc -c conftest.cc > /dev/null 2>&1
   dnl if test $? = 0 ; then
   dnl   AC_MSG_RESULT(yes)
-  dnl   STDCCFLAGS="$STDCCFLAGS -fvtable-gc"
+  dnl   STDCXXFLAGS="$STDCXXFLAGS -fvtable-gc"
   dnl   GCSECTIONS=1
   dnl else
   dnl   AC_MSG_RESULT(no)
@@ -593,12 +593,12 @@ dnl see if using GNU glibc++, because th
 P_HAS_ATOMIC_INT=0
 P_NEEDS_GNU_CXX_NAMESPACE=0
 AC_MSG_CHECKING(if atomic integer available)
-AC_TRY_COMPILE([#include <bits/atomicity.h>],
+AC_TRY_COMPILE([#include ${ATOMICITY_H}],
                [_Atomic_word val;], P_HAS_ATOMIC_INT=1)
 if test ${P_HAS_ATOMIC_INT} = 1 ; then
   AC_MSG_RESULT(yes)
   AC_MSG_CHECKING(if __exchange_and_add is in __gnu_cxx namespace)
-  AC_TRY_COMPILE([#include <bits/atomicity.h>],
+  AC_TRY_COMPILE([#include ${ATOMICITY_H}],
                  [_Atomic_word val; __gnu_cxx::__exchange_and_add(&val, 1)], P_NEEDS_GNU_CXX_NAMESPACE=1)
   if test ${P_NEEDS_GNU_CXX_NAMESPACE} = 1 ; then
     AC_MSG_RESULT(yes)
@@ -640,7 +640,7 @@ if test "${OSTYPE:-unknown}" = "solaris"
   AC_MSG_CHECKING(for upad128_t)
   AC_TRY_COMPILE([#include <sys/types.h>],
                  [upad128_t upad; upad._q = 0.0;], has_upad128_t=y)
-  if test ${has_upad128_t} == "y"; then
+  if test ${has_upad128_t} = "y"; then
     AC_MSG_RESULT(yes)
     AC_DEFINE(P_HAS_UPAD128_T)
   else
@@ -665,7 +665,7 @@ if test ${OSTYPE} != Darwin ; then
   fi
 fi
 
-if test "${P_HAS_SEMAPHORES}x" == "x" ; then
+if test "${P_HAS_SEMAPHORES}x" = "x" ; then
   
   AC_TRY_COMPILE([#include <semaphore.h>],
                  [sem_t *s = sem_open("test", O_CREAT)],
@@ -689,18 +689,18 @@ dnl check for pthreads library
 dnl MSWIN_DISPLAY semaphore,Semaphore Support
 dnl MSWIN_DEFINE  semaphore,P_HAS_SEMAPHORES
 
-dnl Linux, Mac OS X use libpthread and -lpthread
-dnl FreeBSD uses the -pthread compiler option and uses libc_r
+dnl FreeBSD >= 5.x, Linux, Mac OS X use libpthread and -lpthread
+dnl FreeBSD < 5.x uses the -pthread compiler option and uses libc_r
 
 AC_CHECK_LIB(pthread, pthread_create, HAS_PTHREADS=yes, HAS_PTHREADS=no)
 if test ${HAS_PTHREADS} = yes ; then
-  ENDLDLIBS="$ENDLDLIBS -lpthread"
-  STDCCFLAGS="$STDCCFLAGS -D_REENTRANT"
+  ENDLDLIBS="$ENDLDLIBS ${PTHREAD_LIBS}"
+  STDCCFLAGS="$STDCCFLAGS -D_REENTRANT ${PTHREAD_LIBS}"
 else
   if test ${OSTYPE} = FreeBSD ; then
     HAS_PTHREADS=yes
-    ENDLDLIBS="$ENDLDLIBS -pthread"
-    STDCCFLAGS="$STDCCFLAGS -D_REENTRANT -pthread"
+    ENDLDLIBS="$ENDLDLIBS ${PTHREAD_LIBS}"
+    STDCCFLAGS="$STDCCFLAGS -D_REENTRANT ${PTHREAD_LIBS}"
   fi
 fi
 
@@ -746,7 +746,7 @@ AC_TRY_COMPILE([#include <pthread.h>],
 if test ${P_HAS_RECURSIVE_MUTEX} = 1 ; then
   AC_MSG_RESULT(yes)
 else
-  if test ${OSTYPE} == Darwin ; then
+  if test ${OSTYPE} = Darwin ; then
     AC_TRY_COMPILE([#include <pthread.h>],
     			   [pthread_mutexattr_t attr; pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);], P_HAS_RECURSIVE_MUTEX=1)
     if test ${P_HAS_RECURSIVE_MUTEX} = 1 ; then
@@ -847,7 +847,7 @@ fi
 AC_SUBST(HAS_PLUGINS)
 
 if test "x$LIB64" != "x" ; then
-  AC_DEFINE_UNQUOTED([P_DEFAULT_PLUGIN_DIR], ["${INSTALLPREFIX}/lib64/pwlib"], [Default plugin directory])
+  AC_DEFINE_UNQUOTED([P_DEFAULT_PLUGIN_DIR], ["${INSTALLPREFIX}/lib/pwlib"], [Default plugin directory])
 else
   AC_DEFINE_UNQUOTED([P_DEFAULT_PLUGIN_DIR], ["${INSTALLPREFIX}/lib/pwlib"], [Default plugin directory])
 fi
@@ -1253,7 +1253,7 @@ if test "$enable_expat" = "no" ; then
 else
   AC_CHECK_HEADERS(expat.h, HAS_EXPAT=1)
   if test "${HAS_EXPAT:-unset}" != "unset" ; then
-    AC_CHECK_LIB(expat, XML_ParserCreate, HAS_EXPAT=1, HAS_EXPAT=)
+    AC_SEARCH_LIBS(XML_ParserCreate, expat, HAS_EXPAT=1, HAS_EXPAT=)
   else
     AC_CHECK_FILE(/usr/local/include/expat.h, HAS_EXPAT=1)
     if test "${HAS_EXPAT:-unset}" != "unset" ; then
@@ -1428,7 +1428,8 @@ else
   if test $HAS_IPV6 = no ; then
     AC_MSG_RESULT(no)
   else
-    AC_TRY_COMPILE([#include <sys/socket.h>
+    AC_TRY_COMPILE([#include <stddef.h>
+		     #include <sys/socket.h>
                      #include <netdb.h>],
                      [getnameinfo(NULL, 0, NULL, 0, NULL, 0, 0);], HAS_IPV6=yes, HAS_IPV6=no)
     if test $HAS_IPV6 = no ; then
@@ -1485,7 +1486,7 @@ fi
 HAS_SDL=
 if test "$enable_sdl" = "no" ; then
   AC_MSG_NOTICE(SDL disabled)
-  AC_DEFINE(P_SDL, 0)
+#  AC_DEFINE(P_SDL, 0)
 else
   dnl SDL checks
   if test "${SDLLIB:-unset}" = "unset" ; then
@@ -1495,17 +1496,17 @@ else
   dnl Linux check
   AC_CHECK_HEADERS(SDL/SDL.h, HAS_SDL=1)
   if test "${HAS_SDL:-unset}" != "unset" ; then
-    if test "${X11LIBDIR:-unset}" == "unset" ; then
+    if test "${X11LIBDIR:-unset}" = "unset" ; then
 	X11LIBDIR=/usr/X11R6/lib
     fi
     AC_CHECK_LIB(SDL, SDL_CreateYUVOverlay, HAS_SDL=1, HAS_SDL=, -L${X11LIBDIR} -lpthread -lX11 -lXext)
   fi
 
-  dnl freeBSD SDL check
+  dnl FreeBSD SDL check
   if test "${HAS_SDL:-unset}" = "unset" ; then
-    AC_CHECK_FILE(/usr/local/include/SDL11/SDL.h, HAS_SDL=1)
+    AC_CHECK_HEADER(SDL/SDL.h, HAS_SDL=1)
     if test "${HAS_SDL:-unset}" != "unset" ; then
-      SDLLIB=SDL-1.1
+      SDLLIB=SDL
     fi
   fi
 
@@ -1527,7 +1528,7 @@ AC_SUBST(HAS_SDL)
 dnl ########################################################################
 dnl check for video capture support.
 dnl videodev.h on linux
-dnl machine/ioctl_meteor on FreeBSD
+dnl machine/ioctl_meteor or dev/bktr/ioctl_meteor.h on FreeBSD
 dnl i386/ioctl_meteor on OpenBSD
 dnl dev/ic/bt8xx on NetBSD
 
@@ -1553,9 +1554,10 @@ else
     HAS_VIDEO_CAPTURE=1
   else
     AC_CHECK_HEADER(linux/videodev.h, HAS_VIDEO_CAPTURE=1)
-    dnl AC_CHECK_HEADER(machine/ioctl_meteor.h, HAS_VIDEO_CAPTURE=1)
-    dnl AC_CHECK_HEADER(i386/ioctl_meteor.h, HAS_VIDEO_CAPTURE=1)
-    dnl AC_CHECK_HEADER(dev/ic/bt8xx.h, HAS_VIDEO_CAPTURE=1)
+    AC_CHECK_HEADER(machine/ioctl_meteor.h, HAS_VIDEO_CAPTURE=1)
+    AC_CHECK_HEADER(dev/bktr/ioctl_meteor.h, HAS_VIDEO_CAPTURE=1)
+    AC_CHECK_HEADER(i386/ioctl_meteor.h, HAS_VIDEO_CAPTURE=1)
+    AC_CHECK_HEADER(dev/ic/bt8xx.h, HAS_VIDEO_CAPTURE=1)
     if test "${HAS_VIDEO_CAPTURE}z" = "z" ; then
       AC_MSG_NOTICE(No Video Capture support)
       AC_DEFINE([NO_VIDEO_CAPTURE], [], [No video capture])
@@ -2046,6 +2048,9 @@ if test "${enable_exceptions}z" = "yesz"
   AC_MSG_NOTICE(C++ exceptions enabled)
   STDCCFLAGS="$STDCCFLAGS -fno-exceptions"
 fi
+
+STDCCFLAGS="$CPPFLAGS $STDCCFLAGS"
+STDCXXFLAGS="$CPPFLAGS $STDCXXFLAGS"
 
 dnl ########################################################################
 dnl final declarations