automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {master} recursion: remove _AM_EXTRA_RECURSIVE_TARGETS indirection


From: Stefano Lattarini
Subject: [FYI] {master} recursion: remove _AM_EXTRA_RECURSIVE_TARGETS indirection
Date: Thu, 15 Nov 2012 15:15:30 +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 <address@hidden>
---
 automake.in        | 9 ++++++---
 m4/extra-recurs.m4 | 3 +--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/automake.in b/automake.in
index 32389f4..3a401d8 100644
--- a/automake.in
+++ b/automake.in
@@ -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')
        {
diff --git a/m4/extra-recurs.m4 b/m4/extra-recurs.m4
index 7b7ecc7..68d575a 100644
--- a/m4/extra-recurs.m4
+++ b/m4/extra-recurs.m4
@@ -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], [])
-- 
1.8.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]