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_MOTIF |
---|
28 | dnl Sets MOTIF_LIBS and defines HAVE_MOTIF if Motif used. |
---|
29 | dnl ATHENA_MOTIF_REQUIRED |
---|
30 | dnl Generates error if Motif not found. |
---|
31 | dnl ATHENA_AFS |
---|
32 | dnl Sets AFS_LIBS and defines HAVE_AFS if AFS used. Pass |
---|
33 | dnl in an argument giving the desired AFS libraries; |
---|
34 | dnl AFS_LIBS will be set to that value if AFS is found. |
---|
35 | dnl AFS_DIR will be set to the prefix given. |
---|
36 | dnl ATHENA_AFS_REQUIRED |
---|
37 | dnl Generates error if AFS libraries not found. AFS_DIR |
---|
38 | dnl will be set to the prefix given. |
---|
39 | dnl ATHENA_KRB4 |
---|
40 | dnl Sets KRB4_LIBS and defines HAVE_KRB4 if krb4 used. |
---|
41 | dnl ATHENA_KRB4_REQUIRED |
---|
42 | dnl Generates error if krb4 not found. Sets KRB4_LIBS |
---|
43 | dnl otherwise. (Special behavior because krb4 libraries |
---|
44 | dnl may be different if using krb4 compatibility libraries |
---|
45 | dnl from krb5.) |
---|
46 | dnl ATHENA_KRB5 |
---|
47 | dnl Sets KRB5_LIBS and defines HAVE_KRB5 if krb5 used. |
---|
48 | dnl ATHENA_KRB5_REQUIRED |
---|
49 | dnl Generates error if krb5 not found. |
---|
50 | dnl ATHENA_HESIOD |
---|
51 | dnl Sets HESIOD_LIBS and defines HAVE_HESIOD if Hesiod |
---|
52 | dnl used. |
---|
53 | dnl ATHENA_HESIOD_REQUIRED |
---|
54 | dnl Generates error if Hesiod not found. |
---|
55 | dnl ATHENA_ARES |
---|
56 | dnl Sets ARES_LIBS and defines HAVE_ARES if libares |
---|
57 | dnl used. |
---|
58 | dnl ATHENA_ARES_REQUIRED |
---|
59 | dnl Generates error if libares not found. |
---|
60 | dnl ATHENA_ZEPHYR |
---|
61 | dnl Sets ZEPHYR_LIBS and defines HAVE_ZEPHYR if zephyr |
---|
62 | dnl used. |
---|
63 | dnl ATHENA_ZEPHYR_REQUIRED |
---|
64 | dnl Generates error if zephyr not found. |
---|
65 | dnl |
---|
66 | dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the |
---|
67 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
68 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
69 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
70 | |
---|
71 | dnl ----- com_err ----- |
---|
72 | |
---|
73 | AC_DEFUN([ATHENA_UTIL_COM_ERR], |
---|
74 | [AC_ARG_WITH(com_err, |
---|
75 | [ --with-com_err=PREFIX Specify location of com_err], |
---|
76 | [com_err="$withval"], [com_err=yes]) |
---|
77 | if test "$com_err" != no; then |
---|
78 | if test "$com_err" != yes; then |
---|
79 | CPPFLAGS="$CPPFLAGS -I$com_err/include" |
---|
80 | LDFLAGS="$LDFLAGS -L$com_err/lib" |
---|
81 | fi |
---|
82 | AC_CHECK_LIB(com_err, com_err, :, |
---|
83 | [AC_MSG_ERROR(com_err library not found)]) |
---|
84 | else |
---|
85 | AC_MSG_ERROR(This package requires com_err.) |
---|
86 | fi]) |
---|
87 | |
---|
88 | dnl ----- ss ----- |
---|
89 | |
---|
90 | AC_DEFUN([ATHENA_UTIL_SS], |
---|
91 | [AC_ARG_WITH(ss, |
---|
92 | [ --with-ss=PREFIX Specify location of ss (requires com_err)], |
---|
93 | [ss="$withval"], [ss=yes]) |
---|
94 | if test "$ss" != no; then |
---|
95 | if test "$ss" != yes; then |
---|
96 | CPPFLAGS="$CPPFLAGS -I$ss/include" |
---|
97 | LDFLAGS="$LDFLAGS -L$ss/lib" |
---|
98 | fi |
---|
99 | AC_CHECK_LIB(curses, initscr) |
---|
100 | AC_CHECK_LIB(readline, readline) |
---|
101 | AC_CHECK_LIB(ss, ss_perror, :, |
---|
102 | [AC_MSG_ERROR(ss library not found)], -lcom_err) |
---|
103 | else |
---|
104 | AC_MSG_ERROR(This package requires ss.) |
---|
105 | fi]) |
---|
106 | |
---|
107 | dnl ----- Regular expressions ----- |
---|
108 | |
---|
109 | AC_DEFUN([ATHENA_REGEXP], |
---|
110 | [AC_ARG_WITH(regex, |
---|
111 | [ --with-regex=PREFIX Use installed regex library], |
---|
112 | [regex="$withval"], [regex=no]) |
---|
113 | if test "$regex" != no; then |
---|
114 | if test "$regex" != yes; then |
---|
115 | CPPFLAGS="$CPPFLAGS -I$regex/include" |
---|
116 | LDFLAGS="$LDFLAGS -L$regex/lib" |
---|
117 | fi |
---|
118 | AC_CHECK_LIB(regex, regcomp, REGEX_LIBS=-lregex, |
---|
119 | [AC_MSG_ERROR(regex library not found)]) |
---|
120 | else |
---|
121 | AC_CHECK_FUNC(regcomp, :, |
---|
122 | [AC_MSG_ERROR(can't find POSIX regexp support)]) |
---|
123 | fi |
---|
124 | AC_SUBST(REGEX_LIBS)]) |
---|
125 | |
---|
126 | dnl ----- Motif ----- |
---|
127 | |
---|
128 | AC_DEFUN([ATHENA_MOTIF_CHECK], |
---|
129 | [if test "$motif" != yes; then |
---|
130 | CPPFLAGS="$CPPFLAGS -I$motif/include" |
---|
131 | LDFLAGS="$LDFLAGS -L$motif/lib" |
---|
132 | fi |
---|
133 | AC_CHECK_LIB(Xm, XmStringFree, :, [AC_MSG_ERROR(Motif library not found)])]) |
---|
134 | |
---|
135 | AC_DEFUN([ATHENA_MOTIF], |
---|
136 | [AC_ARG_WITH(motif, |
---|
137 | [ --with-motif=PREFIX Use Motif], |
---|
138 | [motif="$withval"], [motif=no]) |
---|
139 | if test "$motif" != no; then |
---|
140 | ATHENA_MOTIF_CHECK |
---|
141 | MOTIF_LIBS=-lXm |
---|
142 | AC_DEFINE(HAVE_MOTIF) |
---|
143 | fi |
---|
144 | AC_SUBST(MOTIF_LIBS)]) |
---|
145 | |
---|
146 | AC_DEFUN([ATHENA_MOTIF_REQUIRED], |
---|
147 | [AC_ARG_WITH(motif, |
---|
148 | [ --with-motif=PREFIX Specify location of Motif], |
---|
149 | [motif="$withval"], [motif=yes]) |
---|
150 | if test "$motif" != no; then |
---|
151 | ATHENA_MOTIF_CHECK |
---|
152 | else |
---|
153 | AC_MSG_ERROR(This package requires Motif.) |
---|
154 | fi]) |
---|
155 | |
---|
156 | dnl ----- AFS ----- |
---|
157 | |
---|
158 | AC_DEFUN([ATHENA_AFS_CHECK], |
---|
159 | [AC_CHECK_FUNC(insque, :, AC_CHECK_LIB(compat, insque)) |
---|
160 | AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) |
---|
161 | AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket)) |
---|
162 | AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send)) |
---|
163 | if test "$afs" != yes; then |
---|
164 | CPPFLAGS="$CPPFLAGS -I$afs/include" |
---|
165 | LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs" |
---|
166 | fi |
---|
167 | AC_CHECK_LIB(sys, pioctl, :, [AC_MSG_ERROR(AFS libraries not found)], |
---|
168 | -lrx -llwp -lsys -lafsutil) |
---|
169 | AFS_DIR=$afs |
---|
170 | AC_SUBST(AFS_DIR)]) |
---|
171 | |
---|
172 | dnl Specify desired AFS libraries as a parameter. |
---|
173 | AC_DEFUN([ATHENA_AFS], |
---|
174 | [AC_ARG_WITH(afs, |
---|
175 | [ --with-afs=PREFIX Use AFS libraries], |
---|
176 | [afs="$withval"], [afs=no]) |
---|
177 | if test "$afs" != no; then |
---|
178 | ATHENA_AFS_CHECK |
---|
179 | AFS_LIBS=$1 |
---|
180 | AC_DEFINE(HAVE_AFS) |
---|
181 | fi |
---|
182 | AC_SUBST(AFS_LIBS)]) |
---|
183 | |
---|
184 | AC_DEFUN([ATHENA_AFS_REQUIRED], |
---|
185 | [AC_ARG_WITH(afs, |
---|
186 | [ --with-afs=PREFIX Specify location of AFS libraries], |
---|
187 | [afs="$withval"], [afs=/usr/afsws]) |
---|
188 | if test "$afs" != no; then |
---|
189 | ATHENA_AFS_CHECK |
---|
190 | else |
---|
191 | AC_MSG_ERROR(This package requires AFS libraries.) |
---|
192 | fi]) |
---|
193 | |
---|
194 | dnl ----- Kerberos 4 ----- |
---|
195 | |
---|
196 | AC_DEFUN([ATHENA_KRB4_CHECK], |
---|
197 | [AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) |
---|
198 | AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket)) |
---|
199 | AC_CHECK_LIB(gen, compile) |
---|
200 | if test "$krb4" != yes; then |
---|
201 | CPPFLAGS="$CPPFLAGS -I$krb4/include" |
---|
202 | if test -d "$krb4/include/kerberosIV"; then |
---|
203 | CPPFLAGS="$CPPFLAGS -I$krb4/include/kerberosIV" |
---|
204 | fi |
---|
205 | LDFLAGS="$LDFLAGS -L$krb4/lib" |
---|
206 | fi |
---|
207 | AC_CHECK_LIB(krb4, krb_rd_req, |
---|
208 | [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"], |
---|
209 | [AC_CHECK_LIB(krb, krb_rd_req, |
---|
210 | [KRB4_LIBS="-lkrb -ldes"], |
---|
211 | [AC_MSG_ERROR(Kerberos 4 libraries not found)], |
---|
212 | -ldes)], |
---|
213 | -ldes425 -lkrb5 -lk5crypto -lcom_err)]) |
---|
214 | |
---|
215 | AC_DEFUN([ATHENA_KRB4], |
---|
216 | [AC_ARG_WITH(krb4, |
---|
217 | [ --with-krb4=PREFIX Use Kerberos 4], |
---|
218 | [krb4="$withval"], [krb4=no]) |
---|
219 | if test "$krb4" != no; then |
---|
220 | ATHENA_KRB4_CHECK |
---|
221 | AC_DEFINE(HAVE_KRB4) |
---|
222 | fi |
---|
223 | AC_SUBST(KRB4_LIBS)]) |
---|
224 | |
---|
225 | AC_DEFUN([ATHENA_KRB4_REQUIRED], |
---|
226 | [AC_ARG_WITH(krb4, |
---|
227 | [ --with-krb4=PREFIX Specify location of Kerberos 4], |
---|
228 | [krb4="$withval"], [krb4=yes]) |
---|
229 | if test "$krb4" != no; then |
---|
230 | ATHENA_KRB4_CHECK |
---|
231 | AC_SUBST(KRB4_LIBS) |
---|
232 | else |
---|
233 | AC_MSG_ERROR(This package requires Kerberos 4.) |
---|
234 | fi]) |
---|
235 | |
---|
236 | dnl ----- Kerberos 5 ----- |
---|
237 | |
---|
238 | AC_DEFUN([ATHENA_KRB5_CHECK], |
---|
239 | [AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
240 | AC_SEARCH_LIBS(socket, socket) |
---|
241 | AC_CHECK_LIB(gen, compile) |
---|
242 | if test "$krb5" != yes; then |
---|
243 | CPPFLAGS="$CPPFLAGS -I$krb5/include" |
---|
244 | LDFLAGS="$LDFLAGS -L$krb5/lib" |
---|
245 | fi |
---|
246 | AC_CHECK_LIB(krb5, krb5_init_context, :, |
---|
247 | [AC_MSG_ERROR(Kerberos 5 libraries not found)], |
---|
248 | -lk5crypto -lcom_err)]) |
---|
249 | |
---|
250 | AC_DEFUN([ATHENA_KRB5], |
---|
251 | [AC_ARG_WITH(krb5, |
---|
252 | [ --with-krb5=PREFIX Use Kerberos 5], |
---|
253 | [krb5="$withval"], [krb5=no]) |
---|
254 | if test "$krb5" != no; then |
---|
255 | ATHENA_KRB5_CHECK |
---|
256 | KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err" |
---|
257 | AC_DEFINE(HAVE_KRB5) |
---|
258 | fi |
---|
259 | AC_SUBST(KRB5_LIBS)]) |
---|
260 | |
---|
261 | AC_DEFUN([ATHENA_KRB5_REQUIRED], |
---|
262 | [AC_ARG_WITH(krb5, |
---|
263 | [ --with-krb5=PREFIX Specify location of Kerberos 5], |
---|
264 | [krb5="$withval"], [krb5=yes]) |
---|
265 | if test "$krb5" != no; then |
---|
266 | ATHENA_KRB5_CHECK |
---|
267 | else |
---|
268 | AC_MSG_ERROR(This package requires Kerberos 5.) |
---|
269 | fi]) |
---|
270 | |
---|
271 | dnl ----- Hesiod ----- |
---|
272 | |
---|
273 | AC_DEFUN([ATHENA_HESIOD_CHECK], |
---|
274 | [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send)) |
---|
275 | if test "$hesiod" != yes; then |
---|
276 | CPPFLAGS="$CPPFLAGS -I$hesiod/include" |
---|
277 | LDFLAGS="$LDFLAGS -L$hesiod/lib" |
---|
278 | fi |
---|
279 | AC_CHECK_LIB(hesiod, hes_resolve, :, |
---|
280 | [AC_MSG_ERROR(Hesiod library not found)])]) |
---|
281 | |
---|
282 | AC_DEFUN([ATHENA_HESIOD], |
---|
283 | [AC_ARG_WITH(hesiod, |
---|
284 | [ --with-hesiod=PREFIX Use Hesiod], |
---|
285 | [hesiod="$withval"], [hesiod=no]) |
---|
286 | if test "$hesiod" != no; then |
---|
287 | ATHENA_HESIOD_CHECK |
---|
288 | HESIOD_LIBS="-lhesiod" |
---|
289 | AC_DEFINE(HAVE_HESIOD) |
---|
290 | fi |
---|
291 | AC_SUBST(HESIOD_LIBS)]) |
---|
292 | |
---|
293 | AC_DEFUN([ATHENA_HESIOD_REQUIRED], |
---|
294 | [AC_ARG_WITH(hesiod, |
---|
295 | [ --with-hesiod=PREFIX Specify location of Hesiod], |
---|
296 | [hesiod="$withval"], [hesiod=yes]) |
---|
297 | if test "$hesiod" != no; then |
---|
298 | ATHENA_HESIOD_CHECK |
---|
299 | else |
---|
300 | AC_MSG_ERROR(This package requires Hesiod.) |
---|
301 | fi]) |
---|
302 | |
---|
303 | dnl ----- libares ----- |
---|
304 | |
---|
305 | AC_DEFUN([ATHENA_ARES_CHECK], |
---|
306 | [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send)) |
---|
307 | if test "$ares" != yes; then |
---|
308 | CPPFLAGS="$CPPFLAGS -I$ares/include" |
---|
309 | LDFLAGS="$LDFLAGS -L$ares/lib" |
---|
310 | fi |
---|
311 | AC_CHECK_LIB(ares, ares_init, :, [AC_MSG_ERROR(libares not found)])]) |
---|
312 | |
---|
313 | AC_DEFUN([ATHENA_ARES], |
---|
314 | [AC_ARG_WITH(ares, |
---|
315 | [ --with-ares=PREFIX Use libares], |
---|
316 | [ares="$withval"], [ares=no]) |
---|
317 | if test "$ares" != no; then |
---|
318 | ATHENA_ARES_CHECK |
---|
319 | ARES_LIBS="-lares" |
---|
320 | AC_DEFINE(HAVE_ARES) |
---|
321 | fi |
---|
322 | AC_SUBST(ARES_LIBS)]) |
---|
323 | |
---|
324 | AC_DEFUN([ATHENA_ARES_REQUIRED], |
---|
325 | [AC_ARG_WITH(ares, |
---|
326 | [ --with-ares=PREFIX Specify location of libares], |
---|
327 | [ares="$withval"], [ares=yes]) |
---|
328 | if test "$ares" != no; then |
---|
329 | ATHENA_ARES_CHECK |
---|
330 | else |
---|
331 | AC_MSG_ERROR(This package requires libares.) |
---|
332 | fi]) |
---|
333 | dnl ----- zephyr ----- |
---|
334 | |
---|
335 | AC_DEFUN([ATHENA_ZEPHYR_CHECK], |
---|
336 | [if test "$zephyr" != yes; then |
---|
337 | CPPFLAGS="$CPPFLAGS -I$zephyr/include" |
---|
338 | LDFLAGS="$LDFLAGS -L$zephyr/lib" |
---|
339 | fi |
---|
340 | AC_CHECK_LIB(zephyr, ZFreeNotice, :, [AC_MSG_ERROR(zephyr not found)])]) |
---|
341 | |
---|
342 | AC_DEFUN([ATHENA_ZEPHYR], |
---|
343 | [AC_ARG_WITH(zephyr, |
---|
344 | [ --with-zephyr=PREFIX Use zephyr], |
---|
345 | [zephyr="$withval"], [zephyr=no]) |
---|
346 | if test "$zephyr" != no; then |
---|
347 | ATHENA_ZEPHYR_CHECK |
---|
348 | ZEPHYR_LIBS="-lzephyr" |
---|
349 | AC_DEFINE(HAVE_ZEPHYR) |
---|
350 | fi |
---|
351 | AC_SUBST(ZEPHYR_LIBS)]) |
---|
352 | |
---|
353 | AC_DEFUN([ATHENA_ZEPHYR_REQUIRED], |
---|
354 | [AC_ARG_WITH(zephyr, |
---|
355 | [ --with-zephyr=PREFIX Specify location of zephyr], |
---|
356 | [zephyr="$withval"], [zephyr=yes]) |
---|
357 | if test "$zephyr" != no; then |
---|
358 | ATHENA_ZEPHYR_CHECK |
---|
359 | else |
---|
360 | AC_MSG_ERROR(This package requires zephyr.) |
---|
361 | fi]) |
---|