Merge branch 'maint'
[platform/upstream/automake.git] / aclocal.in
index 1c58fb5..c7cde7d 100644 (file)
@@ -152,8 +152,34 @@ my $erase_me;
 
 ################################################################
 
+# Prototypes for all subroutines.
+
+sub unlink_tmp (;$);
+sub xmkdir_p ($);
+sub check_acinclude ();
+sub reset_maps ();
+sub install_file ($$);
+sub list_compare (\@\@);
+sub scan_m4_dirs ($@);
+sub scan_m4_files ();
+sub add_macro ($);
+sub scan_configure_dep ($);
+sub add_file ($);
+sub scan_file ($$$);
+sub strip_redundant_includes (%);
+sub trace_used_macros ();
+sub scan_configure ();
+sub write_aclocal ($@);
+sub usage ($);
+sub version ();
+sub handle_acdir_option ($$);
+sub parse_arguments ();
+sub parse_ACLOCAL_PATH ();
+
+################################################################
+
 # Erase temporary file ERASE_ME.  Handle signals.
-sub unlink_tmp
+sub unlink_tmp (;$)
 {
   my ($sig) = @_;
 
@@ -350,7 +376,7 @@ sub scan_m4_dirs ($@)
          next if $file eq 'aclocal.m4';
 
          my $fullfile = File::Spec->canonpath ("$m4dir/$file");
-           &scan_file ($type, $fullfile, 'aclocal');
+         scan_file ($type, $fullfile, 'aclocal');
        }
       closedir (DIR);
     }
@@ -361,12 +387,12 @@ sub scan_m4_files ()
 {
   # First, scan configure.ac.  It may contain macro definitions,
   # or may include other files that define macros.
-  &scan_file (FT_USER, $configure_ac, 'aclocal');
+  scan_file (FT_USER, $configure_ac, 'aclocal');
 
   # Then, scan acinclude.m4 if it exists.
   if (-f 'acinclude.m4')
     {
-      &scan_file (FT_USER, 'acinclude.m4', 'aclocal');
+      scan_file (FT_USER, 'acinclude.m4', 'aclocal');
     }
 
   # Finally, scan all files in our search paths.
@@ -380,7 +406,7 @@ sub scan_m4_files ()
   my $search = "sub search {\nmy \$found = 0;\n";
   foreach my $key (reverse sort keys %map)
     {
-      $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { add_macro ("' . $key
+      $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { add_macro ("' . $key
                  . '"); $found = 1; }' . "\n");
     }
   $search .= "return \$found;\n};\n";
@@ -403,7 +429,7 @@ sub add_macro ($)
 
   verb "saw macro $macro";
   $macro_seen{$macro} = 1;
-  &add_file ($map{$macro});
+  add_file ($map{$macro});
 }
 
 # scan_configure_dep ($file)
@@ -465,7 +491,7 @@ sub scan_configure_dep ($)
     }
 
   add_macro ($_) foreach (@rlist);
-  &scan_configure_dep ($_) foreach @ilist;
+  scan_configure_dep ($_) foreach @ilist;
 }
 
 # add_file ($FILE)
@@ -840,7 +866,7 @@ $output";
   # name in the header.
   $output = "# generated automatically by aclocal $VERSION -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-$RELEASE_YEAR Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -931,11 +957,11 @@ EOF
 }
 
 # Print version and exit.
-sub version()
+sub version ()
 {
   print <<EOF;
 aclocal (GNU $PACKAGE) $VERSION
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) $RELEASE_YEAR Free Software Foundation, Inc.
 License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
@@ -946,15 +972,6 @@ EOF
   exit 0;
 }
 
-# Using --acdir overrides both the automake (versioned) directory and
-# the public (unversioned) system directory.  This usage is obsolete.
-sub handle_acdir_option ($$)
-{
-  msg 'obsolete', '', "'--acdir' is deprecated\n";
-  @system_includes = ($_[1]);
-  @automake_includes = ();
-}
-
 # Parse command line.
 sub parse_arguments ()
 {
@@ -965,7 +982,6 @@ sub parse_arguments ()
     (
      'help'            => sub { usage(0); },
      'version'         => \&version,
-     'acdir=s'         => \&handle_acdir_option,
      'system-acdir=s'  => sub { shift; @system_includes = @_; },
      'automake-acdir=s'        => sub { shift; @automake_includes = @_; },
      'diff:s'          => \$diff_command,
@@ -982,6 +998,12 @@ sub parse_arguments ()
   use Automake::Getopt ();
   Automake::Getopt::parse_options %cli_options;
 
+  if (@ARGV > 0)
+    {
+      fatal ("non-option arguments are not accepted: '$ARGV[0]'.\n"
+             . "Try '$0 --help' for more information.");
+    }
+
   if ($print_and_exit)
     {
       print "@system_includes\n";