source: trunk/debathena/debathena/aclocal/aclocal/athena_afs.m4 @ 24361

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