[24361] | 1 | dnl Copyright 1996 by the Massachusetts Institute of Technology. |
---|
| 2 | dnl |
---|
| 3 | dnl Permission to use, copy, modify, and distribute this |
---|
| 4 | dnl software and its documentation for any purpose and without |
---|
| 5 | dnl fee is hereby granted, provided that the above copyright |
---|
| 6 | dnl notice appear in all copies and that both that copyright |
---|
| 7 | dnl notice and this permission notice appear in supporting |
---|
| 8 | dnl documentation, and that the name of M.I.T. not be used in |
---|
| 9 | dnl advertising or publicity pertaining to distribution of the |
---|
| 10 | dnl software without specific, written prior permission. |
---|
| 11 | dnl M.I.T. makes no representations about the suitability of |
---|
| 12 | dnl this software for any purpose. It is provided "as is" |
---|
| 13 | dnl without express or implied warranty. |
---|
| 14 | |
---|
| 15 | dnl This file provides local macros for packages which use Kerberos |
---|
| 16 | dnl version 5. The public macros are: |
---|
| 17 | dnl ATHENA_KRB5 |
---|
| 18 | dnl Sets KRB5_LIBS and defines HAVE_KRB5 if krb5 used. |
---|
| 19 | dnl ATHENA_KRB5_REQUIRED |
---|
| 20 | dnl Generates error if krb5 not found. |
---|
| 21 | dnl |
---|
| 22 | dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the |
---|
| 23 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
| 24 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
| 25 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
| 26 | |
---|
| 27 | dnl ----- Kerberos 5 ----- |
---|
| 28 | |
---|
| 29 | AC_DEFUN([ATHENA_KRB5_CHECK], |
---|
| 30 | [AC_REQUIRE([AC_CANONICAL_TARGET]) |
---|
| 31 | AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
| 32 | AC_SEARCH_LIBS(socket, socket) |
---|
| 33 | AC_SEARCH_LIBS(compile, gen) |
---|
| 34 | if test "$krb5" != yes; then |
---|
| 35 | CPPFLAGS="$CPPFLAGS -I$krb5/include" |
---|
| 36 | LDFLAGS="$LDFLAGS -L$krb5/lib" |
---|
| 37 | fi |
---|
| 38 | AC_SEARCH_LIBS(krb5_init_context, krb5, :, |
---|
| 39 | [AC_MSG_ERROR(Kerberos 5 libraries not found)], |
---|
| 40 | -lk5crypto -lcom_err)]) |
---|
| 41 | |
---|
| 42 | AC_DEFUN([ATHENA_KRB5], |
---|
| 43 | [AC_ARG_WITH(krb5, |
---|
| 44 | [ --with-krb5=PREFIX Use Kerberos 5], |
---|
| 45 | [krb5="$withval"], [krb5=no]) |
---|
| 46 | if test "$krb5" != no; then |
---|
| 47 | ATHENA_KRB5_CHECK |
---|
| 48 | KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err" |
---|
| 49 | if test "$KRB5_LIBS" != "" ; then |
---|
| 50 | case "$target_os" in |
---|
| 51 | darwin*) KRB5_LIBS="$KRB5_LIBS -framework Kerberos" |
---|
| 52 | esac |
---|
| 53 | fi |
---|
| 54 | AC_DEFINE(HAVE_KRB5) |
---|
| 55 | fi |
---|
| 56 | AC_SUBST(KRB5_LIBS)]) |
---|
| 57 | |
---|
| 58 | AC_DEFUN([ATHENA_KRB5_REQUIRED], |
---|
| 59 | [AC_ARG_WITH(krb5, |
---|
| 60 | [ --with-krb5=PREFIX Specify location of Kerberos 5], |
---|
| 61 | [krb5="$withval"], [krb5=yes]) |
---|
| 62 | if test "$krb5" != no; then |
---|
| 63 | ATHENA_KRB5_CHECK |
---|
| 64 | else |
---|
| 65 | AC_MSG_ERROR(This package requires Kerberos 5.) |
---|
| 66 | fi]) |
---|