$NetBSD: patch-ai,v 1.5 2006/04/18 17:41:30 jlam Exp $

--- configure.orig	2005-05-15 01:58:28.000000000 -0400
+++ configure
@@ -1331,8 +1331,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.
@@ -1350,8 +1348,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
@@ -5155,7 +5151,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
@@ -5912,7 +5908,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
@@ -11158,8 +11154,15 @@ if test $ac_cv_lib_resolv_res_search = y
 fi
 
   SASL_MECHS="$SASL_MECHS libgssapiv2.la"
-  SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o"
-  SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/gssapi.c"
+  if test "$enable_static" = yes; then
+    SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o"
+    SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/gssapi.c"
+
+cat >>confdefs.h <<\_ACEOF
+#define STATIC_GSSAPIV2
+_ACEOF
+
+  fi
 
   cmu_save_LIBS="$LIBS"
   LIBS="$LIBS $GSSAPIBASE_LIBS"
@@ -11257,11 +11260,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"
