NetBSD and pthreads

Hi,

NetBSD-current and the upcoming NetBSD-2.0 do/will feature native pthreads.
Therefore, I’ve changed the detection of thread support for NetBSD for
SDL (CVS).
Without these changes libsem isn’t found (because it’s usually not installed)
and SDL will use pthread_yield_nb() which isn’t included in NetBSD’s pthreads.
I hope the patch is alright, I haven’t tested it on a stable NetBSD
release (e.g., 1.6.1).–
Christian
-------------- next part --------------
Index: configure.in

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/configure.in,v
retrieving revision 1.134
diff -u -r1.134 configure.in
configure.in 4 Jan 2004 16:20:27 -0000 1.134
+++ configure.in 6 Jan 2004 04:57:16 -0000
@@ -1171,8 +1171,17 @@
pthread_lib="-pthread"
;;
--netbsd*)

  •        pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
    
  •        pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
    
  •        AC_MSG_CHECKING(for native pthreads)
    
  •        AC_COMPILE_IFELSE([#include <pthread.h>
    
  •            ],[netbsd_native_pthreads=yes],[netbsd_native_pthreads=no])
    
  •        AC_MSG_RESULT($netbsd_native_pthreads)
    
  •        if test x$netbsd_native_pthreads = xyes; then
    
  •            pthread_cflags="-D_REENTRANT"
    
  •            pthread_lib="-lpthread"
    
  •        else 
    
  •            pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
    
  •            pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
    
  •        fi
           ;;
       *-*-openbsd*)
           pthread_cflags="-D_REENTRANT"
    

@@ -1922,7 +1931,9 @@
# Set up files for the thread library
if test x$enable_threads = xyes; then
if test x$use_pthreads = xyes; then

  •            CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
    
  •            if test x$netbsd_native_pthreads != xyes; then
    
  •                CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
    
  •            fi
           fi
           CopyUnixThreadSource
       fi
    

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040105/9541d029/attachment.pgp