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

Revision 24263, 9.6 KB checked in by broder, 15 years ago (diff)
Did you know that nothing uses the ATHENA_MOTIF autoconf macro anymore?
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_ARES
52dnl             Sets ARES_LIBS and defines HAVE_ARES if libares
53dnl             used.
54dnl     ATHENA_ARES_REQUIRED
55dnl             Generates error if libares not found.
56dnl     ATHENA_ZEPHYR
57dnl             Sets ZEPHYR_LIBS and defines HAVE_ZEPHYR if zephyr
58dnl             used.
59dnl     ATHENA_ZEPHYR_REQUIRED
60dnl             Generates error if zephyr not found.
61dnl
62dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the
63dnl compiler find the requested libraries.  Put ATHENA_UTIL_COM_ERR
64dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there
65dnl is a com_err library in the AFS libraries which requires -lutil.
66
67dnl ----- com_err -----
68
69AC_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])
73if 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)])
80else
81        AC_MSG_ERROR(This package requires com_err.)
82fi])
83
84dnl ----- ss -----
85
86AC_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])
90if 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)
99else
100        AC_MSG_ERROR(This package requires ss.)
101fi])
102
103dnl ----- Regular expressions -----
104
105AC_DEFUN([ATHENA_REGEXP],
106[AC_ARG_WITH(regex,
107        [  --with-regex=PREFIX     Use installed regex library],
108        [regex="$withval"], [regex=no])
109if 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)])
116else
117        AC_CHECK_FUNC(regcomp, :,
118                      [AC_MSG_ERROR(can't find POSIX regexp support)])
119fi
120AC_SUBST(REGEX_LIBS)])
121
122dnl ----- AFS -----
123
124AC_DEFUN([ATHENA_AFS_CHECK],
125[AC_SEARCH_LIBS(insque, compat)
126AC_SEARCH_LIBS(gethostbyname, nsl)
127AC_SEARCH_LIBS(socket, socket)
128AC_SEARCH_LIBS(res_send, resolv)
129if test "$afs" != yes; then
130        CPPFLAGS="$CPPFLAGS -I$afs/include"
131        LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs"
132fi
133AC_SEARCH_LIBS(pioctl, sys, :, [AC_MSG_ERROR(AFS libraries not found)],
134               -lrx -llwp -lsys -lafsutil)
135AFS_DIR=$afs
136AC_SUBST(AFS_DIR)])
137
138dnl Specify desired AFS libraries as a parameter.
139AC_DEFUN([ATHENA_AFS],
140[AC_ARG_WITH(afs,
141        [  --with-afs=PREFIX       Use AFS libraries],
142        [afs="$withval"], [afs=no])
143if test "$afs" != no; then
144        ATHENA_AFS_CHECK
145        AFS_LIBS=$1
146        AC_DEFINE(HAVE_AFS)
147fi
148AC_SUBST(AFS_LIBS)])
149
150AC_DEFUN([ATHENA_AFS_REQUIRED],
151[AC_ARG_WITH(afs,
152        [  --with-afs=PREFIX       Specify location of AFS libraries],
153        [afs="$withval"], [afs=/usr/afsws])
154if test "$afs" != no; then
155        ATHENA_AFS_CHECK
156else
157        AC_MSG_ERROR(This package requires AFS libraries.)
158fi])
159
160dnl ----- Kerberos 4 -----
161
162AC_DEFUN([ATHENA_KRB4_CHECK],
163[AC_REQUIRE([AC_CANONICAL_TARGET])
164AC_SEARCH_LIBS(gethostbyname, nsl)
165AC_SEARCH_LIBS(socket, socket)
166AC_SEARCH_LIBS(compile, gen)
167if 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"
173fi
174AC_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)
181if test "$KRB4_LIBS" != "" ; then
182        case "$target_os" in
183        darwin*) KRB4_LIBS="$KRB4_LIBS -framework Kerberos"
184        esac
185fi])
186
187AC_DEFUN([ATHENA_KRB4],
188[AC_ARG_WITH(krb4,
189        [  --with-krb4=PREFIX      Use Kerberos 4],
190        [krb4="$withval"], [krb4=no])
191if test "$krb4" != no; then
192        ATHENA_KRB4_CHECK
193        if test "$KRB4_LIBS" != ""; then
194                AC_DEFINE(HAVE_KRB4)
195        fi
196fi
197AC_SUBST(KRB4_LIBS)])
198
199AC_DEFUN([ATHENA_KRB4_REQUIRED],
200[AC_ARG_WITH(krb4,
201        [  --with-krb4=PREFIX      Specify location of Kerberos 4],
202        [krb4="$withval"], [krb4=yes])
203if 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)
209else
210        AC_MSG_ERROR(This package requires Kerberos 4.)
211fi])
212
213dnl ----- Kerberos 5 -----
214
215AC_DEFUN([ATHENA_KRB5_CHECK],
216[AC_REQUIRE([AC_CANONICAL_TARGET])
217AC_SEARCH_LIBS(gethostbyname, nsl)
218AC_SEARCH_LIBS(socket, socket)
219AC_SEARCH_LIBS(compile, gen)
220if test "$krb5" != yes; then
221        CPPFLAGS="$CPPFLAGS -I$krb5/include"
222        LDFLAGS="$LDFLAGS -L$krb5/lib"
223fi
224AC_SEARCH_LIBS(krb5_init_context, krb5, :,
225               [AC_MSG_ERROR(Kerberos 5 libraries not found)],
226               -lk5crypto -lcom_err)])
227
228AC_DEFUN([ATHENA_KRB5],
229[AC_ARG_WITH(krb5,
230        [  --with-krb5=PREFIX      Use Kerberos 5],
231        [krb5="$withval"], [krb5=no])
232if 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)
241fi
242AC_SUBST(KRB5_LIBS)])
243
244AC_DEFUN([ATHENA_KRB5_REQUIRED],
245[AC_ARG_WITH(krb5,
246        [  --with-krb5=PREFIX      Specify location of Kerberos 5],
247        [krb5="$withval"], [krb5=yes])
248if test "$krb5" != no; then
249        ATHENA_KRB5_CHECK
250else
251        AC_MSG_ERROR(This package requires Kerberos 5.)
252fi])
253
254dnl ----- Hesiod -----
255
256AC_DEFUN([ATHENA_HESIOD_CHECK],
257[AC_SEARCH_LIBS(res_send, resolv)
258if test "$hesiod" != yes; then
259        CPPFLAGS="$CPPFLAGS -I$hesiod/include"
260        LDFLAGS="$LDFLAGS -L$hesiod/lib"
261fi
262AC_SEARCH_LIBS(hes_resolve, hesiod, :,
263               [AC_MSG_ERROR(Hesiod library not found)])])
264
265AC_DEFUN([ATHENA_HESIOD],
266[AC_ARG_WITH(hesiod,
267        [  --with-hesiod=PREFIX    Use Hesiod],
268        [hesiod="$withval"], [hesiod=no])
269if test "$hesiod" != no; then
270        ATHENA_HESIOD_CHECK
271        HESIOD_LIBS="-lhesiod"
272        AC_DEFINE(HAVE_HESIOD)
273fi
274AC_SUBST(HESIOD_LIBS)])
275
276AC_DEFUN([ATHENA_HESIOD_REQUIRED],
277[AC_ARG_WITH(hesiod,
278        [  --with-hesiod=PREFIX    Specify location of Hesiod],
279        [hesiod="$withval"], [hesiod=yes])
280if test "$hesiod" != no; then
281        ATHENA_HESIOD_CHECK
282else
283        AC_MSG_ERROR(This package requires Hesiod.)
284fi])
285
286dnl ----- libares -----
287
288AC_DEFUN([ATHENA_ARES_CHECK],
289[AC_SEARCH_LIBS(res_send, resolv)
290if test "$ares" != yes; then
291        CPPFLAGS="$CPPFLAGS -I$ares/include"
292        LDFLAGS="$LDFLAGS -L$ares/lib"
293fi
294AC_SEARCH_LIBS(ares_init, ares, :, [AC_MSG_ERROR(libares not found)])])
295
296AC_DEFUN([ATHENA_ARES],
297[AC_ARG_WITH(ares,
298        [  --with-ares=PREFIX      Use libares],
299        [ares="$withval"], [ares=no])
300if test "$ares" != no; then
301        ATHENA_ARES_CHECK
302        ARES_LIBS="-lares"
303        AC_DEFINE(HAVE_ARES)
304fi
305AC_SUBST(ARES_LIBS)])
306
307AC_DEFUN([ATHENA_ARES_REQUIRED],
308[AC_ARG_WITH(ares,
309        [  --with-ares=PREFIX      Specify location of libares],
310        [ares="$withval"], [ares=yes])
311if test "$ares" != no; then
312        ATHENA_ARES_CHECK
313else
314        AC_MSG_ERROR(This package requires libares.)
315fi])
316dnl ----- zephyr -----
317
318AC_DEFUN([ATHENA_ZEPHYR_CHECK],
319[if test "$zephyr" != yes; then
320        CPPFLAGS="$CPPFLAGS -I$zephyr/include"
321        LDFLAGS="$LDFLAGS -L$zephyr/lib"
322fi
323AC_SEARCH_LIBS(ZFreeNotice, zephyr, :, [AC_MSG_ERROR(zephyr not found)])])
324
325AC_DEFUN([ATHENA_ZEPHYR],
326[AC_ARG_WITH(zephyr,
327        [  --with-zephyr=PREFIX      Use zephyr],
328        [zephyr="$withval"], [zephyr=no])
329if test "$zephyr" != no; then
330        ATHENA_ZEPHYR_CHECK
331        ZEPHYR_LIBS="-lzephyr"
332        AC_DEFINE(HAVE_ZEPHYR)
333fi
334AC_SUBST(ZEPHYR_LIBS)])
335
336AC_DEFUN([ATHENA_ZEPHYR_REQUIRED],
337[AC_ARG_WITH(zephyr,
338        [  --with-zephyr=PREFIX      Specify location of zephyr],
339        [zephyr="$withval"], [zephyr=yes])
340if test "$zephyr" != no; then
341        ATHENA_ZEPHYR_CHECK
342else
343        AC_MSG_ERROR(This package requires zephyr.)
344fi])
Note: See TracBrowser for help on using the repository browser.