$NetBSD: patch-configure,v 1.2 2012/11/30 14:44:35 gdt Exp $

Make sure we do not link against -lpthread, as we only need mutexes
that can be found in libc.

Linking with -lpthread hurst with opensc-pkcs11.so since NetBSD-6.0
libpthread cannot be loaded by dlopen()

--- configure.orig	2011-07-15 10:46:59.000000000 +0000
+++ configure
@@ -12903,6 +12903,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 acx_pthread_ok=no
 
+case "${host_cpu}-${host_os}" in
+        *netbsd*)
+		acx_pthread_ok=yes
+		PTHREAD_CFLAGS=""
+		PTHREAD_LIBS=""
+		LIBS="$LIBS -lltdl"
+	;;
+esac
+
 # We used to check for pthread.h first, but this fails if pthread.h
 # requires special compiler flags (e.g. on True64 or Sequent).
 # It gets checked for in the link test anyway.
