--- dovecot-1.0.rc15/configure.in.orig	2006-11-18 23:41:31.000000000 +0000
+++ dovecot-1.0.rc15/configure.in	2006-11-28 15:25:16.889043097 +0000
@@ -1438,6 +1438,12 @@
 			CFLAGS="$CFLAGS `krb5-config --cflags gssapi`"
 			AC_CHECK_HEADER([gssapi/gssapi.h], [
 				AC_DEFINE(HAVE_GSSAPI,, Build with GSSAPI support)
+				AC_DEFINE(HAVE_GSSAPI_GSSAPI_H,, GSSAPI headers in gssapi/gssapi.h)
+				have_gssapi=yes
+			])
+			AC_CHECK_HEADER([gssapi.h], [
+				AC_DEFINE(HAVE_GSSAPI,, Build with GSSAPI support)
+				AC_DEFINE(HAVE_GSSAPI_H,, GSSAPI headers in gssapi.h)
 				have_gssapi=yes
 			])
 			CFLAGS=$old_CFLAGS
--- dovecot-1.0.rc15/config.h.in.orig	2006-11-18 23:42:14.000000000 +0000
+++ dovecot-1.0.rc15/config.h.in	2006-11-28 15:27:24.584537526 +0000
@@ -75,6 +75,12 @@
 /* Build with GSSAPI support */
 #undef HAVE_GSSAPI
 
+/* GSSAPI headers in gssapi/gssapi.h */
+#undef HAVE_GSSAPI_GSSAPI_H
+
+/* GSSAPI headers in gssapi.h */
+#undef HAVE_GSSAPI_H
+
 /* Define if you have the iconv() function. */
 #undef HAVE_ICONV
 
--- dovecot-1.0.rc15/src/auth/mech-gssapi.c.orig	2006-09-22 15:55:18.000000000 +0100
+++ dovecot-1.0.rc15/src/auth/mech-gssapi.c	2006-11-28 15:37:25.733077117 +0000
@@ -24,7 +24,13 @@
 
 #ifdef HAVE_GSSAPI
 
+#ifdef HAVE_GSSAPI_H
+#include <gssapi.h>
+#endif
+
+#ifdef HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
+#endif
 
 /* Non-zero flags defined in RFC 2222 */
 enum sasl_gssapi_qop {
