From b302c0647e847f308fe1b72590acff004840529c Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 7 Mar 2004 09:24:21 +0000 Subject: [PATCH] * lib/Automake/Variable.pm (traverse_recursively, _do_recursive_traversal): Honor the skip_ac_subst option. * automake.in (handle_dist): Use skip_ac_subst. --- ChangeLog | 6 ++++++ automake.in | 6 ++---- lib/Automake/Variable.pm | 17 +++++++++++++---- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40d67248..abe5e293 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-03-07 Alexandre Duret-Lutz + + * lib/Automake/Variable.pm (traverse_recursively, + _do_recursive_traversal): Honor the skip_ac_subst option. + * automake.in (handle_dist): Use skip_ac_subst. + 2004-02-29 Alexandre Duret-Lutz * Makefile.am (cvs-release): Upload to ~ftp/pub/automake, not diff --git a/automake.in b/automake.in index af5a86fa..bd233012 100755 --- a/automake.in +++ b/automake.in @@ -3352,9 +3352,8 @@ sub handle_dist () # appropriate condition. This is meaningful if the nature of # the distribution should depend upon the configure options # used. - foreach ($extra_dist->value_as_list_recursive) + foreach ($extra_dist->value_as_list_recursive (skip_ac_subst => 1)) { - next if /^\@.*\@$/; next unless s,/+[^/]+$,,; $dist_dirs{$_} = 1 unless $_ eq '.'; @@ -3364,9 +3363,8 @@ sub handle_dist () # We have to check DIST_COMMON for extra directories in case the # user put a source used in AC_OUTPUT into a subdir. my $topsrcdir = backname ($relative_dir); - foreach (rvar ('DIST_COMMON')->value_as_list_recursive) + foreach (rvar ('DIST_COMMON')->value_as_list_recursive (skip_ac_subst => 1)) { - next if /^\@.*\@$/; s/\$\(top_srcdir\)/$topsrcdir/; s/\$\(srcdir\)/./; # Strip any leading `./'. diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 797d2ca9..874339fb 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -1189,7 +1189,7 @@ sub output_variables () return $res; } -=item C<$var-Etraverse_recursively (&fun_item, &fun_collect, [cond_filter =E $cond_filter], [inner_expand =E 1])> +=item C<$var-Etraverse_recursively (&fun_item, &fun_collect, [cond_filter =E $cond_filter], [inner_expand =E 1], [skip_ac_subst =E 1])> Split the value of the Automake::Variable C<$var> on space, and traverse its components recursively. @@ -1218,6 +1218,9 @@ If C is set, variable references occuring in filename (as in C<$(BASE).ext>) are expansed before the filename is passed to C<&fun_item>. +If C is set, Autoconf @substitutions@ will be skipped, +i.e., C<&fun_item> will never be called for them. + C<&fun_item> may return a list of items, they will be passed to C<&fun_store> later on. Define C<&fun_item> as C when it serve no purpose, this will speed things up. @@ -1254,16 +1257,18 @@ sub traverse_recursively ($&&;%) my ($var, $fun_item, $fun_collect, %options) = @_; my $cond_filter = $options{'cond_filter'}; my $inner_expand = $options{'inner_expand'}; + my $skip_ac_subst = $options{'skip_ac_subst'}; return $var->_do_recursive_traversal ($var, $fun_item, $fun_collect, - $cond_filter, TRUE, $inner_expand) + $cond_filter, TRUE, $inner_expand, + $skip_ac_subst) } # The guts of Automake::Variable::traverse_recursively. -sub _do_recursive_traversal ($$&&$$$) +sub _do_recursive_traversal ($$&&$$$$) { my ($var, $parent, $fun_item, $fun_collect, $cond_filter, $parent_cond, - $inner_expand) = @_; + $inner_expand, $skip_ac_subst) = @_; $var->set_seen; @@ -1375,6 +1380,10 @@ sub _do_recursive_traversal ($$&&$$$) # We do not know any variable with this name. Fall through # to filename processing. } + elsif ($skip_ac_subst && $var =~ /^\@.+\@$/) + { + next; + } if ($fun_item) # $var is a filename we must process { -- 2.43.5