$NetBSD: patch-ab,v 1.11 2010/09/19 15:06:18 wiz Exp $

--- configure.orig	2011-02-14 01:27:52.000000000 +0000
+++ configure
@@ -7202,13 +7202,13 @@ if test "x$ac_cv_header_pthread_h" = x""
 #define HAVE_PTHREAD_H 1
 _ACEOF
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" >&5
+$as_echo_n "checking for pthread_create in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}... " >&6; }
 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -7239,7 +7239,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
 if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
-  PTHREAD_LIBS="-lpthread"
+  PTHREAD_LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}"
 fi
 
        have_pthread=yes
@@ -17092,14 +17092,14 @@ for be in ${BACKENDS}; do
     ;;
 
     mustek_pp)
-    if test "${sane_cv_use_libieee1284}" != "yes" && test "${enable_parport_directio}" != "yes"; then
+    if test "${sane_cv_use_libieee1284}" != "yes" || test "${enable_parport_directio}" != "yes"; then
       echo "*** $be backend requires libieee1284 and paraport-directio libraries - $DISABLE_MSG"
       backend_supported="no"
     fi
     ;;
 
     dell1600n_net)
-    if test "${sane_cv_use_libjpeg}" != "yes" || test "${sane_cv_use_libtiff}" != "yes"; then
+    if test "${sane_cv_use_libjpeg}" != "yes" && test "${sane_cv_use_libtiff}" != "yes"; then
       echo "*** $be backend requires JPEG and/or TIFF library - $DISABLE_MSG"
       backend_supported="no"
     fi
