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