Bug #445932
--- a/cmulocal/sasl2.m4
+++ b/cmulocal/sasl2.m4
@@ -268,7 +268,11 @@
 
   cmu_save_LIBS="$LIBS"
   LIBS="$LIBS $GSSAPIBASE_LIBS"
-  AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
+  AC_CHECK_FUNCS([gsskrb5_register_acceptor_identity], [],
+    [AC_CHECK_FUNCS([krb5_gss_register_acceptor_identity],
+      [AC_CHECK_HEADERS([gssapi/gssapi_krb5.h],
+         [AC_DEFINE([HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY], [1])]
+  )])])
   AC_CHECK_FUNCS(gss_decapsulate_token)
   AC_CHECK_FUNCS(gss_encapsulate_token)
   AC_CHECK_FUNCS(gss_oid_equal)
--- a/plugins/gssapi.c
+++ b/plugins/gssapi.c
@@ -50,7 +50,7 @@
 #else
 #include <gssapi/gssapi.h>
 #endif
-#ifdef KRB5_HEIMDAL
+#if defined (KRB5_HEIMDAL) || defined (HAVE_GSSAPI_GSSAPI_KRB5_H)
 #include <gssapi/gssapi_krb5.h>
 #endif
 
