[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 4. The public macros are: |
---|
| 17 | dnl ATHENA_KRB4 |
---|
| 18 | dnl Sets KRB4_LIBS and defines HAVE_KRB4 if krb4 used. |
---|
| 19 | dnl ATHENA_KRB4_REQUIRED |
---|
| 20 | dnl Generates error if krb4 not found. Sets KRB4_LIBS |
---|
| 21 | dnl otherwise. (Special behavior because krb4 libraries |
---|
| 22 | dnl may be different if using krb4 compatibility libraries |
---|
| 23 | dnl from krb5.) |
---|
| 24 | dnl |
---|
| 25 | dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the |
---|
| 26 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
| 27 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
| 28 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
| 29 | |
---|
| 30 | dnl ----- Kerberos 4 ----- |
---|
| 31 | |
---|
| 32 | AC_DEFUN([ATHENA_KRB4_CHECK], |
---|
| 33 | [AC_REQUIRE([AC_CANONICAL_TARGET]) |
---|
| 34 | AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
| 35 | AC_SEARCH_LIBS(socket, socket) |
---|
| 36 | AC_SEARCH_LIBS(compile, gen) |
---|
| 37 | if test "$krb4" != yes; then |
---|
| 38 | CPPFLAGS="$CPPFLAGS -I$krb4/include" |
---|
| 39 | if test -d "$krb4/include/kerberosIV"; then |
---|
| 40 | CPPFLAGS="$CPPFLAGS -I$krb4/include/kerberosIV" |
---|
| 41 | fi |
---|
| 42 | LDFLAGS="$LDFLAGS -L$krb4/lib" |
---|
| 43 | fi |
---|
| 44 | AC_CHECK_LIB(krb4, krb_rd_req, |
---|
| 45 | [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"], |
---|
| 46 | [AC_CHECK_LIB(krb, krb_rd_req, |
---|
| 47 | [KRB4_LIBS="-lkrb -ldes"], |
---|
| 48 | [AC_MSG_WARN(--with-krb4 specified but Kerberos 4 libraries not found)], |
---|
| 49 | -ldes)], |
---|
| 50 | -ldes425 -lkrb5 -lk5crypto -lcom_err) |
---|
| 51 | if test "$KRB4_LIBS" != "" ; then |
---|
| 52 | case "$target_os" in |
---|
| 53 | darwin*) KRB4_LIBS="$KRB4_LIBS -framework Kerberos" |
---|
| 54 | esac |
---|
| 55 | fi]) |
---|
| 56 | |
---|
| 57 | AC_DEFUN([ATHENA_KRB4], |
---|
| 58 | [AC_ARG_WITH(krb4, |
---|
| 59 | [ --with-krb4=PREFIX Use Kerberos 4], |
---|
| 60 | [krb4="$withval"], [krb4=no]) |
---|
| 61 | if test "$krb4" != no; then |
---|
| 62 | ATHENA_KRB4_CHECK |
---|
| 63 | if test "$KRB4_LIBS" != ""; then |
---|
| 64 | AC_DEFINE(HAVE_KRB4) |
---|
| 65 | fi |
---|
| 66 | fi |
---|
| 67 | AC_SUBST(KRB4_LIBS)]) |
---|
| 68 | |
---|
| 69 | AC_DEFUN([ATHENA_KRB4_REQUIRED], |
---|
| 70 | [AC_ARG_WITH(krb4, |
---|
| 71 | [ --with-krb4=PREFIX Specify location of Kerberos 4], |
---|
| 72 | [krb4="$withval"], [krb4=yes]) |
---|
| 73 | if test "$krb4" != no; then |
---|
| 74 | ATHENA_KRB4_CHECK |
---|
| 75 | if test "$KRB4_LIBS" = ""; then |
---|
| 76 | AC_MSG_ERROR(This package requires Kerberos 4.) |
---|
| 77 | fi |
---|
| 78 | AC_SUBST(KRB4_LIBS) |
---|
| 79 | else |
---|
| 80 | AC_MSG_ERROR(This package requires Kerberos 4.) |
---|
| 81 | fi]) |
---|