1 ## --------------------------------- ##
2 ## Check if --with-regex was given. ##
3 ## --------------------------------- ##
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.
17 AC_DEFUN(AM_WITH_REGEX,
18 [AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted)
20 [ --without-regex use GNU rx in lieu of gawk's regex for matching],
21 [test "$withval" = yes && am_with_regex=1],
23 if test -n "$am_with_regex"; then
26 LIBOBJS="$LIBOBJS regex.o"
29 AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])