source: trunk/essentials/sys-devel/automake-1.4/m4/regex.m4

Last change on this file was 3124, checked in by bird, 18 years ago

automake 1.4-p6

File size: 1.4 KB
Line 
1## --------------------------------- ##
2## Check if --with-regex was given. ##
3## --------------------------------- ##
4
5# serial 1
6
7# The idea is to distribute rx.[hc] and regex.[hc] together, for a while.
8# The WITH_REGEX symbol (which should also be documented in acconfig.h)
9# is used to decide which of regex.h or rx.h should be included in the
10# application. If `./configure --with-regex' is given (the default), the
11# package will use gawk's regex. If `./configure --without-regex', a
12# check is made to see if rx is already installed, as with newer Linux'es.
13# If not found, the package will use the rx from the distribution.
14# If found, the package will use the system's rx which, on Linux at least,
15# will result in a smaller executable file.
16
17AC_DEFUN([AM_WITH_REGEX],
18[AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted)
19AC_ARG_WITH(regex,
20[ --without-regex use GNU rx in lieu of gawk's regex for matching],
21[test "$withval" = yes && am_with_regex=1],
22[am_with_regex=1])
23if test -n "$am_with_regex"; then
24 AC_MSG_RESULT(regex)
25 AC_DEFINE(WITH_REGEX,1,[Define if using GNU regex])
26 AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex,
27 AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1],
28 am_cv_gnu_regex=yes, am_cv_gnu_regex=no))
29 if test $am_cv_gnu_regex = no; then
30 LIBOBJS="$LIBOBJS regex.o"
31 fi
32else
33 AC_MSG_RESULT(rx)
34 AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
35fi
36AC_SUBST(LIBOBJS)dnl
37])
Note: See TracBrowser for help on using the repository browser.