source: trunk/athena/bin/xcluster/aclocal.m4 @ 12283

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