$NetBSD: patch-ai,v 1.7 2004/02/14 07:45:36 jlam Exp $

--- configure.orig	Mon Dec  1 08:35:06 2003
+++ configure
@@ -3915,6 +3915,12 @@ exec 5>>./config.log
 
 target=$save_target
 
+_build_libtool_libs=`${CONFIG_SHELL-/bin/sh} $srcdir/libtool --config | grep '^build_libtool_libs='`
+case "x$_build_libtool_libs" in
+	x*=yes) ac_cv_can_build_shared=yes;;
+	x*) ac_cv_can_build_shared=no;;
+esac
+
 if test "$ac_cv_can_build_shared" = no; then
 	enable_shared=no
 	enable_static=yes
@@ -10731,7 +10737,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"
@@ -10865,14 +10878,6 @@ _ACEOF
 echo "${ECHO_T}disabled" >&6
  fi
 
-
-if test "$gssapi" != "no"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STATIC_GSSAPIV2
-_ACEOF
-
-fi
 
 # Check whether --enable-anon or --disable-anon was given.
 if test "${enable_anon+set}" = set; then
