1 dnl Autoconf macro to check for kerberos
3 AC_DEFUN([NETATALK_GSSAPI_CHECK],
10 save_LDFLAGS="$LDFLAGS"
17 [ --with-gssapi[[=PATH]] path to GSSAPI for Kerberos V UAM [[auto]]],
18 [compilegssapi=$withval],
22 if test x"$compilegssapi" != x"no" ; then
23 if test "x$compilegssapi" != "xyes" -a "x$compilegssapi" != "xauto" ; then
24 export CFLAGS="-I$withval/include"
25 export LDFLAGS="-L$withval/${atalk_libname}"
26 AC_MSG_NOTICE([checking for GSSAPI support in $compilegssapi])
29 if test x"$compilegssapi" = x"yes" -o x"$compilegssapi" = x"auto" ; then
30 # check for krb5-config from recent MIT and Heimdal kerberos 5
31 AC_PATH_PROG(KRB5_CONFIG, krb5-config)
32 AC_MSG_CHECKING([for working krb5-config that takes --libs gssapi])
34 if test -x "$KRB5_CONFIG" ; then
35 TEMP="`$KRB5_CONFIG --libs gssapi`"
36 if test $? -eq 0 ; then
37 GSSAPI_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
42 AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
45 AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
50 if test x"$compilegssapi" != x"no" -a x"$FOUND_GSSAPI" = x"no" ; then
51 # check for gssapi headers
53 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_krb5.h,
54 [gss_headers_found=yes])
55 if test x"$gss_headers_found" = x"no" ; then
56 AC_MSG_ERROR([GSSAPI installation not found, headers missing])
59 AC_SEARCH_LIBS(gss_display_status, [gss gssapi gssapi_krb5])
60 if test x"$ac_cv_search_gss_display_status" = x"no" ; then
61 AC_MSG_ERROR([GSSAPI installation not found, library missing])
63 GSSAPI_CFLAGS="$CFLAGS"
68 if test x"$FOUND_GSSAPI" = x"yes" ; then
70 export CFLAGS="$GSSAPI_CFLAGS"
71 export LIBS="$GSSAPI_LIBS"
72 AC_CHECK_FUNC(gss_acquire_cred, [], [AC_MSG_ERROR([GSSAPI: required function gss_acquire_cred missing])])
74 # Heimdal/MIT compatibility fix
75 if test "$ac_cv_header_gssapi_h" = "yes" ; then
77 GSS_C_NT_HOSTBASED_SERVICE,
79 AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE, 1, [Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h])
83 GSS_C_NT_HOSTBASED_SERVICE,
85 AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE, 1, [Wheter GSS_C_NT_HOSTBASED_SERVICE is in gssapi.h])
89 AC_DEFINE(HAVE_GSSAPI, 1, [Whether to enable GSSAPI support])
90 if test x"$ac_cv_func_gss_acquire_cred" = x"yes" ; then
91 ifelse([$1], , :, [$1])
93 ifelse([$2], , :, [$2])
98 AC_SUBST(GSSAPI_CFLAGS)
99 AC_SUBST(GSSAPI_LDFLAGS)
101 export LIBS="$save_LIBS"
102 export CFLAGS="$save_CFLAGS"
103 export LDFLAGS="$save_LDFLAGS"