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_ZEPHYR |
---|
52 | dnl Sets ZEPHYR_LIBS and defines HAVE_ZEPHYR if zephyr |
---|
53 | dnl used. |
---|
54 | dnl ATHENA_ZEPHYR_REQUIRED |
---|
55 | dnl Generates error if zephyr not found. |
---|
56 | dnl |
---|
57 | dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the |
---|
58 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
59 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
60 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
61 | |
---|
62 | dnl ----- com_err ----- |
---|
63 | |
---|
64 | AC_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]) |
---|
68 | if 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)]) |
---|
75 | else |
---|
76 | AC_MSG_ERROR(This package requires com_err.) |
---|
77 | fi]) |
---|
78 | |
---|
79 | dnl ----- ss ----- |
---|
80 | |
---|
81 | AC_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]) |
---|
85 | if 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) |
---|
94 | else |
---|
95 | AC_MSG_ERROR(This package requires ss.) |
---|
96 | fi]) |
---|
97 | |
---|
98 | dnl ----- Regular expressions ----- |
---|
99 | |
---|
100 | AC_DEFUN([ATHENA_REGEXP], |
---|
101 | [AC_ARG_WITH(regex, |
---|
102 | [ --with-regex=PREFIX Use installed regex library], |
---|
103 | [regex="$withval"], [regex=no]) |
---|
104 | if 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)]) |
---|
111 | else |
---|
112 | AC_CHECK_FUNC(regcomp, :, |
---|
113 | [AC_MSG_ERROR(can't find POSIX regexp support)]) |
---|
114 | fi |
---|
115 | AC_SUBST(REGEX_LIBS)]) |
---|
116 | |
---|
117 | dnl ----- AFS ----- |
---|
118 | |
---|
119 | AC_DEFUN([ATHENA_AFS_CHECK], |
---|
120 | [AC_SEARCH_LIBS(insque, compat) |
---|
121 | AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
122 | AC_SEARCH_LIBS(socket, socket) |
---|
123 | AC_SEARCH_LIBS(res_send, resolv) |
---|
124 | if test "$afs" != yes; then |
---|
125 | CPPFLAGS="$CPPFLAGS -I$afs/include" |
---|
126 | LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs" |
---|
127 | fi |
---|
128 | AC_SEARCH_LIBS(pioctl, sys, :, [AC_MSG_ERROR(AFS libraries not found)], |
---|
129 | -lrx -llwp -lsys -lafsutil) |
---|
130 | AFS_DIR=$afs |
---|
131 | AC_SUBST(AFS_DIR)]) |
---|
132 | |
---|
133 | dnl Specify desired AFS libraries as a parameter. |
---|
134 | AC_DEFUN([ATHENA_AFS], |
---|
135 | [AC_ARG_WITH(afs, |
---|
136 | [ --with-afs=PREFIX Use AFS libraries], |
---|
137 | [afs="$withval"], [afs=no]) |
---|
138 | if test "$afs" != no; then |
---|
139 | ATHENA_AFS_CHECK |
---|
140 | AFS_LIBS=$1 |
---|
141 | AC_DEFINE(HAVE_AFS) |
---|
142 | fi |
---|
143 | AC_SUBST(AFS_LIBS)]) |
---|
144 | |
---|
145 | AC_DEFUN([ATHENA_AFS_REQUIRED], |
---|
146 | [AC_ARG_WITH(afs, |
---|
147 | [ --with-afs=PREFIX Specify location of AFS libraries], |
---|
148 | [afs="$withval"], [afs=/usr/afsws]) |
---|
149 | if test "$afs" != no; then |
---|
150 | ATHENA_AFS_CHECK |
---|
151 | else |
---|
152 | AC_MSG_ERROR(This package requires AFS libraries.) |
---|
153 | fi]) |
---|
154 | |
---|
155 | dnl ----- Kerberos 4 ----- |
---|
156 | |
---|
157 | AC_DEFUN([ATHENA_KRB4_CHECK], |
---|
158 | [AC_REQUIRE([AC_CANONICAL_TARGET]) |
---|
159 | AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
160 | AC_SEARCH_LIBS(socket, socket) |
---|
161 | AC_SEARCH_LIBS(compile, gen) |
---|
162 | if 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" |
---|
168 | fi |
---|
169 | AC_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) |
---|
176 | if test "$KRB4_LIBS" != "" ; then |
---|
177 | case "$target_os" in |
---|
178 | darwin*) KRB4_LIBS="$KRB4_LIBS -framework Kerberos" |
---|
179 | esac |
---|
180 | fi]) |
---|
181 | |
---|
182 | AC_DEFUN([ATHENA_KRB4], |
---|
183 | [AC_ARG_WITH(krb4, |
---|
184 | [ --with-krb4=PREFIX Use Kerberos 4], |
---|
185 | [krb4="$withval"], [krb4=no]) |
---|
186 | if test "$krb4" != no; then |
---|
187 | ATHENA_KRB4_CHECK |
---|
188 | if test "$KRB4_LIBS" != ""; then |
---|
189 | AC_DEFINE(HAVE_KRB4) |
---|
190 | fi |
---|
191 | fi |
---|
192 | AC_SUBST(KRB4_LIBS)]) |
---|
193 | |
---|
194 | AC_DEFUN([ATHENA_KRB4_REQUIRED], |
---|
195 | [AC_ARG_WITH(krb4, |
---|
196 | [ --with-krb4=PREFIX Specify location of Kerberos 4], |
---|
197 | [krb4="$withval"], [krb4=yes]) |
---|
198 | if 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) |
---|
204 | else |
---|
205 | AC_MSG_ERROR(This package requires Kerberos 4.) |
---|
206 | fi]) |
---|
207 | |
---|
208 | dnl ----- Kerberos 5 ----- |
---|
209 | |
---|
210 | AC_DEFUN([ATHENA_KRB5_CHECK], |
---|
211 | [AC_REQUIRE([AC_CANONICAL_TARGET]) |
---|
212 | AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
213 | AC_SEARCH_LIBS(socket, socket) |
---|
214 | AC_SEARCH_LIBS(compile, gen) |
---|
215 | if test "$krb5" != yes; then |
---|
216 | CPPFLAGS="$CPPFLAGS -I$krb5/include" |
---|
217 | LDFLAGS="$LDFLAGS -L$krb5/lib" |
---|
218 | fi |
---|
219 | AC_SEARCH_LIBS(krb5_init_context, krb5, :, |
---|
220 | [AC_MSG_ERROR(Kerberos 5 libraries not found)], |
---|
221 | -lk5crypto -lcom_err)]) |
---|
222 | |
---|
223 | AC_DEFUN([ATHENA_KRB5], |
---|
224 | [AC_ARG_WITH(krb5, |
---|
225 | [ --with-krb5=PREFIX Use Kerberos 5], |
---|
226 | [krb5="$withval"], [krb5=no]) |
---|
227 | if 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) |
---|
236 | fi |
---|
237 | AC_SUBST(KRB5_LIBS)]) |
---|
238 | |
---|
239 | AC_DEFUN([ATHENA_KRB5_REQUIRED], |
---|
240 | [AC_ARG_WITH(krb5, |
---|
241 | [ --with-krb5=PREFIX Specify location of Kerberos 5], |
---|
242 | [krb5="$withval"], [krb5=yes]) |
---|
243 | if test "$krb5" != no; then |
---|
244 | ATHENA_KRB5_CHECK |
---|
245 | else |
---|
246 | AC_MSG_ERROR(This package requires Kerberos 5.) |
---|
247 | fi]) |
---|
248 | |
---|
249 | dnl ----- Hesiod ----- |
---|
250 | |
---|
251 | AC_DEFUN([ATHENA_HESIOD_CHECK], |
---|
252 | [AC_SEARCH_LIBS(res_send, resolv) |
---|
253 | if test "$hesiod" != yes; then |
---|
254 | CPPFLAGS="$CPPFLAGS -I$hesiod/include" |
---|
255 | LDFLAGS="$LDFLAGS -L$hesiod/lib" |
---|
256 | fi |
---|
257 | AC_SEARCH_LIBS(hes_resolve, hesiod, :, |
---|
258 | [AC_MSG_ERROR(Hesiod library not found)])]) |
---|
259 | |
---|
260 | AC_DEFUN([ATHENA_HESIOD], |
---|
261 | [AC_ARG_WITH(hesiod, |
---|
262 | [ --with-hesiod=PREFIX Use Hesiod], |
---|
263 | [hesiod="$withval"], [hesiod=no]) |
---|
264 | if test "$hesiod" != no; then |
---|
265 | ATHENA_HESIOD_CHECK |
---|
266 | HESIOD_LIBS="-lhesiod" |
---|
267 | AC_DEFINE(HAVE_HESIOD) |
---|
268 | fi |
---|
269 | AC_SUBST(HESIOD_LIBS)]) |
---|
270 | |
---|
271 | AC_DEFUN([ATHENA_HESIOD_REQUIRED], |
---|
272 | [AC_ARG_WITH(hesiod, |
---|
273 | [ --with-hesiod=PREFIX Specify location of Hesiod], |
---|
274 | [hesiod="$withval"], [hesiod=yes]) |
---|
275 | if test "$hesiod" != no; then |
---|
276 | ATHENA_HESIOD_CHECK |
---|
277 | else |
---|
278 | AC_MSG_ERROR(This package requires Hesiod.) |
---|
279 | fi]) |
---|
280 | |
---|
281 | dnl ----- zephyr ----- |
---|
282 | |
---|
283 | AC_DEFUN([ATHENA_ZEPHYR_CHECK], |
---|
284 | [if test "$zephyr" != yes; then |
---|
285 | CPPFLAGS="$CPPFLAGS -I$zephyr/include" |
---|
286 | LDFLAGS="$LDFLAGS -L$zephyr/lib" |
---|
287 | fi |
---|
288 | AC_SEARCH_LIBS(ZFreeNotice, zephyr, :, [AC_MSG_ERROR(zephyr not found)])]) |
---|
289 | |
---|
290 | AC_DEFUN([ATHENA_ZEPHYR], |
---|
291 | [AC_ARG_WITH(zephyr, |
---|
292 | [ --with-zephyr=PREFIX Use zephyr], |
---|
293 | [zephyr="$withval"], [zephyr=no]) |
---|
294 | if test "$zephyr" != no; then |
---|
295 | ATHENA_ZEPHYR_CHECK |
---|
296 | ZEPHYR_LIBS="-lzephyr" |
---|
297 | AC_DEFINE(HAVE_ZEPHYR) |
---|
298 | fi |
---|
299 | AC_SUBST(ZEPHYR_LIBS)]) |
---|
300 | |
---|
301 | AC_DEFUN([ATHENA_ZEPHYR_REQUIRED], |
---|
302 | [AC_ARG_WITH(zephyr, |
---|
303 | [ --with-zephyr=PREFIX Specify location of zephyr], |
---|
304 | [zephyr="$withval"], [zephyr=yes]) |
---|
305 | if test "$zephyr" != no; then |
---|
306 | ATHENA_ZEPHYR_CHECK |
---|
307 | else |
---|
308 | AC_MSG_ERROR(This package requires zephyr.) |
---|
309 | fi]) |
---|