cleanup: remove two lines of dead code in automake
[platform/upstream/automake.git] / automake.in
index 32389f4..386bbf2 100644 (file)
@@ -6,7 +6,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
     if 0;
 
 # automake - create Makefile.in from Makefile.am
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,8 +29,9 @@ package Language;
 
 BEGIN
 {
-  my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
-  unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+  @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+    unless @Automake::perl_libdirs;
+  unshift @INC, @Automake::perl_libdirs;
 
   # Override SHELL.  This is required on DJGPP so that system() uses
   # bash, not COMMAND.COM which doesn't quote arguments properly.
@@ -2130,6 +2131,7 @@ sub handle_source_transform ($$$$%)
        msg_var ('unsupported', $ext_var, $ext_var->name . " can assume at most one value")
          if $default_source_ext =~ /[\t ]/;
        (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,$default_source_ext,;
+       # TODO: Remove this backward-compatibility hack in Automake 1.14.
        if ($old_default_source ne $default_source
            && !$ext_var
            && (rule $old_default_source
@@ -2991,7 +2993,12 @@ sub scan_texinfo_file ($)
          next if $outfile;
 
          $outfile = $1;
-         if ($outfile =~ /\.([^.]+)$/ && $1 ne 'info')
+         if (index ($outfile, '.') < 0)
+           {
+             msg 'obsolete', "$filename:$.",
+                 "use of suffix-less info files is discouraged"
+           }
+         elsif ($outfile !~ /\.info$/)
            {
              error ("$filename:$.",
                     "output '$outfile' has unrecognized extension");
@@ -3012,8 +3019,6 @@ sub scan_texinfo_file ($)
       return;
     }
 
-  my $infobase = basename ($filename);
-  $infobase =~ s/\.te?xi(nfo)?$//;
   return ($outfile, $vfile);
 }
 
@@ -3141,6 +3146,8 @@ sub handle_texinfo_helper ($)
       ($info_texinfos->value_as_list_recursive (inner_expand => 1))
     {
       my $infobase = $texi;
+      # TODO: In Automake 1.14 (or even 1.13.2), start warning against
+      # TODO: suffixes != ".texi", to ease transition to Automake-NG.
       $infobase =~ s/\.(txi|texinfo|texi)$//;
 
       if ($infobase eq $texi)
@@ -4133,6 +4140,9 @@ sub handle_configure ($$$@)
   # Distribute and define mkinstalldirs only if it is already present
   # in the package, for backward compatibility (some people may still
   # use $(mkinstalldirs)).
+  # TODO: start warning about this in Automake 1.13.2, and have
+  # TODO: Automake 1.14 or 1.15 drop it (and the mkinstalldirs script
+  # TODO: as well).
   my $mkidpath = "$config_aux_dir/mkinstalldirs";
   if (-f $mkidpath)
     {
@@ -5130,7 +5140,7 @@ sub scan_autoconf_traces ($)
                AM_AUTOMAKE_VERSION => 1,
                 AM_PROG_MKDIR_P => 0, # FIXME: to be removed in 1.14
                AM_CONDITIONAL => 2,
-               _AM_EXTRA_RECURSIVE_TARGETS => 1,
+               AM_EXTRA_RECURSIVE_TARGETS => 1,
                AM_GNU_GETTEXT => 0,
                AM_GNU_GETTEXT_INTL_SUBDIR => 0,
                AM_INIT_AUTOMAKE => 0,
@@ -5296,9 +5306,12 @@ EOF
        {
          $configure_cond{$args[1]} = $where;
        }
-      elsif ($macro eq '_AM_EXTRA_RECURSIVE_TARGETS')
+      elsif ($macro eq 'AM_EXTRA_RECURSIVE_TARGETS')
        {
-         push @extra_recursive_targets, split (' ', $args[1]);
+          # Empty leading/trailing fields might be produced by split,
+          # hence the grep is really needed.
+          push @extra_recursive_targets,
+               grep (/./, (split /\s+/, $args[1]));
        }
       elsif ($macro eq 'AM_GNU_GETTEXT')
        {