source: trunk/debathena/debathena/aclocal/aclocal/athena_krb5.m4 @ 24361

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