$NetBSD: patch-ai,v 1.11 2005/02/15 12:32:38 tv Exp $

--- configure.orig	2004-10-24 16:21:08.000000000 -0400
+++ configure
@@ -1326,8 +1326,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-if test $cache_file = "/dev/null"; then
-cache_file="./config.cache"
 if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
@@ -1345,8 +1343,6 @@ echo "$as_me: creating cache $cache_file
   >$cache_file
 fi
 
-fi
-
 ac_aux_dir=
 for ac_dir in config $srcdir/config; do
   if test -f $ac_dir/install-sh; then
@@ -5160,7 +5156,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db
+  BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -5916,7 +5912,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db
+  BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -10680,7 +10676,14 @@ if test $ac_cv_lib_resolv_res_search = y
 fi
 
   SASL_MECHS="$SASL_MECHS libgssapiv2.la"
-  SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/gssapi.o"
+  if test "$enable_static" = yes; then
+    SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/gssapi.o"
+
+cat >>confdefs.h <<\_ACEOF
+#define STATIC_GSSAPIV2
+_ACEOF
+
+  fi
 
   cmu_save_LIBS="$LIBS"
   LIBS="$LIBS $GSSAPIBASE_LIBS"
@@ -10778,11 +10781,6 @@ fi
 
 
 if test "$gssapi" != "no"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STATIC_GSSAPIV2
-_ACEOF
-
   mutex_default="no"
   if test "$gss_impl" = "mit"; then
      mutex_default="yes"
