$NetBSD: patch-ab,v 1.1 2006/05/10 14:31:08 joerg Exp $

--- ../unix/configure.orig	2006-05-10 14:21:36.000000000 +0000
+++ ../unix/configure
@@ -3414,13 +3414,13 @@ else
   LIBEXT=$LIB_SUFFIX
 fi
 
-echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
-echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for pthread_mutex_init in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" >&5
+echo $ECHO_N "checking for pthread_mutex_init in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}... $ECHO_C" >&6
 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3479,7 +3479,7 @@ fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6
 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
-  LIBS="$LIBS -lpthread"
+  LIBS="$LIBS ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}"
 fi
 
 
