source: trunk/debathena/debathena/aclocal/aclocal/athena_com_err.m4 @ 25121

Revision 25121, 1.7 KB checked in by geofft, 13 years ago (diff)
In aclocal: * Make ATHENA_UTIL_COM_ERR use pkg-config to find com_err's location (and set CFLAGS instead of CPPFLAGS as pkg-config wants), and prefix CFLAGS and LDFLAGS so as to cause the normal com_err to be found in preference to AFS' variant.
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 com_err.
16dnl The public macros are:
17dnl     ATHENA_UTIL_COM_ERR
18dnl             Generates error if com_err not found.
19dnl
20dnl All of the macros may extend CFLAGS and LDFLAGS to let the
21dnl compiler find the requested libraries.  Put ATHENA_UTIL_COM_ERR
22dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there
23dnl is a com_err library in the AFS libraries which requires -lutil.
24
25dnl ----- com_err -----
26
27AC_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])
31AS_IF([test "$com_err" != no],
32        [AS_IF([test "$com_err" != yes],
33                [COM_ERR_CFLAGS="-I$com_err/include"
34                COM_ERR_LDFLAGS="-L$com_err/lib"])
35        PKG_CHECK_MODULES([COM_ERR], [com_err])
36        CFLAGS="$COM_ERR_CFLAGS $CFLAGS"
37        LDFLAGS="$COM_ERR_LDFLAGS $LDFLAGS"
38        AC_SEARCH_LIBS(com_err, com_err, ,
39                       [AC_MSG_ERROR(com_err library not found)])],
40        [AC_MSG_ERROR(This package requires com_err.)])])
Note: See TracBrowser for help on using the repository browser.