source: trunk/debathena/scripts/aclocal.m4 @ 24360

Revision 24360, 8.8 KB checked in by broder, 12 years ago (diff)
Remove the ATHENA_ARES autoconf macros. Now that we are no longer maintaining zephyr, these macros are not used.
Line 
1dnl $Id: aclocal.m4,v 1.19 2006-07-12 19:53:04 ghudson Exp $
2
3dnl Copyright 1996 by the Massachusetts Institute of Technology.
4dnl
5dnl Permission to use, copy, modify, and distribute this
6dnl software and its documentation for any purpose and without
7dnl fee is hereby granted, provided that the above copyright
8dnl notice appear in all copies and that both that copyright
9dnl notice and this permission notice appear in supporting
10dnl documentation, and that the name of M.I.T. not be used in
11dnl advertising or publicity pertaining to distribution of the
12dnl software without specific, written prior permission.
13dnl M.I.T. makes no representations about the suitability of
14dnl this software for any purpose.  It is provided "as is"
15dnl without express or implied warranty.
16
17dnl This file provides local macros for packages which use specific
18dnl external libraries.  The public macros are:
19dnl
20dnl     ATHENA_UTIL_COM_ERR
21dnl             Generates error if com_err not found.
22dnl     ATHENA_UTIL_SS
23dnl             Generates error if ss not found.
24dnl     ATHENA_REGEXP
25dnl             Sets REGEX_LIBS if rx library used; ensures POSIX
26dnl             regexp support.
27dnl     ATHENA_AFS
28dnl             Sets AFS_LIBS and defines HAVE_AFS if AFS used.  Pass
29dnl             in an argument giving the desired AFS libraries;
30dnl             AFS_LIBS will be set to that value if AFS is found.
31dnl             AFS_DIR will be set to the prefix given.
32dnl     ATHENA_AFS_REQUIRED
33dnl             Generates error if AFS libraries not found.  AFS_DIR
34dnl             will be set to the prefix given.
35dnl     ATHENA_KRB4
36dnl             Sets KRB4_LIBS and defines HAVE_KRB4 if krb4 used.
37dnl     ATHENA_KRB4_REQUIRED
38dnl             Generates error if krb4 not found.  Sets KRB4_LIBS
39dnl             otherwise.  (Special behavior because krb4 libraries
40dnl             may be different if using krb4 compatibility libraries
41dnl             from krb5.)
42dnl     ATHENA_KRB5
43dnl             Sets KRB5_LIBS and defines HAVE_KRB5 if krb5 used.
44dnl     ATHENA_KRB5_REQUIRED
45dnl             Generates error if krb5 not found.
46dnl     ATHENA_HESIOD
47dnl             Sets HESIOD_LIBS and defines HAVE_HESIOD if Hesiod
48dnl             used.
49dnl     ATHENA_HESIOD_REQUIRED
50dnl             Generates error if Hesiod not found.
51dnl     ATHENA_ZEPHYR
52dnl             Sets ZEPHYR_LIBS and defines HAVE_ZEPHYR if zephyr
53dnl             used.
54dnl     ATHENA_ZEPHYR_REQUIRED
55dnl             Generates error if zephyr not found.
56dnl
57dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the
58dnl compiler find the requested libraries.  Put ATHENA_UTIL_COM_ERR
59dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there
60dnl is a com_err library in the AFS libraries which requires -lutil.
61
62dnl ----- com_err -----
63
64AC_DEFUN([ATHENA_UTIL_COM_ERR],
65[AC_ARG_WITH(com_err,
66        [  --with-com_err=PREFIX   Specify location of com_err],
67        [com_err="$withval"], [com_err=yes])
68if test "$com_err" != no; then
69        if test "$com_err" != yes; then
70                CPPFLAGS="$CPPFLAGS -I$com_err/include"
71                LDFLAGS="$LDFLAGS -L$com_err/lib"
72        fi
73        AC_SEARCH_LIBS(com_err, com_err, ,
74                       [AC_MSG_ERROR(com_err library not found)])
75else
76        AC_MSG_ERROR(This package requires com_err.)
77fi])
78
79dnl ----- ss -----
80
81AC_DEFUN([ATHENA_UTIL_SS],
82[AC_ARG_WITH(ss,
83        [  --with-ss=PREFIX        Specify location of ss (requires com_err)],
84        [ss="$withval"], [ss=yes])
85if test "$ss" != no; then
86        if test "$ss" != yes; then
87                CPPFLAGS="$CPPFLAGS -I$ss/include"
88                LDFLAGS="$LDFLAGS -L$ss/lib"
89        fi
90        AC_SEARCH_LIBS(initscr, curses)
91        AC_SEARCH_LIBS(readline, readline)
92        AC_SEARCH_LIBS(ss_perror, ss, ,
93                       [AC_MSG_ERROR(ss library not found)], -lcom_err)
94else
95        AC_MSG_ERROR(This package requires ss.)
96fi])
97
98dnl ----- Regular expressions -----
99
100AC_DEFUN([ATHENA_REGEXP],
101[AC_ARG_WITH(regex,
102        [  --with-regex=PREFIX     Use installed regex library],
103        [regex="$withval"], [regex=no])
104if test "$regex" != no; then
105        if test "$regex" != yes; then
106                CPPFLAGS="$CPPFLAGS -I$regex/include"
107                LDFLAGS="$LDFLAGS -L$regex/lib"
108        fi
109        AC_SEARCH_LIBS(regcomp, regex, REGEX_LIBS=-lregex,
110                       [AC_MSG_ERROR(regex library not found)])
111else
112        AC_CHECK_FUNC(regcomp, :,
113                      [AC_MSG_ERROR(can't find POSIX regexp support)])
114fi
115AC_SUBST(REGEX_LIBS)])
116
117dnl ----- AFS -----
118
119AC_DEFUN([ATHENA_AFS_CHECK],
120[AC_SEARCH_LIBS(insque, compat)
121AC_SEARCH_LIBS(gethostbyname, nsl)
122AC_SEARCH_LIBS(socket, socket)
123AC_SEARCH_LIBS(res_send, resolv)
124if test "$afs" != yes; then
125        CPPFLAGS="$CPPFLAGS -I$afs/include"
126        LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs"
127fi
128AC_SEARCH_LIBS(pioctl, sys, :, [AC_MSG_ERROR(AFS libraries not found)],
129               -lrx -llwp -lsys -lafsutil)
130AFS_DIR=$afs
131AC_SUBST(AFS_DIR)])
132
133dnl Specify desired AFS libraries as a parameter.
134AC_DEFUN([ATHENA_AFS],
135[AC_ARG_WITH(afs,
136        [  --with-afs=PREFIX       Use AFS libraries],
137        [afs="$withval"], [afs=no])
138if test "$afs" != no; then
139        ATHENA_AFS_CHECK
140        AFS_LIBS=$1
141        AC_DEFINE(HAVE_AFS)
142fi
143AC_SUBST(AFS_LIBS)])
144
145AC_DEFUN([ATHENA_AFS_REQUIRED],
146[AC_ARG_WITH(afs,
147        [  --with-afs=PREFIX       Specify location of AFS libraries],
148        [afs="$withval"], [afs=/usr/afsws])
149if test "$afs" != no; then
150        ATHENA_AFS_CHECK
151else
152        AC_MSG_ERROR(This package requires AFS libraries.)
153fi])
154
155dnl ----- Kerberos 4 -----
156
157AC_DEFUN([ATHENA_KRB4_CHECK],
158[AC_REQUIRE([AC_CANONICAL_TARGET])
159AC_SEARCH_LIBS(gethostbyname, nsl)
160AC_SEARCH_LIBS(socket, socket)
161AC_SEARCH_LIBS(compile, gen)
162if test "$krb4" != yes; then
163        CPPFLAGS="$CPPFLAGS -I$krb4/include"
164        if test -d "$krb4/include/kerberosIV"; then
165                CPPFLAGS="$CPPFLAGS -I$krb4/include/kerberosIV"
166        fi
167        LDFLAGS="$LDFLAGS -L$krb4/lib"
168fi
169AC_CHECK_LIB(krb4, krb_rd_req,
170             [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
171             [AC_CHECK_LIB(krb, krb_rd_req,
172                           [KRB4_LIBS="-lkrb -ldes"],
173                           [AC_MSG_WARN(--with-krb4 specified but Kerberos 4 libraries not found)],
174                           -ldes)],
175             -ldes425 -lkrb5 -lk5crypto -lcom_err)
176if test "$KRB4_LIBS" != "" ; then
177        case "$target_os" in
178        darwin*) KRB4_LIBS="$KRB4_LIBS -framework Kerberos"
179        esac
180fi])
181
182AC_DEFUN([ATHENA_KRB4],
183[AC_ARG_WITH(krb4,
184        [  --with-krb4=PREFIX      Use Kerberos 4],
185        [krb4="$withval"], [krb4=no])
186if test "$krb4" != no; then
187        ATHENA_KRB4_CHECK
188        if test "$KRB4_LIBS" != ""; then
189                AC_DEFINE(HAVE_KRB4)
190        fi
191fi
192AC_SUBST(KRB4_LIBS)])
193
194AC_DEFUN([ATHENA_KRB4_REQUIRED],
195[AC_ARG_WITH(krb4,
196        [  --with-krb4=PREFIX      Specify location of Kerberos 4],
197        [krb4="$withval"], [krb4=yes])
198if test "$krb4" != no; then
199        ATHENA_KRB4_CHECK
200        if test "$KRB4_LIBS" = ""; then
201                AC_MSG_ERROR(This package requires Kerberos 4.)
202        fi
203        AC_SUBST(KRB4_LIBS)
204else
205        AC_MSG_ERROR(This package requires Kerberos 4.)
206fi])
207
208dnl ----- Kerberos 5 -----
209
210AC_DEFUN([ATHENA_KRB5_CHECK],
211[AC_REQUIRE([AC_CANONICAL_TARGET])
212AC_SEARCH_LIBS(gethostbyname, nsl)
213AC_SEARCH_LIBS(socket, socket)
214AC_SEARCH_LIBS(compile, gen)
215if test "$krb5" != yes; then
216        CPPFLAGS="$CPPFLAGS -I$krb5/include"
217        LDFLAGS="$LDFLAGS -L$krb5/lib"
218fi
219AC_SEARCH_LIBS(krb5_init_context, krb5, :,
220               [AC_MSG_ERROR(Kerberos 5 libraries not found)],
221               -lk5crypto -lcom_err)])
222
223AC_DEFUN([ATHENA_KRB5],
224[AC_ARG_WITH(krb5,
225        [  --with-krb5=PREFIX      Use Kerberos 5],
226        [krb5="$withval"], [krb5=no])
227if test "$krb5" != no; then
228        ATHENA_KRB5_CHECK
229        KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err"
230        if test "$KRB5_LIBS" != "" ; then
231                case "$target_os" in
232                darwin*) KRB5_LIBS="$KRB5_LIBS -framework Kerberos"
233                esac
234        fi
235        AC_DEFINE(HAVE_KRB5)
236fi
237AC_SUBST(KRB5_LIBS)])
238
239AC_DEFUN([ATHENA_KRB5_REQUIRED],
240[AC_ARG_WITH(krb5,
241        [  --with-krb5=PREFIX      Specify location of Kerberos 5],
242        [krb5="$withval"], [krb5=yes])
243if test "$krb5" != no; then
244        ATHENA_KRB5_CHECK
245else
246        AC_MSG_ERROR(This package requires Kerberos 5.)
247fi])
248
249dnl ----- Hesiod -----
250
251AC_DEFUN([ATHENA_HESIOD_CHECK],
252[AC_SEARCH_LIBS(res_send, resolv)
253if test "$hesiod" != yes; then
254        CPPFLAGS="$CPPFLAGS -I$hesiod/include"
255        LDFLAGS="$LDFLAGS -L$hesiod/lib"
256fi
257AC_SEARCH_LIBS(hes_resolve, hesiod, :,
258               [AC_MSG_ERROR(Hesiod library not found)])])
259
260AC_DEFUN([ATHENA_HESIOD],
261[AC_ARG_WITH(hesiod,
262        [  --with-hesiod=PREFIX    Use Hesiod],
263        [hesiod="$withval"], [hesiod=no])
264if test "$hesiod" != no; then
265        ATHENA_HESIOD_CHECK
266        HESIOD_LIBS="-lhesiod"
267        AC_DEFINE(HAVE_HESIOD)
268fi
269AC_SUBST(HESIOD_LIBS)])
270
271AC_DEFUN([ATHENA_HESIOD_REQUIRED],
272[AC_ARG_WITH(hesiod,
273        [  --with-hesiod=PREFIX    Specify location of Hesiod],
274        [hesiod="$withval"], [hesiod=yes])
275if test "$hesiod" != no; then
276        ATHENA_HESIOD_CHECK
277else
278        AC_MSG_ERROR(This package requires Hesiod.)
279fi])
280
281dnl ----- zephyr -----
282
283AC_DEFUN([ATHENA_ZEPHYR_CHECK],
284[if test "$zephyr" != yes; then
285        CPPFLAGS="$CPPFLAGS -I$zephyr/include"
286        LDFLAGS="$LDFLAGS -L$zephyr/lib"
287fi
288AC_SEARCH_LIBS(ZFreeNotice, zephyr, :, [AC_MSG_ERROR(zephyr not found)])])
289
290AC_DEFUN([ATHENA_ZEPHYR],
291[AC_ARG_WITH(zephyr,
292        [  --with-zephyr=PREFIX      Use zephyr],
293        [zephyr="$withval"], [zephyr=no])
294if test "$zephyr" != no; then
295        ATHENA_ZEPHYR_CHECK
296        ZEPHYR_LIBS="-lzephyr"
297        AC_DEFINE(HAVE_ZEPHYR)
298fi
299AC_SUBST(ZEPHYR_LIBS)])
300
301AC_DEFUN([ATHENA_ZEPHYR_REQUIRED],
302[AC_ARG_WITH(zephyr,
303        [  --with-zephyr=PREFIX      Specify location of zephyr],
304        [zephyr="$withval"], [zephyr=yes])
305if test "$zephyr" != no; then
306        ATHENA_ZEPHYR_CHECK
307else
308        AC_MSG_ERROR(This package requires zephyr.)
309fi])
Note: See TracBrowser for help on using the repository browser.