recursion: remove _AM_EXTRA_RECURSIVE_TARGETS indirection
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 15 Nov 2012 13:49:14 +0000 (14:49 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 15 Nov 2012 13:53:22 +0000 (14:53 +0100)
Since automake automatically smashes extra whitespace and newlines
in the arguments of the macros it traces, we can remove the extra
indirection with the _AM_EXTRA_RECURSIVE_TARGETS.  This doesn't
truly simplify the existing code, but make it slightly easier to
understand anyway, since leave it with one less indirection.

* automake.in: Trace AM_EXTRA_RECURSIVE_TARGETS directly, rather
than tracing _AM_EXTRA_RECURSIVE_TARGETS.  Remove trailing and
leading empty fields in the extracted arguments.
* m4/extra-recurs.m4 (_AM_EXTRA_RECURSIVE_TARGETS): Remove, no longer
needed.
(AM_EXTRA_RECURSIVE_TARGETS): Adjust by making it a simple no-op.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
m4/extra-recurs.m4

index 32389f4..3a401d8 100644 (file)
@@ -5130,7 +5130,7 @@ sub scan_autoconf_traces ($)
                AM_AUTOMAKE_VERSION => 1,
                 AM_PROG_MKDIR_P => 0, # FIXME: to be removed in 1.14
                AM_CONDITIONAL => 2,
-               _AM_EXTRA_RECURSIVE_TARGETS => 1,
+               AM_EXTRA_RECURSIVE_TARGETS => 1,
                AM_GNU_GETTEXT => 0,
                AM_GNU_GETTEXT_INTL_SUBDIR => 0,
                AM_INIT_AUTOMAKE => 0,
@@ -5296,9 +5296,12 @@ EOF
        {
          $configure_cond{$args[1]} = $where;
        }
-      elsif ($macro eq '_AM_EXTRA_RECURSIVE_TARGETS')
+      elsif ($macro eq 'AM_EXTRA_RECURSIVE_TARGETS')
        {
-         push @extra_recursive_targets, split (' ', $args[1]);
+          # Empty leading/trailing fields might be produced by split,
+          # hence the grep is really needed.
+          push @extra_recursive_targets,
+               grep (/./, (split /\s+/, $args[1]));
        }
       elsif ($macro eq 'AM_GNU_GETTEXT')
        {
index 7b7ecc7..68d575a 100644 (file)
@@ -12,6 +12,5 @@
 # be traced by Automake, which will ensure that a proper definition of
 # user-defined recursive targets (and associated rules) is propagated
 # into all the generated Makefiles.
-AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], [_$0(m4_flatten([$1]))])
 # TODO: We should really reject non-literal arguments here...
-m4_define([_AM_EXTRA_RECURSIVE_TARGETS], [])
+AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], [])