Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
* automake.in: Mying changes.
Index: automake.in
--- automake.in Thu, 22 Feb 2001 20:55:47 +0100 akim (am/f/39_automake.i 1.63 755)
+++ automake.in Thu, 22 Feb 2001 21:06:06 +0100 akim (am/f/39_automake.i 1.63 755)
@@ -2480,8 +2480,7 @@ sub handle_man_pages
# Find all the sections in use. We do this by first looking for
# "standard" sections, and then looking for any additional
# sections used in man_MANS.
- local (%sections, %vlist);
- local ($found) = 0;
+ my (%sections, %vlist);
# Add more sections as needed.
foreach my $sect ('0'..'9', 'n', 'l')
{
@@ -2507,7 +2506,7 @@ sub handle_man_pages
}
}
- return unless $found;
+ return unless %sections;
# Now for each section, generate an install and unintall rule.
# Sort sections so output is deterministic.
@@ -2543,7 +2542,7 @@ sub handle_data
# Handle TAGS.
sub handle_tags
{
- local (@tag_deps) = ();
+ my @tag_deps = ();
if (&variable_defined ('SUBDIRS'))
{
$output_rules .= ("tags-recursive:\n"
@@ -2748,7 +2747,7 @@ sub handle_dist
# If SUBDIRS is conditionally defined, then set DIST_SUBDIRS
# to all possible directories, and use it. If DIST_SUBDIRS is
# defined, just use it.
- local ($dist_subdir_name);
+ my $dist_subdir_name;
if (&variable_conditions ('SUBDIRS')
|| &variable_defined ('DIST_SUBDIRS'))
{
@@ -2836,20 +2835,18 @@ sub add_depend2
. "\n");
}
}
-
- # Now include code for each specially handled object with this
- # language.
- local (@list) = grep ($_ ne '', split (' ', $lang_specific_files{$lang}));
- local ($max) = scalar @list;
- local ($i) = 0;
- local ($derived, $source, $obj);
-
- # If dependency tracking is disabled, we just elide the code.
- if (! $use_dependencies)
+ else
{
- $xform .= 's/\@AMDEP\@.*$//;';
+ # If dependency tracking is disabled, we just elide the code.
+ $xform .= 's/\@AMDEP\@.*$//;';
}
+ # Now include code for each specially handled object with this
+ # language.
+ my @list = grep ($_ ne '', split (' ', $lang_specific_files{$lang}));
+ my $max = scalar @list;
+ my $i = 0;
+ my ($derived, $source, $obj);
my %seen_files = ();
while ($i < $max)
{
@@ -2904,21 +2901,21 @@ sub handle_dependencies
# be empty.
if (&saw_sources_p (0) && keys %dep_files)
{
- local ($config_aux_dir_specified) = ($config_aux_dir ne '.'
- && $config_aux_dir ne '');
+ my $config_aux_dir_specified = ($config_aux_dir ne '.'
+ && $config_aux_dir ne '');
# Set $require_file_found{'depcomp'} if the depcomp file exists,
# before calling require_config_file on `depcomp'. This makes
# require_file_internal skip its buggy existence test that would
# make automake fail (with `required file `lib/depcomp' not found')
# when AC_CONFIG_AUX_DIR is not set. See tests/subdir4.test.
- local ($depcomp_dir) = ($config_aux_dir_specified ? $config_aux_dir
- : '.');
+ my $depcomp_dir = ($config_aux_dir_specified ? $config_aux_dir
+ : '.');
$require_file_found{'depcomp'} = 1 if -f "$depcomp_dir/depcomp";
# Set location of depcomp.
- local ($prefix) = ($config_aux_dir_specified ? $config_aux_dir
- : '$(top_srcdir)');
+ my $prefix = ($config_aux_dir_specified ? $config_aux_dir
+ : '$(top_srcdir)');
&define_variable ('depcomp', "\$(SHELL) $prefix/depcomp");
@@ -2992,7 +2989,7 @@ sub handle_subdirs
# Handle aclocal.m4.
sub handle_aclocal_m4
{
- local ($regen_aclocal) = 0;
+ my $regen_aclocal = 0;
if (-f 'aclocal.m4')
{
&define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4');
@@ -3000,8 +2997,7 @@ sub handle_aclocal_m4
if (open (ACLOCAL, '< aclocal.m4'))
{
- local ($line);
- $line = <ACLOCAL>;
+ my $line = <ACLOCAL>;
close (ACLOCAL);
if ($line =~ 'generated automatically by aclocal')
@@ -3011,7 +3007,7 @@ sub handle_aclocal_m4
}
}
- local ($acinclude) = 0;
+ my $acinclude = 0;
if (-f 'acinclude.m4')
{
$regen_aclocal = 1;
@@ -3023,13 +3019,9 @@ sub handle_aclocal_m4
# important.
if ($regen_aclocal)
{
- local (@ac_deps) = (
- ($seen_maint_mode
- ? "\@MAINTAINER_MODE_TRUE\@"
- : "") ,
- $configure_ac,
- ($acinclude ? ' acinclude.m4' : '')
- );
+ my @ac_deps = (($seen_maint_mode ? "\@MAINTAINER_MODE_TRUE\@": "") ,
+ $configure_ac,
+ ($acinclude ? ' acinclude.m4' : ''));
if (&variable_defined ('ACLOCAL_M4_SOURCES'))
{
@@ -3125,8 +3117,7 @@ sub handle_configure
$colon_infile .= ':' . join (':', @secondary_inputs)
if @secondary_inputs;
- local (@rewritten) = &rewrite_inputs_into_dependencies (1,
- @secondary_inputs);
+ my @rewritten = &rewrite_inputs_into_dependencies (1, @secondary_inputs);
# This rule remakes the Makefile.in. Note use of
# @MAINTAINER_MODE_TRUE@ forces us to abandon pretty-printing.
@@ -3201,7 +3192,7 @@ sub handle_configure
if ($relative_dir eq $header_dir
|| ($relative_dir eq '.' && ! &is_make_dir ($header_dir)))
{
- local ($ch_sans_dir, $cn_sans_dir, $stamp_dir);
+ my ($cn_sans_dir, $stamp_dir);
if ($relative_dir eq $header_dir)
{
$cn_sans_dir = basename ($one_name);
@@ -3223,6 +3214,7 @@ sub handle_configure
# Compute relative path from directory holding output
# header to directory holding input header. FIXME:
# doesn't handle case where we have multiple inputs.
+ my $ch_sans_dir;
if (dirname ($one_hdr) eq $relative_dir)
{
$ch_sans_dir = basename ($one_hdr);
@@ -3313,7 +3305,7 @@ sub handle_configure
foreach my $one_name (@config_names)
{
# Generate CONFIG_HEADER define.
- local ($one_hdr);
+ my $one_hdr;
if ($relative_dir eq dirname ($one_name))
{
$one_hdr = basename ($one_name);
@@ -3466,7 +3458,7 @@ sub handle_gettext
# each po file is mentioned in ALL_LINGUAS.
if ($seen_linguas)
{
- local (%linguas) = ();
+ my %linguas = ();
grep ($linguas{$_} = 1, split (' ', $all_linguas));
foreach (<po/*.po>)
@@ -3531,11 +3523,11 @@ sub handle_footer
# suffixes, and this lets the user have some control. Push
# actual suffixes, and not $(SUFFIXES). Some versions of make
# do not like variable substitutions on the .SUFFIXES line.
- local (%suffixes);
- local (@user_suffixes) = (&variable_defined ('SUFFIXES')
- ? &variable_value_as_list ('SUFFIXES', '')
- : ());
+ my @user_suffixes = (&variable_defined ('SUFFIXES')
+ ? &variable_value_as_list ('SUFFIXES', '')
+ : ());
+ my %suffixes;
grep ($suffixes{$_} = 1, @suffixes);
delete @suffixes{@user_suffixes};
@@ -3576,7 +3568,7 @@ sub handle_installdirs
# avoid double colon rules, otherwise we'd use them instead.
sub handle_merge_targets
{
- local ($makefile) = @_;
+ my ($makefile) = @_;
# There are a few install-related variables that you should not define.
foreach my $var ('PRE_INSTALL', 'POST_INSTALL', 'NORMAL_INSTALL')
@@ -3618,8 +3610,8 @@ sub handle_merge_targets
{
if (&target_defined ($utarg))
{
- local ($x);
- ($x = $utarg) =~ s/(data|exec)-//;
+ my $x = $utarg;
+ $x =~ s/(data|exec)-//;
&am_line_error ($utarg, "use \`$x', not \`$utarg'");
}
}
@@ -3750,7 +3742,7 @@ sub do_one_merge_target
}
else
{
- local ($lname) = $name . ($recursive_install ? '-recursive' : '-am');
+ my $lname = $name . ($recursive_install ? '-recursive' : '-am');
&pretty_print_rule ($name . ":", "\t\t", $lname);
}
&depend ('.PHONY', $name . '-am', $name);
@@ -3967,7 +3959,7 @@ sub handle_emacs_lisp
push (@all, '$(ELCFILES)');
- local ($varname);
+ my $varname;
if (&variable_defined ('lisp_LISP'))
{
$varname = 'lisp_LISP';
@@ -4092,7 +4084,7 @@ sub scan_autoconf_config_files
# Handle $local:$input syntax. Note that we ignore
# every input file past the first, though we keep
# those around for later.
- local ($local, $input, @rest) = split (/:/);
+ my ($local, $input, @rest) = split (/:/);
if (! $input)
{
$input = $local;
@@ -4124,10 +4116,10 @@ sub scan_autoconf_config_files
# FIXME: For the time being, we don't care about the FILENAME.
sub scan_autoconf_traces
{
- local ($filename) = @_;
+ my ($filename) = @_;
local (*TRACES);
- local ($traces) = "$ENV{amtraces} ";
+ my $traces = "$ENV{amtraces} ";
$traces .= ' -t AC_CONFIG_FILES';
$traces .= ' -t AC_LIBSOURCE';
@@ -4140,8 +4132,8 @@ sub scan_autoconf_traces
while (<TRACES>)
{
chomp;
- local ($file, $line, $macro, @args) = split /:/;
- local ($here) = "$file:$line";
+ my ($file, $line, $macro, @args) = split /:/;
+ my $here = "$file:$line";
# Alphabetical ordering please.
if ($macro eq 'AC_CONFIG_FILES')
@@ -4151,7 +4143,7 @@ sub scan_autoconf_traces
}
elsif ($macro eq 'AC_LIBSOURCE')
{
- local ($source) = "$args[0].c";
+ my $source = "$args[0].c";
# We should actually also `close' the sources: getopt.c
# wants getopt.h etc. But actually it should be done in the
# macro itself, i.e., we have to first fix Autoconf to extend
@@ -4183,13 +4175,15 @@ sub scan_autoconf_traces
# &scan_autoconf_files.
sub scan_one_autoconf_file
{
- local ($filename) = @_;
+ my ($filename) = @_;
local (*CONFIGURE);
open (CONFIGURE, $filename)
|| die "automake: couldn't open \`$filename': $!\n";
print "automake: reading $filename\n" if $verbose;
+
+ my ($in_ac_output, $in_ac_replace) = (0, 0);
while (<CONFIGURE>)
{
# Remove comments from current line.
@@ -4292,7 +4286,7 @@ sub scan_one_autoconf_file
if (/$obsolete_rx/o)
{
- local ($hint) = '';
+ my $hint = '';
if ($obsolete_macros{$1} ne '')
{
$hint = '; ' . $obsolete_macros{$1};
@@ -4308,7 +4302,7 @@ sub scan_one_autoconf_file
}
if ($in_ac_output)
{
- local ($closing) = 0;
+ my $closing = 0;
if (s/[\]\),].*$//)
{
$in_ac_output = 0;
@@ -4523,7 +4517,7 @@ sub scan_autoconf_files
# that won't always be the case.
%libsources = ();
- local ($in_ac_output, $in_ac_replace) = (0, 0);
+ # Watchout: these guys need dynamic scope!
local (%make_list, @make_input_list);
warn "automake: both \`configure.ac' and \`configure.in' present:"