[24361] | 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 com_err. |
---|
| 16 | dnl The public macros are: |
---|
| 17 | dnl ATHENA_UTIL_COM_ERR |
---|
| 18 | dnl Generates error if com_err not found. |
---|
| 19 | dnl |
---|
[25121] | 20 | dnl All of the macros may extend CFLAGS and LDFLAGS to let the |
---|
[24361] | 21 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
| 22 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
| 23 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
| 24 | |
---|
| 25 | dnl ----- com_err ----- |
---|
| 26 | |
---|
| 27 | AC_DEFUN([ATHENA_UTIL_COM_ERR], |
---|
| 28 | [AC_ARG_WITH(com_err, |
---|
| 29 | [ --with-com_err=PREFIX Specify location of com_err], |
---|
| 30 | [com_err="$withval"], [com_err=yes]) |
---|
[25121] | 31 | AS_IF([test "$com_err" != no], |
---|
| 32 | [AS_IF([test "$com_err" != yes], |
---|
[25125] | 33 | [CFLAGS="$CFLAGS -I$com_err/include" |
---|
| 34 | LDFLAGS="$LDFLAGS -L$com_err/lib"], |
---|
| 35 | [PKG_CHECK_EXISTS([com_err], |
---|
| 36 | [CFLAGS="$CFLAGS `$PKG_CONFIG --cflags com_err 2>/dev/null`" |
---|
| 37 | LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs-only-L --libs-only-other com_err 2>/dev/null`" |
---|
| 38 | LIBS="$LIBS `$PKG_CONFIG --libs-only-l com_err 2>/dev/null`"], |
---|
| 39 | [AC_SEARCH_LIBS(com_err, com_err, , |
---|
| 40 | [AC_MSG_ERROR(com_err library not found)])])])], |
---|
[25121] | 41 | [AC_MSG_ERROR(This package requires com_err.)])]) |
---|