$NetBSD: patch-ac,v 1.9 2011/08/11 11:15:00 adam Exp $

--- configure.orig	2011-06-16 12:44:52.000000000 +0000
+++ configure
@@ -16866,7 +16866,7 @@ if test "${ac_cv_lib_pthread_pthread_cre
   $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.  */
 
@@ -17020,7 +17020,7 @@ fi
 
 done
 
-for ac_header in sys/select.h
+for ac_header in rfuncs.h sys/select.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default"
 if test "x$ac_cv_header_sys_select_h" = x""yes; then :
@@ -17417,7 +17417,7 @@ else
 /* end confdefs.h.  */
 __thread int foo;
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gpgme_cv_tls_works=yes
 else
   gpgme_cv_tls_works=no
@@ -18342,7 +18342,7 @@ IFS=$as_save_IFS
 esac
 fi
 GPGSM=$ac_cv_path_GPGSM
-if test -n "$GPGSM"; then
+if test "$GPGSM" != no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGSM" >&5
 $as_echo "$GPGSM" >&6; }
 else
