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

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