[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 Hesiod. |
---|
| 16 | dnl The public macros are: |
---|
| 17 | dnl ATHENA_HESIOD |
---|
| 18 | dnl Sets HESIOD_LIBS and defines HAVE_HESIOD if Hesiod |
---|
| 19 | dnl used. |
---|
| 20 | dnl ATHENA_HESIOD_REQUIRED |
---|
| 21 | dnl Generates error if Hesiod not found. |
---|
| 22 | dnl |
---|
| 23 | dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the |
---|
| 24 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
| 25 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
| 26 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
| 27 | |
---|
| 28 | dnl ----- Hesiod ----- |
---|
| 29 | |
---|
| 30 | AC_DEFUN([ATHENA_HESIOD_CHECK], |
---|
| 31 | [AC_SEARCH_LIBS(res_send, resolv) |
---|
| 32 | if test "$hesiod" != yes; then |
---|
| 33 | CPPFLAGS="$CPPFLAGS -I$hesiod/include" |
---|
| 34 | LDFLAGS="$LDFLAGS -L$hesiod/lib" |
---|
| 35 | fi |
---|
| 36 | AC_SEARCH_LIBS(hes_resolve, hesiod, :, |
---|
| 37 | [AC_MSG_ERROR(Hesiod library not found)])]) |
---|
| 38 | |
---|
| 39 | AC_DEFUN([ATHENA_HESIOD], |
---|
| 40 | [AC_ARG_WITH(hesiod, |
---|
| 41 | [ --with-hesiod=PREFIX Use Hesiod], |
---|
| 42 | [hesiod="$withval"], [hesiod=no]) |
---|
| 43 | if test "$hesiod" != no; then |
---|
| 44 | ATHENA_HESIOD_CHECK |
---|
| 45 | HESIOD_LIBS="-lhesiod" |
---|
| 46 | AC_DEFINE(HAVE_HESIOD) |
---|
| 47 | fi |
---|
| 48 | AC_SUBST(HESIOD_LIBS)]) |
---|
| 49 | |
---|
| 50 | AC_DEFUN([ATHENA_HESIOD_REQUIRED], |
---|
| 51 | [AC_ARG_WITH(hesiod, |
---|
| 52 | [ --with-hesiod=PREFIX Specify location of Hesiod], |
---|
| 53 | [hesiod="$withval"], [hesiod=yes]) |
---|
| 54 | if test "$hesiod" != no; then |
---|
| 55 | ATHENA_HESIOD_CHECK |
---|
| 56 | else |
---|
| 57 | AC_MSG_ERROR(This package requires Hesiod.) |
---|
| 58 | fi]) |
---|