Based on gentoo bug #359005
--- a/lib/gl/m4/gss-extra.m4	2010-12-14 12:57:08.000000000 +0000
+++ b/lib/gl/m4/gss-extra.m4	2011-11-05 21:11:54.000000000 +0000
@@ -19,7 +19,16 @@
     AC_CHECK_FUNCS([gss_decapsulate_token])
     AC_CHECK_FUNCS([gss_oid_equal])
     AC_CHECK_FUNCS([gss_inquire_mech_for_saslname])
-    AC_CHECK_FUNCS([GSS_C_NT_HOSTBASED_SERVICE])
+    AC_MSG_CHECKING([for GSS_C_NT_HOSTBASED_SERVICE])
+    AC_EGREP_CPP(hostbased_service_gss_nt_yes, gssapi.h,
+    	[#include <gssapi.h>
+	#ifdef GSS_C_NT_HOSTBASED_SERVICE
+	   hostbased_service_gss_nt_yes
+	#endif],
+	    [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
+	    [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])
+	    AC_MSG_RESULT([yes])],
+	    AC_MSG_RESULT([no]))
     if test "$gssapi_impl" != "gss"; then
       AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
       if test "$ac_cv_header_gssapi_h$ac_cv_header_gssapi_gssapi_h" = "nono"; then
