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

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

automake 1.8.5

File size: 2.4 KB
Line 
1## --------------------------------- ## -*- Autoconf -*-
2## Check if --with-regex was given. ##
3## --------------------------------- ##
4
5# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
6# Free Software Foundation, Inc.
7
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2, or (at your option)
11# any later version.
12
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21# 02111-1307, USA.
22
23# serial 6
24
25# AM_WITH_REGEX
26# -------------
27#
28# The idea is to distribute rx.[hc] and regex.[hc] together, for a
29# while. The WITH_REGEX symbol is used to decide which of regex.h or
30# rx.h should be included in the application. If `./configure
31# --with-regex' is given (the default), the package will use gawk's
32# regex. If `./configure --without-regex', a check is made to see if
33# rx is already installed, as with newer Linux'es. If not found, the
34# package will use the rx from the distribution. If found, the
35# package will use the system's rx which, on Linux at least, will
36# result in a smaller executable file.
37#
38# FIXME: This macro seems quite obsolete now since rx doesn't seem to
39# be maintained, while regex is.
40AC_DEFUN([AM_WITH_REGEX],
41[AC_PREREQ(2.50)dnl
42AC_LIBSOURCES([rx.h, rx.c, regex.c, regex.h])dnl
43AC_MSG_CHECKING([which of GNU rx or gawk's regex is wanted])
44AC_ARG_WITH([regex],
45[ --without-regex use GNU rx in lieu of gawk's regex for matching],
46 [test "$withval" = yes && am_with_regex=1],
47 [am_with_regex=1])
48if test -n "$am_with_regex"; then
49 AC_MSG_RESULT([regex])
50 AC_DEFINE([WITH_REGEX], 1, [Define if using GNU regex])
51 AC_CACHE_CHECK([for GNU regex in libc], [am_cv_gnu_regex],
52 [AC_TRY_LINK([],
53 [extern int re_max_failures; re_max_failures = 1],
54 [am_cv_gnu_regex=yes],
55 [am_cv_gnu_regex=no])])
56 if test $am_cv_gnu_regex = no; then
57 AC_LIBOBJ([regex])
58 fi
59else
60 AC_MSG_RESULT([rx])
61 AC_CHECK_FUNC([re_rx_search], , [AC_LIBOBJ([rx])])
62fi[]dnl
63])
64
65AU_DEFUN([fp_WITH_REGEX], [AM_WITH_REGEX])
Note: See TracBrowser for help on using the repository browser.