Index: aclocal.in
===================================================================
RCS file: /cvsroot/automake/automake/aclocal.in,v
retrieving revision 1.132
diff -u -u -r1.132 aclocal.in
--- aclocal.in	14 May 2005 20:28:50 -0000	1.132
+++ aclocal.in	27 May 2005 14:22:48 -0000
@@ -121,6 +121,9 @@
 # the value is the serial number represented as a list.
 my %serial = ();
 
+# Macro definition macros found scanning input.
+my %defuns = ();
+
 # Matches a macro definition.
 #   AC_DEFUN([macroname], ...)
 # or
@@ -129,7 +132,7 @@
 # except `]'.  Otherwise macroname stops on the first `]', `,', `)',
 # or `\n' encountered.
 my $ac_defun_rx =
-  "(?:AU_ALIAS|A[CU]_DEFUN|AC_DEFUN_ONCE)\\((?:\\[([^]]+)\\]|([^],)\n]+))";
+  "(AU_ALIAS|A[A-Z]_DEFUN|AC_DEFUN_ONCE)\\((?:\\[([^]]+)\\]|([^],)\n]+))";
 
 # Matches an AC_REQUIRE line.
 my $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
@@ -489,9 +492,15 @@
       while ($line =~ /$ac_defun_rx/go)
 	{
 	  $defun_seen = 1;
-	  if (! defined $1)
+	  if (!defined($defuns{$1}))
+	    {
+	      $defuns{$1} = 1;
+	      verb "saw defun $1";
+	    }
+
+	  if (! defined $2)
 	    {
-	      msg ('syntax', "$file:$.", "warning: underquoted definition of $2"
+	      msg ('syntax', "$file:$.", "warning: underquoted definition of $3"
 		   . "\n  run info '(automake)Extending aclocal'\n"
 		   . "  or see http://sources.redhat.com/automake/"
 		   . "automake.html#Extending-aclocal")
@@ -506,7 +515,7 @@
 	  $serial_older ||= ($type != FT_AUTOMAKE
 			     && !$serial_seen && exists $serial{$basename});
 
-	  my $macro = $1 || $2;
+	  my $macro = $2 || $3;
 	  if (!$serial_older && !defined $map{$macro})
 	    {
 	      verb "found macro $macro in $file: $.";
@@ -600,9 +609,7 @@
   $traces .= join (' ', grep { exists $files{$_} } @file_order) . " ";
   # All candidate macros.
   $traces .= join (' ',
-		   (map { "--trace='$_:\$f::\$n::\$1'" } ('AC_DEFUN',
-							  'AC_DEFUN_ONCE',
-							  'AU_DEFUN')),
+		   (map { "--trace='$_:\$f::\$n::\$1'" } keys(%defuns)),
 		   # Do not trace $1 for all other macros as we do
 		   # not need it and it might contains harmful
 		   # characters (like newlines).
@@ -622,9 +629,7 @@
       $traced{$macro} = 1 if exists $macro_seen{$macro};
 
       $map_traced_defs{$arg1} = $file
-	if ($macro eq 'AC_DEFUN'
-	    || $macro eq 'AC_DEFUN_ONCE'
-	    || $macro eq 'AU_DEFUN');
+	if (defined($defuns{$macro}));
     }
 
   $tracefh->close;
