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

Revision 25125, 1.8 KB checked in by geofft, 13 years ago (diff)
In aclocal: * PKG_CHECK_MODULES doesn't split LDFLAGS and LIBS properly. Since we need to insert com_err's LDFLAGS before AFS's, but since -lcom_err needs to be after the object files, we need this split. So, reimplement what we need of it and just use PKG_CHECK_EXISTS.
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                [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)])])])],
41        [AC_MSG_ERROR(This package requires com_err.)])])
Note: See TracBrowser for help on using the repository browser.