+2010-11-13 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ Deprecate obsolete macro AM_WITH_REGEX.
+ * m4/regex.m4: Document the `AM_WITH_REGEX' macro as obsolete,
+ and state that it should be removed two years from now.
+ (AM_WITH_REGEX): Raise an m4-time warning of the "obsolete"
+ category when this macro is used.
+ * doc/automake.texi (Public Macros): Move description of
+ `AM_WITH_REGEX' from here ...
+ (Obsolete Macros): ... to here, and declare it as obsolete
+ and "to be removed in a future version".
+ * tests/regex-obsolete.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+
2010-11-08 Stefano Lattarini <stefano.lattarini@gmail.com>
Improve and extend tests on man pages support.
the user runs @command{configure} with @option{--with-dmalloc}, then
define @code{WITH_DMALLOC} and add @option{-ldmalloc} to @code{LIBS}.
-@item AM_WITH_REGEX
-@acindex AM_WITH_REGEX
-@vindex WITH_REGEX
-@opindex --with-regex
-@cindex regex package
-@cindex rx package
-Adds @option{--with-regex} to the @command{configure} command line. If
-specified (the default), then the @samp{regex} regular expression
-library is used, @file{regex.o} is put into @code{LIBOBJS}, and
-@code{WITH_REGEX} is defined. If @option{--without-regex} is given, then
-the @code{rx} regular expression library is used, and @file{rx.o} is put
-into @code{LIBOBJS}.
-
@end table
@samp{yes}. If not, set the variable to @samp{no}. This macro is obsolete,
you should use Autoconf's @code{AC_SYS_POSIX_TERMIOS} instead.
+@item AM_WITH_REGEX
+@acindex AM_WITH_REGEX
+@vindex WITH_REGEX
+@opindex --with-regex
+@cindex regex package
+@cindex rx package
+Adds @option{--with-regex} to the @command{configure} command line. If
+specified (the default), then the @samp{regex} regular expression
+library is used, @file{regex.o} is put into @code{LIBOBJS}, and
+@code{WITH_REGEX} is defined. If @option{--without-regex} is given, then
+the @samp{rx} regular expression library is used, and @file{rx.o} is put
+into @code{LIBOBJS}. This macro is obsolete now (since @samp{rx} doesn't
+seem to be maintained), and will be removed in a future version of
+Automake. Consider using gnulib if you need regex functionality.
+
@end table
## --------------------------------- ## -*- Autoconf -*-
## Check if --with-regex was given. ##
## --------------------------------- ##
-# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+# 2010 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 7
+# serial 8
# AM_WITH_REGEX
# -------------
#
+# THIS MACRO IS OBSOLETE now, since rx doesn't seem to be maintained,
+# while regex is. This macro should be removed on 2013-01-01.
+#
# The idea is to distribute rx.[hc] and regex.[hc] together, for a
# while. The WITH_REGEX symbol is used to decide which of regex.h or
# rx.h should be included in the application. If `./configure
# package will use the system's rx which, on Linux at least, will
# result in a smaller executable file.
#
-# FIXME: This macro seems quite obsolete now since rx doesn't seem to
-# be maintained, while regex is.
AC_DEFUN([AM_WITH_REGEX],
[AC_PREREQ(2.50)dnl
+m4_warn([obsolete], [$0 is obsolete, since `rx' is unmantained now])dnl
AC_LIBSOURCES([rx.h, rx.c, regex.c, regex.h])dnl
AC_MSG_CHECKING([which of GNU rx or gawk's regex is wanted])
AC_ARG_WITH([regex],
remake6.test \
remake7.test \
regex.test \
+regex-obsolete.test \
req.test \
reqd.test \
reqd2.test \
remake6.test \
remake7.test \
regex.test \
+regex-obsolete.test \
req.test \
reqd.test \
reqd2.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check tha the AM_WITH_REGEX macro is reported as obsolete.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_WITH_REGEX
+END
+
+$ACLOCAL
+$AUTOCONF -Werror -Wobsolete 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep '^configure\.in:.*AM_WITH_REGEX.*obsolete' stderr
+
+: