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