Merge commit 'v3.3.0' into upstream
[debian/gnuradio] / gr-audio-portaudio / autoconfiscate.patch
1 Index: portaudio-2.0.pc.in
2 ===================================================================
3 RCS file: /home/cvs/portaudio/Attic/portaudio-2.0.pc.in,v
4 retrieving revision 1.1.2.1
5 diff -u -b -B -w -p -r1.1.2.1 portaudio-2.0.pc.in
6 --- portaudio-2.0.pc.in 19 Mar 2006 13:02:36 -0000      1.1.2.1
7 +++ portaudio-2.0.pc.in 19 Mar 2006 22:26:01 -0000
8 @@ -9,4 +9,4 @@ Requires:
9  Version: 19
10  
11  Libs: -L${libdir} -lportaudio @LIBS@
12 -Cflags: -I${includedir} @THREAD_CFLAGS@
13 +Cflags: -I${includedir} @PTHREAD_CFLAGS@
14 Index: pa_asio/iasiothiscallresolver.cpp
15 ===================================================================
16 RCS file: /home/cvs/portaudio/pa_asio/Attic/iasiothiscallresolver.cpp,v
17 retrieving revision 1.1.2.4
18 diff -u -b -B -w -p -r1.1.2.4 iasiothiscallresolver.cpp
19 --- pa_asio/iasiothiscallresolver.cpp   10 Jul 2004 03:27:41 -0000      1.1.2.4
20 +++ pa_asio/iasiothiscallresolver.cpp   19 Mar 2006 22:26:03 -0000
21 @@ -152,6 +152,7 @@
22      recent versions of the gcc assembler.
23  */
24  
25 +#include <config.h>
26  
27  // We only need IASIOThiscallResolver at all if we are on Win32. For other
28  // platforms we simply bypass the IASIOThiscallResolver definition to allow us
29 Index: pa_asio/pa_asio.cpp
30 ===================================================================
31 RCS file: /home/cvs/portaudio/pa_asio/pa_asio.cpp,v
32 retrieving revision 1.7.2.68
33 diff -u -b -B -w -p -r1.7.2.68 pa_asio.cpp
34 --- pa_asio/pa_asio.cpp 5 Dec 2005 04:55:28 -0000       1.7.2.68
35 +++ pa_asio/pa_asio.cpp 19 Mar 2006 22:26:14 -0000
36 @@ -106,7 +106,7 @@
37          must be closed).
38  */
39  
40 -
41 +#include <config.h>
42  
43  #include <stdio.h>
44  #include <assert.h>
45 Index: pa_common/pa_allocation.c
46 ===================================================================
47 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_allocation.c,v
48 retrieving revision 1.1.2.6
49 diff -u -b -B -w -p -r1.1.2.6 pa_allocation.c
50 --- pa_common/pa_allocation.c   20 Dec 2004 12:07:51 -0000      1.1.2.6
51 +++ pa_common/pa_allocation.c   19 Mar 2006 22:26:15 -0000
52 @@ -35,6 +35,8 @@
53  */
54  
55  
56 +#include <config.h>
57 +
58  #include "pa_allocation.h"
59  #include "pa_util.h"
60  
61 Index: pa_common/pa_converters.c
62 ===================================================================
63 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_converters.c,v
64 retrieving revision 1.1.2.27
65 diff -u -b -B -w -p -r1.1.2.27 pa_converters.c
66 --- pa_common/pa_converters.c   2 Nov 2005 12:14:07 -0000       1.1.2.27
67 +++ pa_common/pa_converters.c   19 Mar 2006 22:26:23 -0000
68 @@ -49,6 +49,8 @@
69  */
70  
71  
72 +#include <config.h>
73 +
74  #include "pa_converters.h"
75  #include "pa_dither.h"
76  #include "pa_endianness.h"
77 Index: pa_common/pa_cpuload.c
78 ===================================================================
79 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_cpuload.c,v
80 retrieving revision 1.1.2.14
81 diff -u -b -B -w -p -r1.1.2.14 pa_cpuload.c
82 --- pa_common/pa_cpuload.c      8 Jan 2004 22:01:12 -0000       1.1.2.14
83 +++ pa_common/pa_cpuload.c      19 Mar 2006 22:26:24 -0000
84 @@ -41,6 +41,8 @@
85  */
86  
87  
88 +#include <config.h>
89 +
90  #include "pa_cpuload.h"
91  
92  #include <assert.h>
93 Index: pa_common/pa_dither.c
94 ===================================================================
95 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_dither.c,v
96 retrieving revision 1.1.2.6
97 diff -u -b -B -w -p -r1.1.2.6 pa_dither.c
98 --- pa_common/pa_dither.c       28 May 2005 22:49:02 -0000      1.1.2.6
99 +++ pa_common/pa_dither.c       19 Mar 2006 22:26:24 -0000
100 @@ -34,6 +34,8 @@
101  */
102  
103  
104 +#include <config.h>
105 +
106  #include "pa_dither.h"
107  #include "pa_types.h"
108  
109 Index: pa_common/pa_front.c
110 ===================================================================
111 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_front.c,v
112 retrieving revision 1.1.2.52
113 diff -u -b -B -w -p -r1.1.2.52 pa_front.c
114 --- pa_common/pa_front.c        7 Dec 2005 20:10:34 -0000       1.1.2.52
115 +++ pa_common/pa_front.c        19 Mar 2006 22:26:30 -0000
116 @@ -89,6 +89,8 @@ enquire about status on the PortAudio ma
117  */
118  
119  
120 +#include <config.h>
121 +
122  #include <stdio.h>
123  #include <stdarg.h>
124  #include <memory.h>
125 Index: pa_common/pa_process.c
126 ===================================================================
127 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_process.c,v
128 retrieving revision 1.1.2.51
129 diff -u -b -B -w -p -r1.1.2.51 pa_process.c
130 --- pa_common/pa_process.c      27 Oct 2005 23:28:48 -0000      1.1.2.51
131 +++ pa_common/pa_process.c      19 Mar 2006 22:26:35 -0000
132 @@ -72,6 +72,8 @@
133  */
134  
135  
136 +#include <config.h>
137 +
138  #include <assert.h>
139  #include <string.h> /* memset() */
140  
141 Index: pa_common/pa_skeleton.c
142 ===================================================================
143 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_skeleton.c,v
144 retrieving revision 1.1.2.39
145 diff -u -b -B -w -p -r1.1.2.39 pa_skeleton.c
146 --- pa_common/pa_skeleton.c     26 Nov 2003 14:56:09 -0000      1.1.2.39
147 +++ pa_common/pa_skeleton.c     19 Mar 2006 22:26:38 -0000
148 @@ -40,6 +40,8 @@
149  */
150  
151  
152 +#include <config.h>
153 +
154  #include <string.h> /* strlen() */
155  
156  #include "pa_util.h"
157 Index: pa_common/pa_stream.c
158 ===================================================================
159 RCS file: /home/cvs/portaudio/pa_common/Attic/pa_stream.c,v
160 retrieving revision 1.1.2.12
161 diff -u -b -B -w -p -r1.1.2.12 pa_stream.c
162 --- pa_common/pa_stream.c       20 Sep 2003 21:31:00 -0000      1.1.2.12
163 +++ pa_common/pa_stream.c       19 Mar 2006 22:26:39 -0000
164 @@ -36,6 +36,8 @@
165  */
166  
167  
168 +#include <config.h>
169 +
170  #include "pa_stream.h"
171  
172  
173 Index: pa_common/pa_trace.c
174 ===================================================================
175 RCS file: /home/cvs/portaudio/pa_common/pa_trace.c,v
176 retrieving revision 1.1.1.1.2.4
177 diff -u -b -B -w -p -r1.1.1.1.2.4 pa_trace.c
178 --- pa_common/pa_trace.c        2 Nov 2005 12:06:44 -0000       1.1.1.1.2.4
179 +++ pa_common/pa_trace.c        19 Mar 2006 22:26:39 -0000
180 @@ -35,6 +35,8 @@
181  */
182  
183  
184 +#include <config.h>
185 +
186  #include <stdio.h>
187  #include <stdlib.h>
188  #include <string.h>
189 Index: pa_jack/pa_jack.c
190 ===================================================================
191 RCS file: /home/cvs/portaudio/pa_jack/Attic/pa_jack.c,v
192 retrieving revision 1.1.2.20
193 diff -u -b -B -w -p -r1.1.2.20 pa_jack.c
194 --- pa_jack/pa_jack.c   2 Oct 2005 22:02:26 -0000       1.1.2.20
195 +++ pa_jack/pa_jack.c   19 Mar 2006 22:26:46 -0000
196 @@ -35,6 +35,8 @@
197   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
198   */
199  
200 +#include <config.h>
201 +
202  #include <string.h>
203  #include <regex.h>
204  #include <stdlib.h>
205 @@ -56,7 +58,7 @@
206  #include "pa_process.h"
207  #include "pa_allocation.h"
208  #include "pa_cpuload.h"
209 -#include "../pablio/ringbuffer.c"
210 +#include "pablio/ringbuffer.c"
211  
212  static int aErr_;
213  static PaError paErr_;     /* For use with ENSURE_PA */
214 Index: pa_linux_alsa/pa_linux_alsa.c
215 ===================================================================
216 RCS file: /home/cvs/portaudio/pa_linux_alsa/Attic/pa_linux_alsa.c,v
217 retrieving revision 1.1.2.90
218 diff -u -b -B -w -p -r1.1.2.90 pa_linux_alsa.c
219 --- pa_linux_alsa/pa_linux_alsa.c       19 Mar 2006 12:28:44 -0000      1.1.2.90
220 +++ pa_linux_alsa/pa_linux_alsa.c       19 Mar 2006 22:27:00 -0000
221 @@ -34,6 +34,8 @@
222   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
223   */
224  
225 +#include <config.h>
226 +
227  #define ALSA_PCM_NEW_HW_PARAMS_API
228  #define ALSA_PCM_NEW_SW_PARAMS_API
229  #include <alsa/asoundlib.h>
230 Index: pa_mac/pa_mac_hostapis.c
231 ===================================================================
232 RCS file: /home/cvs/portaudio/pa_mac/Attic/pa_mac_hostapis.c,v
233 retrieving revision 1.1.2.1
234 diff -u -b -B -w -p -r1.1.2.1 pa_mac_hostapis.c
235 --- pa_mac/pa_mac_hostapis.c    27 May 2004 22:39:58 -0000      1.1.2.1
236 +++ pa_mac/pa_mac_hostapis.c    19 Mar 2006 22:27:00 -0000
237 @@ -33,6 +33,7 @@
238  Mac OS host API initialization function table.
239  */
240  
241 +#include <config.h>
242  
243  #include "pa_hostapi.h"
244  
245 Index: pa_mac_core/pa_mac_core.c
246 ===================================================================
247 RCS file: /home/cvs/portaudio/pa_mac_core/pa_mac_core.c,v
248 retrieving revision 1.8.2.11
249 diff -u -b -B -w -p -r1.8.2.11 pa_mac_core.c
250 --- pa_mac_core/pa_mac_core.c   27 Feb 2006 14:25:50 -0000      1.8.2.11
251 +++ pa_mac_core/pa_mac_core.c   19 Mar 2006 22:27:08 -0000
252 @@ -45,6 +45,8 @@
253   @brief AUHAL implementation of PortAudio
254  */
255  
256 +#include <config.h>
257 +
258  #include <string.h> /* strlen(), memcmp() etc. */
259  
260  #include <AudioUnit/AudioUnit.h>
261 Index: pa_mac_core/pa_mac_core_old.c
262 ===================================================================
263 RCS file: /home/cvs/portaudio/pa_mac_core/Attic/pa_mac_core_old.c,v
264 retrieving revision 1.1.2.1
265 diff -u -b -B -w -p -r1.1.2.1 pa_mac_core_old.c
266 --- pa_mac_core/pa_mac_core_old.c       24 Dec 2005 01:22:52 -0000      1.1.2.1
267 +++ pa_mac_core/pa_mac_core_old.c       19 Mar 2006 22:27:14 -0000
268 @@ -34,6 +34,8 @@
269   *
270   */
271  
272 +#include <config.h>
273 +
274  #include <CoreAudio/CoreAudio.h>
275  #include <AudioToolbox/AudioToolbox.h>
276  #include <stdio.h>
277 Index: pa_mac_core/pa_mac_core_utilities.c
278 ===================================================================
279 RCS file: /home/cvs/portaudio/pa_mac_core/Attic/pa_mac_core_utilities.c,v
280 retrieving revision 1.1.2.2
281 diff -u -b -B -w -p -r1.1.2.2 pa_mac_core_utilities.c
282 --- pa_mac_core/pa_mac_core_utilities.c 9 Dec 2005 19:43:14 -0000       1.1.2.2
283 +++ pa_mac_core/pa_mac_core_utilities.c 19 Mar 2006 22:27:14 -0000
284 @@ -10,6 +10,8 @@
285   * by Bjorn Roche.
286   */
287  
288 +#include <config.h>
289 +
290  /*
291   * Translates MacOS generated errors into PaErrors
292   */
293 Index: pa_mac_sm/pa_mac_sm.c
294 ===================================================================
295 RCS file: /home/cvs/portaudio/pa_mac_sm/Attic/pa_mac_sm.c,v
296 retrieving revision 1.1.2.1
297 diff -u -b -B -w -p -r1.1.2.1 pa_mac_sm.c
298 --- pa_mac_sm/pa_mac_sm.c       7 Jun 2002 21:20:48 -0000       1.1.2.1
299 +++ pa_mac_sm/pa_mac_sm.c       19 Mar 2006 22:27:21 -0000
300 @@ -76,6 +76,8 @@ O- Add support for native sample data fo
301  O- Review buffer sizing. Should it be based on result of siDeviceBufferInfo query?
302  O- Determine default devices somehow.
303  */
304 +#include <config.h>
305 +
306  #include <stdio.h>
307  #include <stdlib.h>
308  #include <string.h>
309 Index: pa_sgi/pa_sgi.c
310 ===================================================================
311 RCS file: /home/cvs/portaudio/pa_sgi/pa_sgi.c,v
312 retrieving revision 1.2.2.20
313 diff -u -b -B -w -p -r1.2.2.20 pa_sgi.c
314 --- pa_sgi/pa_sgi.c     3 Jan 2004 19:20:09 -0000       1.2.2.20
315 +++ pa_sgi/pa_sgi.c     19 Mar 2006 22:27:27 -0000
316 @@ -123,6 +123,8 @@
317         a outputs stereo. One can observe this in SGI's 'Audio Queue Monitor'.
318  */
319  
320 +#include <config.h>
321 +
322  #include <string.h>         /* For strlen() but also for strerror()! */
323  #include <stdio.h>          /* printf() */
324  #include <math.h>           /* fabs()   */
325 Index: pa_unix/pa_unix_hostapis.c
326 ===================================================================
327 RCS file: /home/cvs/portaudio/pa_unix/Attic/pa_unix_hostapis.c,v
328 retrieving revision 1.1.2.5
329 diff -u -b -B -w -p -r1.1.2.5 pa_unix_hostapis.c
330 --- pa_unix/pa_unix_hostapis.c  2 Oct 2003 12:35:46 -0000       1.1.2.5
331 +++ pa_unix/pa_unix_hostapis.c  19 Mar 2006 22:27:28 -0000
332 @@ -30,6 +30,8 @@
333   */
334  
335  
336 +#include <config.h>
337 +
338  #include "pa_hostapi.h"
339  
340  PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
341 Index: pa_unix/pa_unix_util.c
342 ===================================================================
343 RCS file: /home/cvs/portaudio/pa_unix/Attic/pa_unix_util.c,v
344 retrieving revision 1.1.2.8
345 diff -u -b -B -w -p -r1.1.2.8 pa_unix_util.c
346 --- pa_unix/pa_unix_util.c      20 Nov 2005 13:46:13 -0000      1.1.2.8
347 +++ pa_unix/pa_unix_util.c      19 Mar 2006 22:27:28 -0000
348 @@ -31,6 +31,8 @@
349   */
350  
351   
352 +#include <config.h>
353 +
354  #include <pthread.h>
355  #include <unistd.h>
356  #include <stdlib.h>
357 Index: pa_unix_oss/pa_unix_oss.c
358 ===================================================================
359 RCS file: /home/cvs/portaudio/pa_unix_oss/pa_unix_oss.c,v
360 retrieving revision 1.6.2.27
361 diff -u -b -B -w -p -r1.6.2.27 pa_unix_oss.c
362 --- pa_unix_oss/pa_unix_oss.c   21 Feb 2006 19:13:56 -0000      1.6.2.27
363 +++ pa_unix_oss/pa_unix_oss.c   19 Mar 2006 22:27:35 -0000
364 @@ -35,6 +35,8 @@
365   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
366   */
367  
368 +#include <config.h>
369 +
370  #include <stdio.h>
371  #include <string.h>
372  #include <math.h>
373 @@ -42,7 +44,6 @@
374  #include <sys/ioctl.h>
375  #include <unistd.h>
376  #include <pthread.h>
377 -#include <alloca.h>
378  #include <malloc.h>
379  #include <assert.h>
380  #include <errno.h>
381 @@ -52,14 +53,21 @@
382  #include <limits.h>
383  #include <semaphore.h>
384  
385 -#ifdef __FreeBSD__
386 +#ifdef HAVE_SYS_SOUNDCARD_H
387  # include <sys/soundcard.h>
388 +#elif HAVE_LINUX_SOUNDCARD_H
389 +# include <linux/soundcard.h>
390 +#elif HAVE_SOUNDCARD_H
391 +# include <soundcard.h>
392 +#else
393 +# include <machine/soundcard.h> /* JH20010905 */
394 +#endif
395 +
396 +#ifdef __FreeBSD__
397  # define DEVICE_NAME_BASE            "/dev/dsp"
398  #elif defined __linux__
399 -# include <linux/soundcard.h>
400  # define DEVICE_NAME_BASE            "/dev/dsp"
401  #else
402 -# include <machine/soundcard.h> /* JH20010905 */
403  # define DEVICE_NAME_BASE            "/dev/audio"
404  #endif
405  
406 @@ -1913,7 +1921,12 @@ static signed long GetStreamWriteAvailab
407      PaOssStream *stream = (PaOssStream*)s;
408      int delay = 0;
409  
410 +/*
411 + * FIXME: SNDCTL_DSP_GETODELAY does not exist on NetBSD
412 + */
413 +#ifdef SNDCTL_DSP_GETODELAY
414      if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 )
415 +#endif
416          return paUnanticipatedHostError;
417      
418      return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback );
419 Index: pa_unix_oss/recplay.c
420 ===================================================================
421 RCS file: /home/cvs/portaudio/pa_unix_oss/recplay.c,v
422 retrieving revision 1.1.1.1
423 diff -u -b -B -w -p -r1.1.1.1 recplay.c
424 --- pa_unix_oss/recplay.c       22 Jan 2002 00:52:44 -0000      1.1.1.1
425 +++ pa_unix_oss/recplay.c       19 Mar 2006 22:27:35 -0000
426 @@ -4,6 +4,8 @@
427   * Minimal record and playback test.
428   * 
429   */
430 +#include <config.h>
431 +
432  #include <stdio.h>
433  #include <unistd.h>
434  #include <stdlib.h>
435 Index: pa_win/pa_win_hostapis.c
436 ===================================================================
437 RCS file: /home/cvs/portaudio/pa_win/Attic/pa_win_hostapis.c,v
438 retrieving revision 1.1.2.10
439 diff -u -b -B -w -p -r1.1.2.10 pa_win_hostapis.c
440 --- pa_win/pa_win_hostapis.c    8 Sep 2004 17:31:37 -0000       1.1.2.10
441 +++ pa_win/pa_win_hostapis.c    19 Mar 2006 22:27:36 -0000
442 @@ -36,6 +36,7 @@
443      the Unix version does, we should consider being consistent.
444  */
445  
446 +#include <config.h>
447  
448  #include "pa_hostapi.h"
449  
450 Index: pa_win/pa_win_util.c
451 ===================================================================
452 RCS file: /home/cvs/portaudio/pa_win/Attic/pa_win_util.c,v
453 retrieving revision 1.1.2.7
454 diff -u -b -B -w -p -r1.1.2.7 pa_win_util.c
455 --- pa_win/pa_win_util.c        15 Sep 2003 18:30:26 -0000      1.1.2.7
456 +++ pa_win/pa_win_util.c        19 Mar 2006 22:27:36 -0000
457 @@ -37,6 +37,9 @@
458      bug. (see msdn kb Q274323).
459  */
460   
461 +#include <config.h>
462 +
463 +
464  #include <windows.h>
465  #include <mmsystem.h> /* for timeGetTime() */
466  
467 Index: pa_win/pa_x86_plain_converters.c
468 ===================================================================
469 RCS file: /home/cvs/portaudio/pa_win/Attic/pa_x86_plain_converters.c,v
470 retrieving revision 1.1.2.2
471 diff -u -b -B -w -p -r1.1.2.2 pa_x86_plain_converters.c
472 --- pa_win/pa_x86_plain_converters.c    28 Feb 2003 01:49:59 -0000      1.1.2.2
473 +++ pa_win/pa_x86_plain_converters.c    19 Mar 2006 22:27:40 -0000
474 @@ -1,3 +1,5 @@
475 +#include <config.h>
476 +
477  #include "pa_x86_plain_converters.h"
478  
479  #include "pa_converters.h"
480 Index: pa_win_ds/dsound_wrapper.c
481 ===================================================================
482 RCS file: /home/cvs/portaudio/pa_win_ds/dsound_wrapper.c,v
483 retrieving revision 1.1.1.1.2.11
484 diff -u -b -B -w -p -r1.1.1.1.2.11 dsound_wrapper.c
485 --- pa_win_ds/dsound_wrapper.c  7 Sep 2003 13:04:53 -0000       1.1.1.1.2.11
486 +++ pa_win_ds/dsound_wrapper.c  19 Mar 2006 22:27:43 -0000
487 @@ -33,6 +33,8 @@
488   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
489   *
490   */
491 +#include <config.h>
492 +
493  #include <stdio.h>
494  #include <stdlib.h>
495  #include <math.h>
496 Index: pa_win_ds/pa_win_ds.c
497 ===================================================================
498 RCS file: /home/cvs/portaudio/pa_win_ds/Attic/pa_win_ds.c,v
499 retrieving revision 1.1.2.51
500 diff -u -b -B -w -p -r1.1.2.51 pa_win_ds.c
501 --- pa_win_ds/pa_win_ds.c       26 Jan 2006 01:13:18 -0000      1.1.2.51
502 +++ pa_win_ds/pa_win_ds.c       19 Mar 2006 22:27:49 -0000
503 @@ -58,6 +58,8 @@
504          O- fix "patest_stop.c"
505  */
506  
507 +#include <config.h>
508 +
509  #include <stdio.h>
510  #include <string.h> /* strlen() */
511  
512 Index: pa_win_wdmks/pa_win_wdmks.c
513 ===================================================================
514 RCS file: /home/cvs/portaudio/pa_win_wdmks/Attic/pa_win_wdmks.c,v
515 retrieving revision 1.1.2.4
516 diff -u -b -B -w -p -r1.1.2.4 pa_win_wdmks.c
517 --- pa_win_wdmks/pa_win_wdmks.c 19 Nov 2005 10:14:01 -0000      1.1.2.4
518 +++ pa_win_wdmks/pa_win_wdmks.c 19 Mar 2006 22:28:00 -0000
519 @@ -42,6 +42,8 @@
520   of a device for the duration of active stream using those devices
521  */
522  
523 +#include <config.h>
524 +
525  #include <stdio.h>
526  
527  /* Debugging/tracing support */
528 Index: pa_win_wmme/pa_win_wmme.c
529 ===================================================================
530 RCS file: /home/cvs/portaudio/pa_win_wmme/pa_win_wmme.c,v
531 retrieving revision 1.6.2.88
532 diff -u -b -B -w -p -r1.6.2.88 pa_win_wmme.c
533 --- pa_win_wmme/pa_win_wmme.c   16 Feb 2006 01:56:45 -0000      1.6.2.88
534 +++ pa_win_wmme/pa_win_wmme.c   19 Mar 2006 22:28:14 -0000
535 @@ -100,6 +100,8 @@ Non-critical stuff for the future:
536      Events (when necessary) inside the ReadStream() and WriteStream() functions.
537  */
538  
539 +#include <config.h>
540 +
541  #include <stdio.h>
542  #include <stdlib.h>
543  #include <math.h>
544 --- /dev/null   2006-03-10 00:02:48.821312048 +0100
545 +++ Makefile.am 2006-03-19 22:49:42.000000000 +0100
546 @@ -0,0 +1,215 @@
547 +#
548 +# PortAudio V19 Makefile.am
549 +#
550 +# Stéphane Fillod
551 +#
552 +
553 +INCLUDES = -I$(top_srcdir)/pa_common
554 +
555 +COMMON_SRC = \
556 +       pa_common/pa_allocation.c \
557 +       pa_common/pa_converters.c \
558 +       pa_common/pa_cpuload.c \
559 +       pa_common/pa_dither.c \
560 +       pa_common/pa_front.c \
561 +       pa_common/pa_process.c \
562 +       pa_common/pa_skeleton.c \
563 +       pa_common/pa_stream.c \
564 +       pa_common/pa_trace.c
565 +
566 +libportaudio_coreaudio_la_SOURCES = \
567 +       pa_mac/pa_mac_hostapis.c \
568 +       pa_mac_core/pa_mac_core.c
569 +       
570 +libportaudio_mac_asio_la_SOURCES = \
571 +       pa_asio/iasiothiscallresolver.cpp
572 +libportaudio_mac_asio_la_LIBADD = @ASIO_OBJS@
573 +
574 +libportaudio_dsound_la_SOURCES = \
575 +       pa_win_ds/pa_win_ds.c \
576 +       pa_win_ds/dsound_wrapper.c \
577 +       pa_win/pa_win_hostapis.c \
578 +       pa_win/pa_win_util.c
579 +
580 +libportaudio_win_asio_la_SOURCES = \
581 +       pa_asio/pa_asio.cpp \
582 +       pa_win/pa_win_hostapis.c \
583 +       pa_win/pa_win_util.c \
584 +       pa_asio/iasiothiscallresolver.cpp 
585 +libportaudio_win_asio_la_LIBADD = @ASIO_OBJS@
586 +
587 +libportaudio_wdmks_la_SOURCES = \
588 +       pa_win_wdmks/pa_win_wdmks.c \
589 +       pa_win/pa_win_hostapis.c \
590 +       pa_win/pa_win_util.c
591 +
592 +libportaudio_wmme_la_SOURCES = \
593 +       pa_win_wmme/pa_win_wmme.c \
594 +       pa_win/pa_win_hostapis.c \
595 +               pa_win/pa_win_util.c
596 +
597 +libportaudio_sgi_la_SOURCES = \
598 +       pa_sgi/pa_sgi.c
599 +
600 +libportaudio_alsa_la_SOURCES = \
601 +       pa_linux_alsa/pa_linux_alsa.c
602 +
603 +libportaudio_jack_la_SOURCES = \
604 +       pa_jack/pa_jack.c
605 +
606 +libportaudio_oss_la_SOURCES = \
607 +       pa_unix_oss/pa_unix_oss.c
608 +
609 +libportaudio_unix_la_SOURCES = \
610 +       pa_unix/pa_unix_hostapis.c \
611 +       pa_unix/pa_unix_util.c
612 +
613 +EXTRA_LTLIBRARIES = \
614 +       libportaudio-coreaudio.la \
615 +       libportaudio-mac-asio.la \
616 +       libportaudio-dsound.la \
617 +       libportaudio-win-asio.la \
618 +       libportaudio-wdmks.la \
619 +       libportaudio-wmme.la \
620 +       libportaudio-sgi.la \
621 +       libportaudio-alsa.la \
622 +       libportaudio-jack.la \
623 +       libportaudio-oss.la \
624 +       libportaudio-unix.la
625 +
626 +noinst_LTLIBRARIES = @PA_LIBADD@
627 +lib_LTLIBRARIES = libportaudio.la
628 +
629 +
630 +libportaudio_la_SOURCES = \
631 +       $(COMMON_SRC)
632 +
633 +# -no-undefined is required by Win32 and MacOSX, should be harmless otherwise
634 +libportaudio_la_LDFLAGS = $(WINLDFLAGS) -no-undefined -version-info @PA_ABI@:@PA_REV@:@PA_AGE@
635 +libportaudio_la_CFLAGS = $(AM_CFLAGS)
636 +libportaudio_la_LIBADD = @PA_LIBADD@ -lm
637 +libportaudio_la_DEPENDENCIES = @PA_LIBADD@
638 +
639 +
640 +noinst_HEADERS =  \
641 +       pa_asio/iasiothiscallresolver.h \
642 +       pa_asio/pa_asio.h \
643 +       pa_beos/PlaybackNode.h \
644 +       pablio/pablio.h \
645 +       pablio/ringbuffer.h \
646 +       pa_common/pa_allocation.h \
647 +       pa_common/pa_converters.h \
648 +       pa_common/pa_cpuload.h \
649 +       pa_common/pa_dither.h \
650 +       pa_common/pa_endianness.h \
651 +       pa_common/pa_hostapi.h \
652 +       pa_common/pa_process.h \
653 +       pa_common/pa_stream.h \
654 +       pa_common/pa_trace.h \
655 +       pa_common/pa_types.h \
656 +       pa_common/pa_util.h \
657 +       pa_dll_switch/PaDllEntry.h \
658 +       pa_dll_switch/portaudio.h \
659 +       pa_linux_alsa/pa_linux_alsa.h \
660 +       pa_mac_core/pa_mac_core.h \
661 +       pa_unix/pa_unix_util.h \
662 +       pa_win_ds/dsound_wrapper.h \
663 +       pa_win/pa_x86_plain_converters.h \
664 +       pa_win_wmme/pa_win_wmme.h
665 +
666 +include_HEADERS = \
667 +       pa_common/portaudio.h
668 +
669 +
670 +TESTS = \
671 +       pa_tests/paqa_errs \
672 +       pa_tests/patest1 \
673 +       pa_tests/patest_buffer \
674 +       pa_tests/patest_callbackstop \
675 +       pa_tests/patest_clip \
676 +       pa_tests/patest_dither \
677 +       pa_tests/patest_hang \
678 +       pa_tests/patest_in_overflow \
679 +       pa_tests/patest_latency \
680 +       pa_tests/patest_leftright \
681 +       pa_tests/patest_longsine \
682 +       pa_tests/patest_many \
683 +       pa_tests/patest_maxsines \
684 +       pa_tests/patest_multi_sine \
685 +       pa_tests/patest_out_underflow \
686 +       pa_tests/patest_pink \
687 +       pa_tests/patest_prime \
688 +       pa_tests/patest_read_record \
689 +       pa_tests/patest_record \
690 +       pa_tests/patest_ringmix \
691 +       pa_tests/patest_saw \
692 +       pa_tests/patest_sine8 \
693 +       pa_tests/patest_sine \
694 +       pa_tests/patest_sine_formats \
695 +       pa_tests/patest_sine_time \
696 +       pa_tests/patest_start_stop \
697 +       pa_tests/patest_stop \
698 +       pa_tests/patest_sync \
699 +       pa_tests/patest_toomanysines \
700 +       pa_tests/patest_underflow \
701 +       pa_tests/patest_wire \
702 +       pa_tests/patest_write_sine \
703 +       pa_tests/pa_devs \
704 +       pa_tests/pa_fuzz \
705 +       pa_tests/pa_minlat \
706 +       pa_tests/paqa_devs
707 +
708 +check_PROGRAMS = $(TESTS)
709 +
710 +LDADD = libportaudio.la
711 +
712 +# Most of these don't compile yet.  Put them in TESTS, above, if
713 +# you want to try to compile them...
714 +ALL_TESTS = \
715 +       pa_tests/debug_convert \
716 +       pa_tests/debug_dither_calc \
717 +       pa_tests/debug_dual \
718 +       pa_tests/debug_multi_in \
719 +       pa_tests/debug_multi_out \
720 +       pa_tests/debug_record \
721 +       pa_tests/debug_record_reuse \
722 +       pa_tests/debug_sine_amp \
723 +       pa_tests/debug_sine \
724 +       pa_tests/debug_sine_formats \
725 +       pa_tests/debug_srate \
726 +       pa_tests/debug_test1 \
727 +       $(TESTS) 
728 +
729 +pkgconfigdir = $(libdir)/pkgconfig
730 +pkgconfig_DATA = portaudio-2.0.pc
731 +
732 +
733 +SUBDIRS=
734 +DIST_SUBDIRS=
735 +
736 +ACLOCAL_AMFLAGS = -I config
737 +
738 +doc: config.doxy
739 +       doxygen config.doxy
740 +
741 +# pa_asio pa_beos pablio pa_common pa_dll_switch pa_jack pa_linux_alsa pa_mac pa_mac_core pa_mac_sm pa_sgi pa_tests pa_unix pa_unix_oss pa_win pa_win_ds pa_win_wdmks pa_win_wmme
742 +
743 +PABLIO = \
744 +       pablio/pablio.def \
745 +       pablio/README.txt \
746 +       pablio/ringbuffer.h \
747 +       pablio/test_rw_echo.c \
748 +       pablio/test_w_saw.c \
749 +       pablio/pablio.c \
750 +       pablio/pablio.h \
751 +       pablio/ringbuffer.c \
752 +       pablio/test_rw.c \
753 +       pablio/test_w_saw8.c
754 +
755 +EXTRA_DIST =  \
756 +       $(PABLIO) \
757 +       config.doxy \
758 +       LICENSE.txt \
759 +       README.txt \
760 +       portaudio-2.0.pc.in \
761 +       V19-devel-readme.txt
762 --- /dev/null   2006-03-10 00:02:48.821312048 +0100
763 +++ configure.ac        2006-03-19 22:49:13.000000000 +0100
764 @@ -0,0 +1,278 @@
765 +dnl
766 +dnl portaudio V19 configure.ac script
767 +dnl
768 +dnl Stephane Fillod, Dominic Mazzoni, Arve Knudsen
769 +dnl
770 +
771 +dnl Require autoconf >= 2.57
772 +AC_PREREQ(2.57)
773 +
774 +dnl Init autoconf and make sure configure is being called
775 +dnl from the right directory
776 +AC_INIT([portaudio], [2.0cvs], [portaudio@techweb.rfa.org])
777 +AC_CONFIG_SRCDIR([pa_common/portaudio.h])
778 +AC_CONFIG_HEADERS(config.h)
779 +AC_CANONICAL_TARGET([])
780 +
781 +dnl Automake Initialisation.
782 +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, -)
783 +AM_MAINTAINER_MODE
784 +
785 +dnl Portaudio library interface version, see libtool(info), esp.
786 +dnl node 6.3 "Updating version info"
787 +PA_ABI=19
788 +PA_REV=0
789 +PA_AGE=0
790 +AC_SUBST(PA_ABI)
791 +AC_SUBST(PA_REV)
792 +AC_SUBST(PA_AGE)
793 +
794 +
795 +dnl Checks for programs.
796 +
797 +AC_PROG_CC
798 +AC_PROG_CXX
799 +AC_PROG_RANLIB
800 +AC_PROG_INSTALL
801 +AC_PROG_MAKE_SET
802 +
803 +AC_AIX
804 +AC_ISC_POSIX
805 +AC_MINIX
806 +AM_PROG_CC_STDC
807 +AC_PROG_GCC_TRADITIONAL
808 +AC_C_CONST
809 +AC_C_INLINE
810 +
811 +dnl Check for Mingw support
812 +#GR_PWIN32
813 +
814 +dnl libtool Initialisation
815 +AC_LIBTOOL_WIN32_DLL
816 +AC_PROG_LIBTOOL
817 +
818 +ACX_PTHREAD
819 +
820 +dnl This must be one of the first tests we do or it will fail...
821 +AC_C_BIGENDIAN
822 +
823 +dnl checks for various host APIs and arguments to configure that
824 +dnl turn them on or off
825 +
826 +AC_CHECK_LIB(asound, snd_pcm_open, [have_alsa=yes], [have_alsa=no])
827 +
828 +
829 +PKG_CHECK_MODULES(JACK, jack, [have_jack=yes], [have_jack=no])
830 +PKG_CHECK_LIB(jack_client_new, [$JACK_LIBS], [$JACK_CFLAGS], [have_jack=yes], [have_jack=no])
831 +
832 +AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h soundcard.h machine/soundcard.h])
833 +AC_CHECK_HEADERS(sys/ioctl.h, [have_oss=yes], [have_oss=no])
834 +
835 +dnl sizeof checks: we will need a 16-bit and a 32-bit type
836 +
837 +AC_CHECK_SIZEOF(short)
838 +AC_CHECK_SIZEOF(int)
839 +AC_CHECK_SIZEOF(long)
840 +
841 +dnl Specify options
842 +
843 +AC_ARG_WITH(alsa, 
844 +            [  --with-alsa (default=yes)],
845 +            [with_alsa=$withval], [with_alsa=$have_alsa])
846 +
847 +AC_ARG_WITH(jack, 
848 +            [  --with-jack (default=yes)],
849 +            [with_jack=$withval], [with_jack=$have_jack])
850 +
851 +AC_ARG_WITH(oss, 
852 +            [  --with-oss (default=yes)],
853 +            [with_oss=$withval], [with_oss=$have_oss])
854 +
855 +AC_ARG_WITH(winapi,
856 +            [  --with-winapi ((wmme/directx/asio) default=wmme)],
857 +            [with_winapi=$withval], [with_winapi="wmme"])
858 +
859 +dnl Mac API added for ASIO, can have other api's listed
860 +AC_ARG_WITH(macapi,
861 +            [  --with-macapi ((asio/core/sm) default=core)],
862 +            [with_macapi=$withval], [with_macapi="core"])
863 +
864 +AC_ARG_WITH(asiodir,
865 +            [  --with-asiodir (default=/usr/local/asiosdk2)],
866 +            [with_asiodir=$withval], [with_asiodir="/usr/local/asiosdk2"])
867 +
868 +AC_ARG_WITH(dxdir,
869 +            [  --with-dxdir (default=/usr/local/dx7sdk)],
870 +            [with_dxdir=$withval], [with_dxdir="/usr/local/dx7sdk"])
871 +
872 +AC_ARG_ENABLE(debug-output,
873 +       [  --enable-debug-output],
874 +        [if test x$enableval != xno ; then
875 +            AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages])
876 +          fi
877 +        ])
878 +
879 +dnl BSD configuration
880 +AC_HAVE_LIBRARY(ossaudio)
881 +
882 +dnl Mac OS X configuration
883 +
884 +AC_CHECK_LIB(CoreAudio, OpenAComponent,
885 +           [ 
886 +            have_coreaudio=yes
887 +            PA_LIBADD="$PA_LIBADD libportaudio-coreaudio.la"
888 +            AC_DEFINE([PA_USE_COREAUDIO], [], [Define to use Mac OS X CoreAudio])
889 +            #LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"
890 +            LIBS="-lCoreAudio -lAudioToolbox -lAudioUnit -lCarbon"
891 +           ], have_coreaudio=no)
892 +
893 +ASIO_CFLAGS=""
894 +ASIO_OBJS=""
895 +
896 +if [[ $with_asiodir ]] ; then
897 +  ASIODIR="$with_asiodir"
898 +fi
899 +
900 +if [[ $with_macapi = "asio" ]] ; then
901 +  echo "ASIODIR: $ASIODIR"
902 +  ASIO_CFLAGS="-Ipa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"
903 +  ASIO_OBJS=$ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/mac/asioshlib.o
904 +  PA_LIBADD="$PA_LIBADD libportaudio-mac-asio.la"
905 +fi
906 +
907 +if [[ $with_winapi = "asio" ]] ; then
908 +  echo "ASIODIR: $ASIODIR"
909 +  ASIO_CFLAGS="-ffast-math -fomit-frame-pointer -Ipa_asio -I$ASIDIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS"
910 +  ASIO_OBJS=$ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o
911 +  LIBS="$LIBS -lwinmm -lole32 -luuid"
912 +  PA_LIBADD="$PA_LIBADD libportaudio-win-asio.la"
913 +fi
914 +
915 +
916 +dnl MingW/Win configuration
917 +
918 +AC_TRY_LINK_LIB(dsound, [DSW_InitOutputBuffer(0,0,0,0);], [
919 +               #include <windows.h>
920 +               #include <DSound.h>
921 +               ], [-I$DXDIR/include],
922 +           [ 
923 +            have_directx=yes
924 +            DXDIR="$with_dxdir"
925 +             echo "DXDIR: $DXDIR"
926 +            # LDFLAGS -L./dx7sdk/lib  ?
927 +             LIBS="-lwinmm -ldsound -lole32"
928 +             CFLAGS="$CFLAGS -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS"
929 +            PA_LIBADD="$PA_LIBADD libportaudio-dsound.la"
930 +           ], have_directx=no)
931 +
932 +AC_TRY_LINK_LIB(kernel32, [DeviceIoControl(0,0,0,0,0,0,0,0);],[
933 +               #include <windows.h>
934 +               #include <winbase.h>
935 +               #include <ks.h>
936 +               ], [-I$DXDIR/include],
937 +           [ 
938 +            have_wdmks=yes
939 +            DXDIR="$with_dxdir"
940 +             echo "DXDIR: $DXDIR"
941 +            # LDFLAGS -L./dx7sdk/lib  ?
942 +             LIBS="-lwinmm -luuid -lsetupapi -lole32"
943 +             CFLAGS="$CFLAGS -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO"
944 +            PA_LIBADD="$PA_LIBADD libportaudio-wdmks.la"
945 +           ], have_wdmks=no)
946 +
947 +# WMME default ?
948 +AC_TRY_LINK_LIB(winmm, [waveOutOpen(0,0,0,0,0,0);],[
949 +               #include <windows.h>
950 +               #include <mmsystem.h>
951 +               ], [],
952 +           [ 
953 +            have_wmme=yes
954 +             LIBS="-lwinmm -lole32 -luuid"
955 +             CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS"
956 +             PA_LIBADD="$PA_LIBADD libportaudio-wmme.la"
957 +           ], have_wmme=no)
958 +
959 +
960 +dnl Unix configuration
961 +
962 +dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003).
963 +dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST).
964 +dnl
965 +
966 +AC_CHECK_LIB(audio,   alOpenPort, [have_AL=1], [have_AL=0])
967 +AC_CHECK_LIB(dmedia,  dmGetUST, [have_dmedia=1], [have_dmedia=0])
968 +
969 +
970 +if [[ $have_AL = "yes" ] && [ $have_dmedia = "yes" ]] ; then
971 +  dnl See the '#ifdef PA_USE_SGI' in file pa_unix/pa_unix_hostapis.c
972 +  dnl which selects the appropriate PaXXX_Initialize() function.
973 +  dnl
974 +
975 +  LIBS="-ldmedia -laudio"
976 +  AC_DEFINE([PA_USE_SGI], [], [Define to use special SGI system support])
977 +  PA_LIBADD="$PA_LIBADD libportaudio-sgi.la"
978 +
979 + # TODO: 
980 + #AC_MSG_ERROR([IRIX audio library not found!])
981 + #AC_MSG_ERROR([IRIX digital media library not found!])
982 +fi
983 +
984 +
985 +if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then
986 +  LIBS="$LIBS -lasound"
987 +  AC_DEFINE([PA_USE_ALSA], [], [Define to use ALSA])
988 +  PA_LIBADD="$PA_LIBADD libportaudio-alsa.la"
989 +fi
990 +
991 +if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then
992 +  LIBS="$LIBS $JACK_LIBS"
993 +  CFLAGS="$CFLAGS $JACK_CFLAGS"
994 +  AC_DEFINE([PA_USE_JACK], [], [Define to use JACK])
995 +  PA_LIBADD="$PA_LIBADD libportaudio-jack.la"
996 +fi
997 +
998 +if [[ $with_oss != "no" ]] ; then
999 +  AC_DEFINE([PA_USE_OSS], [], [Define to use Open Sound System])
1000 +  PA_LIBADD="$PA_LIBADD libportaudio-oss.la"
1001 +fi
1002 +
1003 +dnl SGI books say -lpthread should be the last of the libs mentioned.
1004 +if [[ $acx_pthread_ok = "yes" ]] ; then
1005 +  LIBS="$LIBS $PTHREAD_LIBS"
1006 +  PA_LIBADD="$PA_LIBADD libportaudio-unix.la"
1007 +else
1008 +  if [[ $with_winapi != "wmme" -a $with_winapi != "directx" -a $with_winapi != "asio" ]] ; then
1009 +    AC_MSG_ERROR([libpthread not found!])
1010 +  fi
1011 +fi
1012 +
1013 +
1014 +if [[ $with_macapi = "asio" ] || [ $with_winapi = "asio" ]] ; then
1015 +  echo "ASIODIR: $ASIODIR"
1016 +
1017 +  CFLAGS="$CFLAGS $ASIO_CFLAGS"
1018 +fi
1019 +
1020 +if [[ $ac_cv_c_bigendian = "yes" ]] ; then
1021 +  CFLAGS="$CFLAGS -DPA_BIG_ENDIAN"
1022 +else
1023 +  CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN"
1024 +fi
1025 +
1026 +
1027 +CXXFLAGS="$CXXFLAGS"
1028 +
1029 +#CFLAGS="-g -O2 -Wall -pedantic -pipe"
1030 +
1031 +CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1032 +
1033 +
1034 +dnl extra variables
1035 +AC_SUBST(PA_LIBADD)
1036 +AC_SUBST(ASIO_OBJS)
1037 +AC_SUBST(PTHREAD_CFLAGS)
1038 +AC_SUBST(CXXFLAGS)
1039 +AC_SUBST(NASM)
1040 +AC_SUBST(NASMOPT)
1041 +
1042 +AC_OUTPUT([Makefile portaudio-2.0.pc])
1043 --- /dev/null   2006-03-10 00:02:48.821312048 +0100
1044 +++ config/acx_pthread.m4       2006-03-17 15:41:05.000000000 +0100
1045 @@ -0,0 +1,190 @@
1046 +dnl Available from the GNU Autoconf Macro Archive at:
1047 +dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
1048 +dnl
1049 +AC_DEFUN([ACX_PTHREAD], [
1050 +AC_REQUIRE([AC_CANONICAL_HOST])
1051 +AC_LANG_SAVE
1052 +AC_LANG_C
1053 +acx_pthread_ok=no
1054 +
1055 +# We used to check for pthread.h first, but this fails if pthread.h
1056 +# requires special compiler flags (e.g. on True64 or Sequent).
1057 +# It gets checked for in the link test anyway.
1058 +
1059 +# First of all, check if the user has set any of the PTHREAD_LIBS,
1060 +# etcetera environment variables, and if threads linking works using
1061 +# them:
1062 +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
1063 +        save_CFLAGS="$CFLAGS"
1064 +        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1065 +        save_LIBS="$LIBS"
1066 +        LIBS="$PTHREAD_LIBS $LIBS"
1067 +        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
1068 +        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
1069 +        AC_MSG_RESULT($acx_pthread_ok)
1070 +        if test x"$acx_pthread_ok" = xno; then
1071 +                PTHREAD_LIBS=""
1072 +                PTHREAD_CFLAGS=""
1073 +        fi
1074 +        LIBS="$save_LIBS"
1075 +        CFLAGS="$save_CFLAGS"
1076 +fi
1077 +
1078 +# We must check for the threads library under a number of different
1079 +# names; the ordering is very important because some systems
1080 +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
1081 +# libraries is broken (non-POSIX).
1082 +
1083 +# Create a list of thread flags to try.  Items starting with a "-" are
1084 +# C compiler flags, and other items are library names, except for "none"
1085 +# which indicates that we try without any flags at all.
1086 +
1087 +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
1088 +
1089 +# The ordering *is* (sometimes) important.  Some notes on the
1090 +# individual items follow:
1091 +
1092 +# pthreads: AIX (must check this before -lpthread)
1093 +# none: in case threads are in libc; should be tried before -Kthread and
1094 +#       other compiler flags to prevent continual compiler warnings
1095 +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
1096 +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
1097 +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
1098 +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
1099 +# -pthreads: Solaris/gcc
1100 +# -mthreads: Mingw32/gcc, Lynx/gcc
1101 +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
1102 +#      doesn't hurt to check since this sometimes defines pthreads too;
1103 +#      also defines -D_REENTRANT)
1104 +# pthread: Linux, etcetera
1105 +# --thread-safe: KAI C++
1106 +
1107 +case "${host_cpu}-${host_os}" in
1108 +        *solaris*)
1109 +
1110 +        # On Solaris (at least, for some versions), libc contains stubbed
1111 +        # (non-functional) versions of the pthreads routines, so link-based
1112 +        # tests will erroneously succeed.  (We need to link with -pthread or
1113 +        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
1114 +        # a function called by this macro, so we could check for that, but
1115 +        # who knows whether they'll stub that too in a future libc.)  So,
1116 +        # we'll just look for -pthreads and -lpthread first:
1117 +
1118 +        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
1119 +        ;;
1120 +esac
1121 +
1122 +if test x"$acx_pthread_ok" = xno; then
1123 +for flag in $acx_pthread_flags; do
1124 +
1125 +        case $flag in
1126 +                none)
1127 +                AC_MSG_CHECKING([whether pthreads work without any flags])
1128 +                ;;
1129 +
1130 +                -*)
1131 +                AC_MSG_CHECKING([whether pthreads work with $flag])
1132 +                PTHREAD_CFLAGS="$flag"
1133 +                ;;
1134 +
1135 +                *)
1136 +                AC_MSG_CHECKING([for the pthreads library -l$flag])
1137 +                PTHREAD_LIBS="-l$flag"
1138 +                ;;
1139 +        esac
1140 +
1141 +        save_LIBS="$LIBS"
1142 +        save_CFLAGS="$CFLAGS"
1143 +        LIBS="$PTHREAD_LIBS $LIBS"
1144 +        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1145 +
1146 +        # Check for various functions.  We must include pthread.h,
1147 +        # since some functions may be macros.  (On the Sequent, we
1148 +        # need a special flag -Kthread to make this header compile.)
1149 +        # We check for pthread_join because it is in -lpthread on IRIX
1150 +        # while pthread_create is in libc.  We check for pthread_attr_init
1151 +        # due to DEC craziness with -lpthreads.  We check for
1152 +        # pthread_cleanup_push because it is one of the few pthread
1153 +        # functions on Solaris that doesn't have a non-functional libc stub.
1154 +        # We try pthread_create on general principles.
1155 +        AC_TRY_LINK([#include <pthread.h>],
1156 +                    [pthread_t th; pthread_join(th, 0);
1157 +                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
1158 +                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
1159 +                    [acx_pthread_ok=yes])
1160 +
1161 +        LIBS="$save_LIBS"
1162 +        CFLAGS="$save_CFLAGS"
1163 +
1164 +        AC_MSG_RESULT($acx_pthread_ok)
1165 +        if test "x$acx_pthread_ok" = xyes; then
1166 +                break;
1167 +        fi
1168 +
1169 +        PTHREAD_LIBS=""
1170 +        PTHREAD_CFLAGS=""
1171 +done
1172 +fi
1173 +
1174 +# Various other checks:
1175 +if test "x$acx_pthread_ok" = xyes; then
1176 +        save_LIBS="$LIBS"
1177 +        LIBS="$PTHREAD_LIBS $LIBS"
1178 +        save_CFLAGS="$CFLAGS"
1179 +        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1180 +
1181 +        # Detect AIX lossage: threads are created detached by default
1182 +        # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
1183 +        AC_MSG_CHECKING([for joinable pthread attribute])
1184 +        AC_TRY_LINK([#include <pthread.h>],
1185 +                    [int attr=PTHREAD_CREATE_JOINABLE;],
1186 +                    ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
1187 +        if test x"$ok" = xunknown; then
1188 +                AC_TRY_LINK([#include <pthread.h>],
1189 +                            [int attr=PTHREAD_CREATE_UNDETACHED;],
1190 +                            ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
1191 +        fi
1192 +        if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
1193 +                AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
1194 +                          [Define to the necessary symbol if this constant
1195 +                           uses a non-standard name on your system.])
1196 +        fi
1197 +        AC_MSG_RESULT(${ok})
1198 +        if test x"$ok" = xunknown; then
1199 +                AC_MSG_WARN([we do not know how to create joinable pthreads])
1200 +        fi
1201 +
1202 +        AC_MSG_CHECKING([if more special flags are required for pthreads])
1203 +        flag=no
1204 +        case "${host_cpu}-${host_os}" in
1205 +                *-aix* | *-freebsd*)     flag="-D_THREAD_SAFE";;
1206 +                *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
1207 +        esac
1208 +        AC_MSG_RESULT(${flag})
1209 +        if test "x$flag" != xno; then
1210 +                PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
1211 +        fi
1212 +
1213 +        LIBS="$save_LIBS"
1214 +        CFLAGS="$save_CFLAGS"
1215 +
1216 +        # More AIX lossage: must compile with cc_r
1217 +        AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
1218 +else
1219 +        PTHREAD_CC="$CC"
1220 +fi
1221 +
1222 +AC_SUBST(PTHREAD_LIBS)
1223 +AC_SUBST(PTHREAD_CFLAGS)
1224 +AC_SUBST(PTHREAD_CC)
1225 +
1226 +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
1227 +if test x"$acx_pthread_ok" = xyes; then
1228 +        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
1229 +        :
1230 +else
1231 +        acx_pthread_ok=no
1232 +        $2
1233 +fi
1234 +AC_LANG_RESTORE
1235 +])dnl ACX_PTHREAD
1236 --- /dev/null   2006-03-10 00:02:48.821312048 +0100
1237 +++ config/pkg_check.m4 2006-03-17 22:12:37.000000000 +0100
1238 @@ -0,0 +1,49 @@
1239 +
1240 +AC_DEFUN([PKG_CHECK_LIB], [
1241 +AC_REQUIRE([AC_CANONICAL_HOST])
1242 +AC_LANG_SAVE
1243 +AC_LANG_C
1244 +
1245 +        save_CFLAGS="$CFLAGS"
1246 +        CFLAGS="$CFLAGS $3"
1247 +        save_LIBS="$LIBS"
1248 +        LIBS="$2 $LIBS"
1249 +        AC_MSG_CHECKING([for $1 in LIBS=$2 with CFLAGS=$3])
1250 +        AC_TRY_LINK_FUNC([$1], pkg_check_try_link=yes, pkg_check_try_link=no)
1251 +        AC_MSG_RESULT($pkg_check_try_link)
1252 +        LIBS="$save_LIBS"
1253 +        CFLAGS="$save_CFLAGS"
1254 +
1255 +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
1256 +if test x"$pkg_check_try_link" = xyes; then
1257 +       $4
1258 +else
1259 +       $5
1260 +fi
1261 +AC_LANG_RESTORE
1262 +])dnl PKG_CHECK_LIB
1263 +
1264 +
1265 +AC_DEFUN([AC_TRY_LINK_LIB], [
1266 +AC_REQUIRE([AC_CANONICAL_HOST])
1267 +AC_LANG_SAVE
1268 +AC_LANG_C
1269 +
1270 +        save_CFLAGS="$CFLAGS"
1271 +        CFLAGS="$CFLAGS $4"
1272 +        save_LIBS="$LIBS"
1273 +        LIBS="-l$1 $LIBS"
1274 +        AC_MSG_CHECKING([for $2 in $1])
1275 +        AC_TRY_LINK([$3], [$2], ac_try_link_lib=yes, ac_try_link_lib=no)
1276 +        AC_MSG_RESULT($ac_try_link_lib)
1277 +        LIBS="$save_LIBS"
1278 +        CFLAGS="$save_CFLAGS"
1279 +
1280 +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
1281 +if test x"$ac_try_link_lib" = xyes; then
1282 +       $5
1283 +else
1284 +       $6
1285 +fi
1286 +AC_LANG_RESTORE
1287 +])dnl AC_TRY_LINK_LIB
1288 --- /dev/null   2006-03-10 00:02:48.821312048 +0100
1289 +++ bootstrap   2006-03-19 23:33:58.000000000 +0100
1290 @@ -0,0 +1,9 @@
1291 +#!/bin/sh
1292 +
1293 +rm -rf config.cache autom4te*.cache
1294 +
1295 +aclocal-1.9 -I config
1296 +autoconf2.50
1297 +autoheader2.50
1298 +libtoolize --automake
1299 +automake-1.9 --add-missing --foreign