[OpenAFS] Kerberos 5, AFS, and no krb524d

Russ Allbery rra@stanford.edu
Fri, 06 Jun 2003 16:11:27 -0700


Douglas E Engert <deengert@anl.gov> writes:

> Dare I say gssapi again? 

> Its down to a well defined API, a header file, gssapi.h and access to
> shared libraries.  It does need the AFS libs, and header files.

Er, I wish that GSSAPI were that standard.

AC_DEFUN([SIDENT_LIB_GSSAPI],
[if test x"$prefix" = xNONE ; then
    kerberos=/usr/local
else
    kerberos=$prefix
fi
KRB_CPPFLAGS=
KRB_LDFLAGS=
AC_ARG_WITH([kerberos],
    AC_HELP_STRING([--with-kerberos=DIR],
                   [Path to Kerberos headers and libraries]),
    [if test x"$withval" != xno ; then
         kerberos=$withval
         KRB_CPPFLAGS="-I$kerberos/include"
         KRB_LDFLAGS="-L$kerberos/lib"
     fi])
KRB_LDFLAGS_save=$LDFLAGS
LDFLAGS="$LDFLAGS $KRB_LDFLAGS"
AC_CHECK_LIB([gssapi], [gss_import_name],
    [KRB_LIBS="-lgssapi -lkrb -lkrb5 -lasn1 -lroken -lcrypto -lcom_err"],
    [AC_CHECK_LIB([gssapi_krb5], [gss_import_name],
         [KRB_LIBS="-lgssapi_krb5 -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
          KRB_CPPFLAGS="$KRB_CPPFLAGS -I$kerberos/include/kerberosIV"],
         [AC_MSG_ERROR([no suitable Kerberos GSSAPI libraries found])],
         [-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err])],
    [-lkrb -lkrb5 -lasn1 -lroken -lcrypto -lcom_err])
LDFLAGS=$KRB_LDFLAGS_save
KRB_CPPFLAGS=`echo "$KRB_CPPFLAGS" | sed 's/^  *//'`
AC_SUBST(KRB_LDFLAGS)
AC_SUBST(KRB_LIBS)
AC_SUBST(KRB_CPPFLAGS)])

SIDENT_LIB_GSSAPI

AC_CHECK_HEADERS([gssapi.h])

dnl Checks for declarations.
AC_CHECK_DECL([GSS_C_NT_USER_NAME],
    [AC_DEFINE([HAVE_GSS_RFC_OIDS], 1,
       [Define to 1 if the GSSAPI library uses RFC-compliant OIDs.])], ,
[#ifdef HAVE_GSSAPI_H
# include <gssapi.h>
#else
# include <gssapi/gssapi.h>
#endif
])

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>