1 | dnl Copyright 1996 by the Massachusetts Institute of Technology. |
---|
2 | dnl |
---|
3 | dnl Permission to use, copy, modify, and distribute this |
---|
4 | dnl software and its documentation for any purpose and without |
---|
5 | dnl fee is hereby granted, provided that the above copyright |
---|
6 | dnl notice appear in all copies and that both that copyright |
---|
7 | dnl notice and this permission notice appear in supporting |
---|
8 | dnl documentation, and that the name of M.I.T. not be used in |
---|
9 | dnl advertising or publicity pertaining to distribution of the |
---|
10 | dnl software without specific, written prior permission. |
---|
11 | dnl M.I.T. makes no representations about the suitability of |
---|
12 | dnl this software for any purpose. It is provided "as is" |
---|
13 | dnl without express or implied warranty. |
---|
14 | |
---|
15 | dnl This file provides local macros for packages which use the AFS |
---|
16 | dnl libraries. The public macros are: |
---|
17 | dnl ATHENA_AFS |
---|
18 | dnl Sets AFS_LIBS and defines HAVE_AFS if AFS used. Pass |
---|
19 | dnl in an argument giving the desired AFS libraries; |
---|
20 | dnl AFS_LIBS will be set to that value if AFS is found. |
---|
21 | dnl AFS_DIR will be set to the prefix given. |
---|
22 | dnl ATHENA_AFS_REQUIRED |
---|
23 | dnl Generates error if AFS libraries not found. AFS_DIR |
---|
24 | dnl will be set to the prefix given. |
---|
25 | dnl |
---|
26 | dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the |
---|
27 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
28 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
29 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
30 | |
---|
31 | dnl ----- AFS ----- |
---|
32 | |
---|
33 | AC_DEFUN([ATHENA_AFS_CHECK], |
---|
34 | [AC_SEARCH_LIBS(insque, compat) |
---|
35 | AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
36 | AC_SEARCH_LIBS(socket, socket) |
---|
37 | AC_SEARCH_LIBS(res_send, resolv) |
---|
38 | if test "$afs" != yes; then |
---|
39 | CPPFLAGS="$CPPFLAGS -I$afs/include" |
---|
40 | LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs" |
---|
41 | fi |
---|
42 | AC_SEARCH_LIBS(pioctl, sys, :, [AC_MSG_ERROR(AFS libraries not found)], |
---|
43 | -lrx -llwp -lsys -lafsutil) |
---|
44 | AFS_DIR=$afs |
---|
45 | AC_SUBST(AFS_DIR)]) |
---|
46 | |
---|
47 | dnl Specify desired AFS libraries as a parameter. |
---|
48 | AC_DEFUN([ATHENA_AFS], |
---|
49 | [AC_ARG_WITH(afs, |
---|
50 | [ --with-afs=PREFIX Use AFS libraries], |
---|
51 | [afs="$withval"], [afs=no]) |
---|
52 | if test "$afs" != no; then |
---|
53 | ATHENA_AFS_CHECK |
---|
54 | AFS_LIBS=$1 |
---|
55 | AC_DEFINE(HAVE_AFS) |
---|
56 | fi |
---|
57 | AC_SUBST(AFS_LIBS)]) |
---|
58 | |
---|
59 | AC_DEFUN([ATHENA_AFS_REQUIRED], |
---|
60 | [AC_ARG_WITH(afs, |
---|
61 | [ --with-afs=PREFIX Specify location of AFS libraries], |
---|
62 | [afs="$withval"], [afs=/usr/afsws]) |
---|
63 | if test "$afs" != no; then |
---|
64 | ATHENA_AFS_CHECK |
---|
65 | else |
---|
66 | AC_MSG_ERROR(This package requires AFS libraries.) |
---|
67 | fi]) |
---|