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

--- configure.orig	2010-04-26 00:57:49.000000000 +0000
+++ configure
@@ -11687,13 +11687,13 @@ as_val=`eval 'as_val=${'$as_ac_Header'}
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-       { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+       { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11753,7 +11753,7 @@ fi
 { $as_echo "$as_me:$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
@@ -34541,14 +34541,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
