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 POSIX |
---|
16 | dnl regexp support. The public macros are: |
---|
17 | dnl ATHENA_REGEXP |
---|
18 | dnl Sets REGEX_LIBS if rx library used; ensures POSIX |
---|
19 | dnl regexp support. |
---|
20 | dnl |
---|
21 | dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the |
---|
22 | dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR |
---|
23 | dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there |
---|
24 | dnl is a com_err library in the AFS libraries which requires -lutil. |
---|
25 | |
---|
26 | dnl ----- Regular expressions ----- |
---|
27 | |
---|
28 | AC_DEFUN([ATHENA_REGEXP], |
---|
29 | [AC_ARG_WITH(regex, |
---|
30 | [ --with-regex=PREFIX Use installed regex library], |
---|
31 | [regex="$withval"], [regex=no]) |
---|
32 | if test "$regex" != no; then |
---|
33 | if test "$regex" != yes; then |
---|
34 | CPPFLAGS="$CPPFLAGS -I$regex/include" |
---|
35 | LDFLAGS="$LDFLAGS -L$regex/lib" |
---|
36 | fi |
---|
37 | AC_SEARCH_LIBS(regcomp, regex, REGEX_LIBS=-lregex, |
---|
38 | [AC_MSG_ERROR(regex library not found)]) |
---|
39 | else |
---|
40 | AC_CHECK_FUNC(regcomp, :, |
---|
41 | [AC_MSG_ERROR(can't find POSIX regexp support)]) |
---|
42 | fi |
---|
43 | AC_SUBST(REGEX_LIBS)]) |
---|