Six, six for them! (I'm not counting those for file handles, which
perl refuses as my, not sure to understand why).
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
* automake.in: Mying changes.
* Makefile.am (maintainer-check): Check the stability of the
number of uses of `local'.
Index: Makefile.am
--- Makefile.am Mon, 19 Feb 2001 02:58:32 +0100 akim (am/f/46_Makefile.a 1.8 644)
+++ Makefile.am Thu, 22 Feb 2001 21:57:20 +0100 akim (am/f/46_Makefile.a 1.8 644)
@@ -109,6 +109,25 @@
echo "Using @_ in a scalar context in the lines above." 1>&2; \
exit 1; \
fi
+## Forbid using parens with `local' to ease counting.
+ @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
+ echo "Don't use \`local' with parens: use several \`local' above." >&2; \
+ exit 1; \
+ fi
+## Up to now we manage to limit to 6 uses of local.
+ @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \
+ case $$locals in \
+ [0-5] ) \
+ echo "Wow, congrats! There are $$locals \`local' now!." >&2; \
+ echo "Please update Makefile.am (maintainer-check)." >&2; \
+ ;; \
+ 6 ) ;; \
+ * ) \
+ echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \
+ echo "Up to now 6 was enough." >&2; \
+ exit 1; \
+ ;; \
+ esac
# Tag before making distribution. Also, don't make a distribution if
# checks fail. Also, make sure the NEWS file is up-to-date.
Index: Makefile.in
--- Makefile.in Wed, 21 Feb 2001 21:04:28 +0100 akim (am/h/16_Makefile.i 1.18 644)
+++ Makefile.in Thu, 22 Feb 2001 21:57:23 +0100 akim (am/h/16_Makefile.i 1.18 644)
@@ -659,6 +659,23 @@
echo "Using @_ in a scalar context in the lines above." 1>&2; \
exit 1; \
fi
+ @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
+ echo "Don't use \`local' with parens: use several \`local' above." >&2; \
+ exit 1; \
+ fi
+ @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \
+ case $$locals in \
+ [0-5] ) \
+ echo "Wow, congrats! There are $$locals \`local' now!." >&2; \
+ echo "Please update Makefile.am (maintainer-check)." >&2; \
+ ;; \
+ 6 ) ;; \
+ * ) \
+ echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \
+ echo "Up to now 6 was enough." >&2; \
+ exit 1; \
+ ;; \
+ esac
# Tag before making distribution. Also, don't make a distribution if
# checks fail. Also, make sure the NEWS file is up-to-date.
Index: automake.in
--- automake.in Thu, 22 Feb 2001 21:07:21 +0100 akim (am/f/39_automake.i 1.64 755)
+++ automake.in Thu, 22 Feb 2001 21:47:54 +0100 akim (am/f/39_automake.i 1.64 755)
@@ -4117,7 +4117,7 @@ sub scan_autoconf_config_files
sub scan_autoconf_traces
{
my ($filename) = @_;
-local (*TRACES);
+local *TRACES;
my $traces = "$ENV{amtraces} ";
@@ -4176,7 +4176,7 @@ sub scan_autoconf_traces
sub scan_one_autoconf_file
{
my ($filename) = @_;
-local (*CONFIGURE);
+local *CONFIGURE;
open (CONFIGURE, $filename)
|| die "automake: couldn't open \`$filename': $!\n";
@@ -4518,7 +4518,8 @@ sub scan_autoconf_files
%libsources = ();
# Watchout: these guys need dynamic scope!
-local (%make_list, @make_input_list);
+local %make_list;
+local @make_input_list;
warn "automake: both \`configure.ac' and \`configure.in' present:"
. " ignoring \`configure.in'\n"
@@ -4563,7 +4564,8 @@ sub scan_autoconf_files
# check must be done for every run, even those where we are only
# looking at a subdir Makefile. We must set relative_dir so that
# the file-finding machinery works.
-local ($relative_dir) = '.';
+# Needs dynamic scopes.
+local $relative_dir = '.';
&require_config_file ($FOREIGN, 'install-sh', 'mkinstalldirs', 'missing');
&am_error ("\`install.sh' is an anachronism; use \`install-sh' instead")
if -f $config_aux_path[0] . '/install.sh';
@@ -4657,7 +4659,7 @@ sub lang_sub_obj
# Rewrite a single C source file.
sub lang_c_rewrite
{
-local ($directory, $base, $ext) = @_;
+my ($directory, $base, $ext) = @_;
if (defined $options{'ansi2knr'} && $base =~ /_$/)
{
@@ -4665,7 +4667,7 @@ sub lang_c_rewrite
&am_error ("C source file \`$base.c' would be deleted by ansi2knr rules");
}
-local ($r) = $LANG_PROCESS;
+my $r = $LANG_PROCESS;
if (defined $options{'subdir-objects'})
{
$r = $LANG_SUBDIR;
@@ -4705,8 +4707,8 @@ sub lang_yacc_rewrite
{
my ($directory, $base, $ext) = @_;
-local ($r) = &lang_c_rewrite ($directory, $base, $ext);
-local ($pfx) = '';
+my $r = &lang_c_rewrite ($directory, $base, $ext);
+my $pfx = '';
if ($r == $LANG_SUBDIR)
{
$pfx = $directory . '/';
@@