+2002-10-12 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * aclocal.in (ac_defun_rx, ac_require_rx): If the macro name is
+ quoted, accept any character but `]'. This makes it possible
+ to define macros such as `AC_LANG_PREPROC(Fortran 90)'.
+ (scan_m4_files): Quote $key in the regex. Don't define $expr, it's
+ not used.
+ (add_file, scan_file): Adjust to the new definitions of $ac_defun_rx
+ and $ac_require_rx.
+ * tests/aclocal2.test: New file.
+ * tests/Makefile.am (TESTS): Add aclocal2.test.
+ Reported by Tamara L. Dahlgren and Tom Epperly.
+
2002-10-11 Alexandre Duret-Lutz <adl@gnu.org>
For Debian Bug#153697:
Shigio Yamaguchi shigio@tamacom.com
Steve M. Robbins steve@nyongwa.montreal.qc.ca
Sven Verdoolaege skimo@kotnet.org
+Tamara L. Dahlgren dahlgren1@llnl.gov
Tatu Ylonen ylo@ssh.fi
The Crimson Binome steve@nyongwa.montreal.qc.ca
Thien-Thi Nguyen ttn@glug.org
Tim Goodwin tjg@star.le.ac.uk
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
Tim Van Holder tim.van.holder@pandora.be
+Tom Epperly tepperly@llnl.gov
Ulrich Drepper drepper@gnu.ai.mit.edu
Vadim Zeitlin Vadim.zeitlin@dptmaths.ens-cachan.fr
Werner Koch wk@isil.d.shuttle.de
$verbose = 0;
# Matches a macro definition.
-$ac_defun_rx = "A[CU]_DEFUN\\(\\[?([^],)\n]+)\\]?";
+# AC_DEFUN([macroname], ...)
+# or
+# AC_DEFUN(macroname, ...)
+# When macroname is `['-quoted , we accept any character in the name,
+# except `]'. Otherwise macroname stops on the first `]', `,', `)',
+# or `\n' encountered.
+$ac_defun_rx = "A[CU]_DEFUN\\((?:\\[([^]]+)\\]|([^],)\n]+))";
# Matches an AC_REQUIRE line.
-$ac_require_rx = "AC_REQUIRE\\(\\[?([^])]*)\\]?\\)";
+$ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
\f
my $search = "sub search {\nmy \$found = 0;\n";
foreach my $key (reverse sort keys %map)
{
- # EXPR is a regexp matching the name of the macro.
- (my $expr = $key) =~ s/(\W)/\\$1/g;
- $search .= ('if (/\b' . $key . '\b/) { & add_macro (' . $key
- . '); $found = 1; }' . "\n");
+ $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key
+ . '"); $found = 1; }' . "\n");
}
$search .= "return \$found;\n};\n";
eval $search;
if (/$ac_require_rx/g)
{
- push (@rlist, $1);
+ push (@rlist, $1 || $2);
}
# The search function is constructed dynamically by
if (/$ac_defun_rx/)
{
- if (! defined $map{$1})
+ if (! defined $map{$1 || $2})
{
- $map{$1} = $file;
+ $map{$1 || $2} = $file;
}
# Note: we used to give an error here if we saw a
acinclude.test \
aclibobj.test \
aclocal.test \
+aclocal2.test \
aclocali.test \
aclocali1.test \
aclocalii.test \
acinclude.test \
aclibobj.test \
aclocal.test \
+aclocal2.test \
aclocali.test \
aclocali1.test \
aclocalii.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure aclocal works with macro that have parentheses in their
+# name. Report from Tamara L. Dahlgren and Tom Epperly.
+
+. ./defs || exit 1
+
+set -e
+
+mkdir m4
+cat >m4/f90.m4 <<EOF
+AC_DEFUN([AM_LANG_PREPROC(Fortran 90)], [...something...])
+EOF
+
+cat >acinclude.m4 <<EOF
+AC_DEFUN([AM_FUBAR],
+[AC_REQUIRE([AM_LANG_PREPROC(Fortran 90)])])
+EOF
+
+cat >>configure.in <<EOF
+AM_FUBAR
+EOF
+
+$ACLOCAL -I m4 2>stderr
+cat stderr
+grep AM_LANG_PREPROC stderr && exit 1
+$FGREP 'AC_DEFUN([AM_LANG_PREPROC(Fortran 90)' aclocal.m4