From 33c836b2ad72c1384ba0a8983989322b88e6bfa2 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Thu, 15 Nov 2012 14:49:14 +0100 Subject: [PATCH] recursion: remove _AM_EXTRA_RECURSIVE_TARGETS indirection 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 --- 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], []) -- 2.7.4