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