Index: aclocal.in
===================================================================
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.52
diff -u -r1.52 aclocal.in
--- aclocal.in	2001/01/16 11:15:20	1.52
+++ aclocal.in	2001/01/19 13:30:57
@@ -48,12 +48,21 @@
 # Output file name.
 $output_file = 'aclocal.m4';
 
+# The --shadow option
+$opt_shadow = 0;
+
+# The --print-files options shows which files are scanned
+$opt_print_files = 0;
+
 # Which macros have been seen.
 %macro_seen = ();
 
 # Which files have been seen.
 %file_seen = ();
 
+# Which file names (sans dirname) have been seen (for --shadow)
+%filename_seen = ();
+
 # Map macro names to file names.
 %map = ();
 
@@ -140,6 +149,8 @@
   --help                print this help, then exit
   -I DIR                add directory to search list for .m4 files
   --output=FILE         put output in FILE (default aclocal.m4)
+  --shadow              scan only the first file with a given name (sans dir)
+  --print-files         print which files are included in aclocal.m4
   --print-ac-dir        print name of directory holding m4 files
   --verbose             don't be silent
   --version             print version number, then exit
@@ -171,6 +182,14 @@
 	    shift (@arglist);
 	    push (@dirlist, $arglist[0]);
 	}
+	elsif ($arglist[0] eq "--shadow")
+	{
+	    $opt_shadow = 1;
+	}
+	elsif ($arglist[0] eq '--print-files')
+	{
+	    $opt_print_files = 1;
+	}
 	elsif ($arglist[0] eq '--print-ac-dir')
 	{
 	    $print_and_exit = 1;
@@ -313,6 +332,12 @@
 	    # Skip some files when running out of srcdir.
 	    next if $file eq 'aclocal.m4';
 
+	    # Shadow files with the same names (sans dirname)
+	    if ($opt_shadow) {
+		next if $filename_seen{$file};
+		$filename_seen{$file} = 1;
+	    }
+
 	    $fullfile = $m4dir . '/' . $file;
 	    $file_contents{$fullfile} = &scan_file ($fullfile);
 	}
@@ -367,6 +392,7 @@
     # Only add a file once.
     return if ($file_seen{$file});
     $file_seen{$file} = 1;
+    print "Adding \`$file'.\n" if $opt_print_files;
 
     $output .= $file_contents{$file} . "\n";
     local ($a, @rlist);
