]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Merge branch 'master' into ng/master
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 16 Feb 2013 22:22:08 +0000 (23:22 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 16 Feb 2013 22:30:34 +0000 (23:30 +0100)
* master: (41 commits)
  typofix: in comments in 't/ax/test-lib.sh'
  style: call perl functions 'like_this()', not '&like_this()'
  tests on TAP: don't run the driver with perl unconditionally
  typofix: in comments in 'automake.in'
  tests: remove obsolete (and now wrong) comment
  typofix: in diagnostic in test 't/tap-realtime.sh'
  maint: use more perl subroutines prototypes in the automake script
  build: auto-generate perl subroutines prototypes for automake and aclocal
  refactor: rip module Automake::Language out of automake script
  automake: fix reference to relevant tests in comments
  NEWS: we no longer plan to drop $(INCLUDES) support in next major version
  NEWS: IRIX is still supported; only SGI depmode no longer is
  NEWS: IRIX is still supported; only SGI C compiler depcomp no longer is
  coverage: split info files are not installed nor distributed
  maint: version bump after beta release 1.13.1b
  NEWS: typofix
  release: beta release 1.13.1b (will become 1.13.2)
  docs: '.txi' and '.texinfo' extensions are deprecated
  NEWS: document recent documentation improvements
  docs: more precise cross reference
  ...

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 files changed:
1  2 
HACKING
Makefile.am
aclocal.in
automake.in
bootstrap.sh
doc/automake-ng.texi
m4/init.m4
maintainer/syntax-checks.mk
t/ax/am-test-lib.sh
t/ax/test-lib.sh
t/lisp-flags.sh
t/txinfo-no-extra-dist.sh

diff --cc HACKING
Simple merge
diff --cc Makefile.am
index 6e9486714c5f13642b52abd3544b75c0e59fae5b,e4817265bca178b4b34be745089544ba20bdd5b0..227fe646d834b78ea4089adb7a2aaee3cbeae9d3
@@@ -87,9 -94,15 +87,13 @@@ uninstall-hook
  
  # These files depend on Makefile so they are rebuilt if $(VERSION),
  # $(datadir) or other do_subst'ituted variables change.
- automake aclocal: %: %.in Makefile
-       $(AM_V_at)rm -f $@ $@-t
-       $(AM_V_GEN)$(do_subst)
 -automake: automake.in
 -aclocal: aclocal.in
 -automake aclocal: Makefile lib/gen-perl-protos
++automake aclocal: %: %.in Makefile lib/gen-perl-protos
+       $(AM_V_GEN)rm -f $@ $@-t $@-t2 \
+ ## Common substitutions.
 -        && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
++        && $(do_subst) \
+ ## Auto-compute prototypes of perl subroutines.
+         && $(PERL) -w $(srcdir)/lib/gen-perl-protos $@-t > $@-t2 \
+         && mv -f $@-t2 $@-t \
  ## We can't use '$(generated_file_finalize)' here, because currently
  ## Automake contains occurrences of unexpanded @substitutions@ in
  ## comments, and that is perfectly legit.
@@@ -253,9 -281,11 +259,9 @@@ dist_automake_ac_DATA = 
    m4/install-sh.m4 \
    m4/lex.m4 \
    m4/lispdir.m4 \
 -  m4/maintainer.m4 \
 -  m4/make.m4 \
    m4/minuso.m4 \
    m4/missing.m4 \
-   m4/obsolete-err.m4 \
+   m4/obsolete.m4 \
    m4/options.m4 \
    m4/python.m4 \
    m4/runlog.m4 \
diff --cc aclocal.in
Simple merge
diff --cc automake.in
index 4f10712f6596579e8fb655f5ff473ba28fe113ed,02c6d413809346738b01fa0b84f1661ff0886a87..e52f58f0bc2d1d788c16159145ab8ca84a7316e1
@@@ -34,94 -36,17 +36,7 @@@ BEGI
    unshift @INC, @Automake::perl_libdirs;
  }
  
- use Class::Struct ();
- Class::Struct::struct (
-       # Short name of the language (c, f77...).
-       'name' => "\$",
-       # Nice name of the language (C, Fortran 77...).
-       'Name' => "\$",
-       # List of configure variables which must be defined.
-       'config_vars' => '@',
-       # 'pure' is '1' or ''.  A 'pure' language is one where, if
-       # all the files in a directory are of that language, then we
-       # do not require the C compiler or any code to call it.
-       'pure'   => "\$",
-       'autodep' => "\$",
-       # Name of the compiling variable (COMPILE).
-       'compiler'  => "\$",
-       # Content of the compiling variable.
-       'compile'  => "\$",
-       # Flag to require compilation without linking (-c).
-       'compile_flag' => "\$",
-       'extensions' => '@',
-       # A subroutine to compute a list of possible extensions of
-       # the product given the input extensions.
-       # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
-       'output_extensions' => "\$",
-       # A list of flag variables used in 'compile'.
-       # (defaults to [])
-       'flags' => "@",
-       # Any tag to pass to libtool while compiling.
-       'libtool_tag' => "\$",
-       # The file to use when generating rules for this language.
-       # The default is 'depend2'.
-       'rule_file' => "\$",
-       # Name of the linking variable (LINK).
-       'linker' => "\$",
-       # Content of the linking variable.
-       'link' => "\$",
-       # Name of the compiler variable (CC).
-       'ccer' => "\$",
-       # Name of the linker variable (LD).
-       'lder' => "\$",
-       # Content of the linker variable ($(CC)).
-       'ld' => "\$",
-       # Flag to specify the output file (-o).
-       'output_flag' => "\$",
-       '_finish' => "\$",
-       # This is a subroutine which is called whenever we finally
-       # determine the context in which a source file will be
-       # compiled.
-       '_target_hook' => "\$",
-       # If TRUE, nodist_ sources will be compiled using specific rules
-       # (i.e. not inference rules).  The default is FALSE.
-       'nodist_specific' => "\$");
- sub finish ($)
- {
-   my ($self) = @_;
-   if (defined $self->_finish)
-     {
-       &{$self->_finish} (@_);
-     }
- }
- sub target_hook ($$$$%)
- {
-     my ($self) = @_;
-     if (defined $self->_target_hook)
-     {
-       &{$self->_target_hook} (@_);
-     }
- }
- package Automake;
- use strict;
  use Automake::Config;
 -BEGIN
 -{
 -  if ($perl_threads)
 -    {
 -      require threads;
 -      import threads;
 -      require Thread::Queue;
 -      import Thread::Queue;
 -    }
 -}
  use Automake::General;
  use Automake::XFile;
  use Automake::Channels;
@@@ -571,16 -512,26 +494,8 @@@ my %am_file_cache
  
  ################################################################
  
- ## --------------------------------- ##
- ## Forward subroutine declarations.  ##
- ## --------------------------------- ##
- sub register_language (%);
- sub file_contents_internal ($$$%);
- sub define_files_variable ($\@$$);
 -# var_SUFFIXES_trigger ($TYPE, $VALUE)
 -# ------------------------------------
 -# This is called by Automake::Variable::define() when SUFFIXES
 -# is defined ($TYPE eq '') or appended ($TYPE eq '+').
 -# The work here needs to be performed as a side-effect of the
 -# macro_define() call because SUFFIXES definitions impact
 -# on $KNOWN_EXTENSIONS_PATTERN which is used used when parsing
 -# the input am file.
 -sub var_SUFFIXES_trigger ($$)
 -{
 -    my ($type, $value) = @_;
 -    accept_extensions (split (' ', $value));
 -}
 -Automake::Variable::hook ('SUFFIXES', \&var_SUFFIXES_trigger);
--
 -################################################################
--
- # &initialize_per_input ()
- # ------------------------
 -
+ # initialize_per_input ()
+ # -----------------------
  # (Re)-Initialize per-Makefile.am variables.
  sub initialize_per_input ()
  {
@@@ -1301,7 -1288,8 +1216,7 @@@ sub handle_languages (
                         'FASTDEP' => $FASTDEP,
                         '-c'      => $lang->compile_flag || '',
                         # These are not used, but they need to be defined
-                        # so &transform do not complain.
+                        # so transform() do not complain.
 -                       SUBDIROBJ     => 0,
                         'DERIVED-EXT' => 'BUG',
                         DIST_SOURCE   => 1,
                         VERBOSE   => $verbose,
  
            # Compute a possible derived extension.
            # This is not used by depend2.am.
-           my $der_ext = (&{$lang->output_extensions} ($ext))[0];
+           my $der_ext = ($lang->output_extensions->($ext))[0];
  
 -          # When we output an inference rule like '.c.o:' we
 -          # have two cases to consider: either subdir-objects
 -          # is used, or it is not.
 -          #
 -          # In the latter case the rule is used to build objects
 -          # in the current directory, and dependencies always
 -          # go into './$(DEPDIR)/'.  We can hard-code this value.
 -          #
 -          # In the former case the rule can be used to build
 -          # objects in sub-directories too.  Dependencies should
 -          # go into the appropriate sub-directories, e.g.,
 -          # 'sub/$(DEPDIR)/'.  The value of this directory
 -          # needs to be computed on-the-fly.
 -          #
 -          # DEPBASE holds the name of this directory, plus the
 -          # basename part of the object file (extensions Po, TPo,
 -          # Plo, TPlo will be added later as appropriate).  It is
 -          # either hardcoded, or a shell variable ('$depbase') that
 -          # will be computed by the rule.
 -          my $depbase =
 -            option ('subdir-objects') ? '$$depbase' : '$(DEPDIR)/$*';
            $output_rules .=
              file_contents ($rule_file,
                             new Automake::Location,
        check_user_variables @dont_override;
      }
  
 -    # If the project is entirely C++ or entirely Fortran 77 (i.e., 1
 -    # suffix rule was learned), don't bother with the C stuff.  But if
 -    # anything else creeps in, then use it.
 -    $needs_c = 1
 -      if $need_link || suffix_rules_count > 1;
 -
 -    if ($needs_c)
 +    # Non-pure languages, or languages lacking a linker of their own.
 +    if ($needs_c || $need_link)
        {
-       &define_compiler_variable ($languages{'c'})
+       define_compiler_variable ($languages{'c'})
          unless defined $done{$languages{'c'}};
        define_linker_variable ($languages{'c'});
        }
@@@ -1951,8 -2097,8 +1866,8 @@@ sub handle_source_transform ($$$$%
                                   $one_file . '_SOURCES',
                                   $one_file, $obj,
                                   $default_source, %transform);
-       $linker ||= &resolve_linker (%linkers_used);
+       $linker ||= resolve_linker (%linkers_used);
 -      define_pretty_variable ($one_file . '_OBJECTS', TRUE, $where, @result);
 +      define_variable ($one_file . '_OBJECTS', $where, @result);
      }
      else
      {
@@@ -2168,10 -2326,55 +2083,10 @@@ sub check_canonical_spelling ($@
  # Set up the compile suite.
  sub handle_compile ()
  {
--   return if ! $must_handle_compiled_objects;
-    $output_rules .= file_contents ('compile',
-                                    new Automake::Location,
-                                    'STDINC' => ! option 'nostdinc');
 -
 -    # Boilerplate.
 -    my $default_includes = '';
 -    if (! option 'nostdinc')
 -      {
 -      my @incs = ('-I.', subst ('am__isrc'));
 -
 -      my $var = var 'CONFIG_HEADER';
 -      if ($var)
 -        {
 -          foreach my $hdr (split (' ', $var->variable_value))
 -            {
 -              push @incs, '-I' . dirname ($hdr);
 -            }
 -        }
 -      # We want '-I. -I$(srcdir)', but the latter -I is redundant
 -      # and unaesthetic in non-VPATH builds.  We use `-I.@am__isrc@`
 -      # instead.  It will be replaced by '-I.' or '-I. -I$(srcdir)'.
 -      # Items in CONFIG_HEADER are never in $(srcdir) so it is safe
 -      # to just put @am__isrc@ right after '-I.', without a space.
 -      ($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
 -      }
 -
 -    my (@mostly_rms, @dist_rms);
 -    foreach my $item (sort keys %compile_clean_files)
 -    {
 -      if ($compile_clean_files{$item} == MOSTLY_CLEAN)
 -      {
 -          push (@mostly_rms, "\t-rm -f $item");
 -      }
 -      elsif ($compile_clean_files{$item} == DIST_CLEAN)
 -      {
 -          push (@dist_rms, "\t-rm -f $item");
 -      }
 -      else
 -      {
 -        prog_error 'invalid entry in %compile_clean_files';
 -      }
 -    }
 -
 -    my ($coms, $vars, $rules) =
 -      file_contents_internal (1, "$libdir/am/compile.am",
 -                            new Automake::Location,
 -                            'DEFAULT_INCLUDES' => $default_includes,
 -                            'MOSTLYRMS' => join ("\n", @mostly_rms),
 -                            'DISTRMS' => join ("\n", @dist_rms));
 -    $output_vars .= $vars;
 -    $output_rules .= "$coms$rules";
++    return if ! $must_handle_compiled_objects;
++    $output_rules .= file_contents ('compile',
++                                    new Automake::Location,
++                                    'STDINC' => ! option 'nostdinc');
  }
  
  # handle_libtool ()
@@@ -2253,18 -2463,25 +2168,18 @@@ sub handle_programs (
        set_seen ($xname . '_LDFLAGS');
  
        # Determine program to use for link.
-       my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xname);
+       my($xlink, $vlink) = define_per_target_linker_variable ($linker, $xname);
        $vlink = verbose_flag ($vlink || 'GEN');
  
 -      # If the resulting program lies in a subdirectory,
 -      # ensure that the directory exists before we need it.
 -      my $dirstamp = require_build_directory_maybe ($one_file);
 -
 -      $libtool_clean_directories{dirname ($one_file)} = 1;
 +      $clean_dirs{dirname ($one_file) . '/.libs'} = CLEAN;
  
-       $output_rules .= &file_contents ('program',
-                                      $where,
-                                      PROGRAM  => $one_file,
-                                      XPROGRAM => $xname,
-                                      XLINK    => $xlink,
-                                      VERBOSE  => $vlink,
-                                      EXEEXT   => '$(EXEEXT)');
+       $output_rules .= file_contents ('program',
 -                                      $where,
 -                                      PROGRAM  => $one_file,
 -                                      XPROGRAM => $xname,
 -                                      XLINK    => $xlink,
 -                                      VERBOSE  => $vlink,
 -                                      DIRSTAMP => $dirstamp,
 -                                      EXEEXT   => '$(EXEEXT)');
++                                    $where,
++                                    PROGRAM  => $one_file,
++                                    XPROGRAM => $xname,
++                                    XLINK    => $xlink,
++                                    VERBOSE  => $vlink,
++                                    EXEEXT   => '$(EXEEXT)');
  
        if ($seen_libobjs || $seen_global_libobjs)
        {
@@@ -2355,16 -2572,26 +2270,16 @@@ sub handle_libraries (
        reject_var ($xlib . '_LDADD',
                  "use '${xlib}_LIBADD', not '${xlib}_LDADD'");
  
-       &handle_source_transform ($xlib, $onelib, $obj, $where,
-                               NONLIBTOOL => 1, LIBTOOL => 0);
 -      # Make sure we at look at this.
 -      set_seen ($xlib . '_DEPENDENCIES');
 -      set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
 -
+       handle_source_transform ($xlib, $onelib, $obj, $where,
+                                NONLIBTOOL => 1, LIBTOOL => 0);
  
 -      # If the resulting library lies in a subdirectory,
 -      # make sure this directory will exist.
 -      my $dirstamp = require_build_directory_maybe ($onelib);
        my $verbose = verbose_flag ('AR');
 -      my $silent = silent_flag ();
  
-       $output_rules .= &file_contents ('library',
-                                      $where,
-                                      VERBOSE  => $verbose,
-                                      LIBRARY  => $onelib,
-                                      XLIBRARY => $xlib);
+       $output_rules .= file_contents ('library',
+                                        $where,
+                                        VERBOSE  => $verbose,
 -                                       SILENT   => $silent,
+                                        LIBRARY  => $onelib,
 -                                       XLIBRARY => $xlib,
 -                                       DIRSTAMP => $dirstamp);
++                                       XLIBRARY => $xlib);
  
        if ($seen_libobjs)
        {
@@@ -2594,15 -2823,22 +2509,15 @@@ sub handle_ltlibraries (
            }
        }
  
 -      # If the resulting library lies in a subdirectory,
 -      # make sure this directory will exist.
 -      my $dirstamp = require_build_directory_maybe ($onelib);
 -
 -      # Remember to cleanup .libs/ in this directory.
 -      my $dirname = dirname $onelib;
 -      $libtool_clean_directories{$dirname} = 1;
 +      $clean_dirs{dirname ($onelib) . '/.libs'} = CLEAN;
  
-       $output_rules .= &file_contents ('ltlibrary',
-                                      $where,
-                                      LTLIBRARY  => $onelib,
-                                      XLTLIBRARY => $xlib,
-                                      RPATH      => $rpath,
-                                      XLINK      => $xlink,
-                                      VERBOSE    => $vlink);
+       $output_rules .= file_contents ('ltlibrary',
+                                       $where,
+                                       LTLIBRARY  => $onelib,
+                                       XLTLIBRARY => $xlib,
+                                       RPATH      => $rpath,
+                                       XLINK      => $xlink,
 -                                      VERBOSE    => $vlink,
 -                                      DIRSTAMP   => $dirstamp);
++                                      VERBOSE    => $vlink);
        if ($seen_libobjs)
        {
          if (var ($xlib . '_LIBADD'))
      }
  }
  
 -# See if any _SOURCES variable were misspelled.
 -sub check_typos ()
 -{
 -  # It is ok if the user sets this particular variable.
 -  set_seen 'AM_LDFLAGS';
 -
 -  foreach my $primary ('SOURCES', 'LIBADD', 'LDADD', 'LDFLAGS', 'DEPENDENCIES')
 -    {
 -      foreach my $var (variables $primary)
 -      {
 -        my $varname = $var->name;
 -        # A configure variable is always legitimate.
 -        next if exists $configure_vars{$varname};
 -
 -        for my $cond ($var->conditions->conds)
 -          {
 -            $varname =~ /^(?:EXTRA_)?(?:nobase_)?(?:dist_|nodist_)?(.*)_[[:alnum:]]+$/;
 -            msg_var ('syntax', $var, "variable '$varname' is defined but no"
 -                     . " program or\nlibrary has '$1' as canonical name"
 -                     . " (possible typo)")
 -              unless $var->rdef ($cond)->seen;
 -          }
 -      }
 -    }
 -}
 -
  
  # Handle scripts.
- sub handle_scripts
+ sub handle_scripts ()
  {
      # NOTE we no longer automatically clean SCRIPTS, because it is
      # useful to sometimes distribute scripts verbatim.  This happens
@@@ -3144,14 -3546,57 +3059,14 @@@ sub handle_man_pages (
  }
  
  # Handle DATA variables.
- sub handle_data
+ sub handle_data ()
  {
-     &am_install_var ('-noextra', '-candist', 'data', 'DATA',
-                    'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf',
-                    'ps', 'sysconf', 'sharedstate', 'localstate',
-                    'pkgdata', 'lisp', 'noinst', 'check');
+     am_install_var ('-noextra', '-candist', 'data', 'DATA',
+                     'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf',
+                     'ps', 'sysconf', 'sharedstate', 'localstate',
+                     'pkgdata', 'lisp', 'noinst', 'check');
  }
  
 -# Handle TAGS.
 -sub handle_tags ()
 -{
 -    my @config;
 -    foreach my $spec (@config_headers)
 -      {
 -        my ($out, @ins) = split_config_file_spec ($spec);
 -      foreach my $in (@ins)
 -        {
 -            # If the config header source is in this directory,
 -          # require it.
 -          push @config, basename ($in)
 -              if $relative_dir eq dirname ($in);
 -         }
 -      }
 -
 -    define_variable ('am__tagged_files',
 -                     '$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)'
 -                     . "@config", INTERNAL);
 -
 -    if (rvar('am__tagged_files')->value_as_list_recursive
 -          || var ('ETAGS_ARGS') || var ('SUBDIRS'))
 -      {
 -      $output_rules .= file_contents ('tags', new Automake::Location);
 -      set_seen 'TAGS_DEPENDENCIES';
 -      }
 -    else
 -      {
 -        reject_var ('TAGS_DEPENDENCIES',
 -                  "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
 -                  . " without\nsources or 'ETAGS_ARGS'");
 -      # Every Makefile must define some sort of TAGS rule.
 -      # Otherwise, it would be possible for a top-level "make TAGS"
 -      # to fail because some subdirectory failed.  Ditto ctags and
 -        # cscope.
 -        $output_rules .=
 -          "tags TAGS:\n\n" .
 -          "ctags CTAGS:\n\n" .
 -          "cscope cscopelist:\n\n";
 -      }
 -}
 -
 -
  # user_phony_rule ($NAME)
  # -----------------------
  # Return false if rule $NAME does not exist.  Otherwise,
@@@ -3349,11 -3836,10 +3264,11 @@@ sub handle_subdirs (
  }
  
  
 -# ($REGEN, @DEPENDENCIES)
 -# scan_aclocal_m4
 -# ---------------
 -# If aclocal.m4 creation is automated, return the list of its dependencies.
 +# $REGEN
- # &scan_aclocal_m4
++# scan_aclocal_m4()
 +# ----------------
 +# If aclocal.m4 creation is automated, return "aclocal.m4",
 +# otherwise return 0.
  sub scan_aclocal_m4 ()
  {
    my $regen_aclocal = 0;
@@@ -3470,40 -3958,15 +3385,40 @@@ sub rewrite_inputs_into_dependencies ($
    return @res;
  }
  
 +sub handle_config_headers ()
 +{
 +  my (@config_h_local, @config_h_nonlocal, @config_hin_local);
 +  foreach my $spec (@config_headers)
 +    {
 +      my ($out, @ins) = split_config_file_spec ($spec);
 +      if ($relative_dir eq dirname ($out))
 +      {
 +        push @config_h_local, basename ($out);
 +      }
 +      else
 +      {
 +        push @config_h_nonlocal, "\$(top_builddir)/$out";
 +      }
 +      foreach my $in (@ins)
 +        {
 +        push @config_hin_local, '$(srcdir)/' . basename ($in)
 +            if $relative_dir eq dirname ($in);
 +        }
 +    }
 +  define_variable ('am.config-hdr.local', INTERNAL, @config_h_local);
 +  define_variable ('am.config-hdr.non-local', INTERNAL, @config_h_nonlocal);
 +  define_variable ('am.config-hdr.local.in',  INTERNAL, @config_hin_local);
 +  define_variable ('AM_CONFIG_HEADERS', INTERNAL,
 +                   qw/$(am.config-hdr.local) $(am.config-hdr.non-local)/);
 +}
  
- # &handle_configure ($MAKEFILE, @INPUTS)
- # --------------------------------------
 -
 -# handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
 -# -----------------------------------------------------------------
++# handle_configure ($MAKEFILE, @INPUTS)
++# -------------------------------------
  # Handle remaking and configure stuff.
  # We need the name of the input file, to do proper remaking rules.
 -sub handle_configure ($$$@)
 +sub handle_configure ($@)
  {
 -  my ($makefile_am, $makefile_in, $makefile, @inputs) = @_;
 +  my ($makefile, @inputs) = @_;
  
    prog_error 'empty @inputs'
      unless @inputs;
@@@ -3797,63 -4342,233 +3712,63 @@@ sub handle_gettext (
  }
  
  # Handle footer elements.
- sub handle_footer
+ sub handle_footer ()
  {
 -    reject_rule ('.SUFFIXES',
 -               "use variable 'SUFFIXES', not target '.SUFFIXES'");
 -
 -    # Note: AIX 4.1 /bin/make will fail if any suffix rule appears
 -    # before .SUFFIXES.  So we make sure that .SUFFIXES appears before
 -    # anything else, by sticking it right after the default: target.
 -    $output_header .= ".SUFFIXES:\n";
 -    my $suffixes = var 'SUFFIXES';
 -    my @suffixes = Automake::Rule::suffixes;
 -    if (@suffixes || $suffixes)
 -    {
 -      # Make sure SUFFIXES has unique elements.  Sort them to ensure
 -      # the output remains consistent.  However, $(SUFFIXES) is
 -      # always at the start of the list, unsorted.  This is done
 -      # because make will choose rules depending on the ordering of
 -      # 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.
 -      my @user_suffixes = ($suffixes
 -                           ? $suffixes->value_as_list_recursive : ());
 +  # FIXME: maybe display a warning if the obsolescent $(SUFFIXES)
 +  # FIXME: variable is used?  Currently, we don't do that, to preserve
 +  # FIXME: better compatibility with mainline Automake.
 +  $output_trailer .= file_contents ('footer', new Automake::Location);
 +}
  
 -      my %suffixes = map { $_ => 1 } @suffixes;
 -      delete @suffixes{@user_suffixes};
 +# Generate helper targets for user recursion, where needed.
 +sub handle_user_recursion ()
 +{
 +  return unless @extra_recursive_targets;
  
 -      $output_header .= (".SUFFIXES: "
 -                         . join (' ', @user_suffixes, sort keys %suffixes)
 -                         . "\n");
 +  define_variable ('am.recurs.extra-targets', INTERNAL,
 +                   map { "$_-recursive" } @extra_recursive_targets);
 +  my $aux = var ('SUBDIRS') ? 'recursive' : 'am';
 +  foreach my $target (@extra_recursive_targets)
 +    {
 +      # This allows the default target's rules to be overridden in
 +      # Makefile.am.
 +      user_phony_rule ($target);
 +      depend ("$target", "$target-$aux");
 +      depend ("$target-am", "$target-local");
 +      # Every user-defined recursive target 'foo' *must* have a valid
 +      # associated 'foo-local' rule; we define it as an empty rule by
 +      # default, so that the user can transparently extend it in his
 +      # own Makefile.am.
-       pretty_print_rule ("$target-local:");
++      pretty_print_rule ("$target-local:", '', '');
 +      # $target-recursive might as well be undefined, so do not add
 +      # it here; it's taken care of in subdirs.am anyway.
 +      depend (".PHONY", "$target-am", "$target-local");
      }
 -
 -    $output_trailer .= file_contents ('footer', new Automake::Location);
  }
  
 -
 -# Generate 'make install' rules.
 -sub handle_install ()
 +sub handle_clean ()
  {
 -  $output_rules .= file_contents
 -    ('install',
 -     new Automake::Location,
 -     maybe_BUILT_SOURCES => (set_seen ('BUILT_SOURCES')
 -                           ? (" \$(BUILT_SOURCES)\n"
 -                              . "\t\$(MAKE) \$(AM_MAKEFLAGS)")
 -                           : ''),
 -     'installdirs-local' => (user_phony_rule 'installdirs-local'
 -                           ? ' installdirs-local' : ''),
 -     am__installdirs => variable_value ('am__installdirs') || '');
 -}
 -
 -
 -# Deal with all and all-am.
 -sub handle_all ($)
 -{
 -    my ($makefile) = @_;
 -
 -    # Output 'all-am'.
 -
 -    # Put this at the beginning for the sake of non-GNU makes.  This
 -    # is still wrong if these makes can run parallel jobs.  But it is
 -    # right enough.
 -    unshift (@all, basename ($makefile));
 -
 -    foreach my $spec (@config_headers)
 -      {
 -      my ($out, @ins) = split_config_file_spec ($spec);
 -      push (@all, basename ($out))
 -        if dirname ($out) eq $relative_dir;
 -      }
 +  my (%f, %d);
  
 -    # Install 'all' hooks.
 -    push (@all, "all-local")
 -      if user_phony_rule "all-local";
 +  my @fkeys = keys %clean_files;
 +  $f{mostly} = [ grep { $clean_files{$_} == MOSTLY_CLEAN     } @fkeys ];
 +  $f{normal} = [ grep { $clean_files{$_} == CLEAN            } @fkeys ];
 +  $f{dist}   = [ grep { $clean_files{$_} == DIST_CLEAN       } @fkeys ];
 +  $f{maint}  = [ grep { $clean_files{$_} == MAINTAINER_CLEAN } @fkeys ];
  
 -    pretty_print_rule ("all-am:", "\t\t", @all);
 -    depend ('.PHONY', 'all-am', 'all');
 +  my @dkeys = keys %clean_dirs;
 +  $d{mostly} = [ grep { $clean_dirs{$_} == MOSTLY_CLEAN     } @dkeys ];
 +  $d{normal} = [ grep { $clean_dirs{$_} == CLEAN            } @dkeys ];
 +  $d{dist}   = [ grep { $clean_dirs{$_} == DIST_CLEAN       } @dkeys ];
 +  $d{maint}  = [ grep { $clean_dirs{$_} == MAINTAINER_CLEAN } @dkeys ];
  
 -
 -    # Output 'all'.
 -
 -    my @local_headers = ();
 -    push @local_headers, '$(BUILT_SOURCES)'
 -      if var ('BUILT_SOURCES');
 -    foreach my $spec (@config_headers)
 -      {
 -      my ($out, @ins) = split_config_file_spec ($spec);
 -      push @local_headers, basename ($out)
 -        if dirname ($out) eq $relative_dir;
 -      }
 -
 -    if (@local_headers)
 -      {
 -      # We need to make sure config.h is built before we recurse.
 -      # We also want to make sure that built sources are built
 -      # before any ordinary 'all' targets are run.  We can't do this
 -      # by changing the order of dependencies to the "all" because
 -      # that breaks when using parallel makes.  Instead we handle
 -      # things explicitly.
 -      $output_all .= ("all: @local_headers"
 -                      . "\n\t"
 -                      . '$(MAKE) $(AM_MAKEFLAGS) '
 -                      . (var ('SUBDIRS') ? 'all-recursive' : 'all-am')
 -                      . "\n\n");
 -        depend ('.MAKE', 'all');
 -      }
 -    else
 -      {
 -      $output_all .= "all: " . (var ('SUBDIRS')
 -                                ? 'all-recursive' : 'all-am') . "\n\n";
 -      }
 -}
 -
 -# Generate helper targets for user recursion, where needed.
 -sub handle_user_recursion ()
 -{
 -  return unless @extra_recursive_targets;
 -
 -  define_pretty_variable ('am__extra_recursive_targets', TRUE, INTERNAL,
 -                          map { "$_-recursive" } @extra_recursive_targets);
 -  my $aux = var ('SUBDIRS') ? 'recursive' : 'am';
 -  foreach my $target (@extra_recursive_targets)
 +  foreach my $kind (qw/mostly normal dist maint/)
      {
 -      # This allows the default target's rules to be overridden in
 -      # Makefile.am.
 -      user_phony_rule ($target);
 -      depend ("$target", "$target-$aux");
 -      depend ("$target-am", "$target-local");
 -      # Every user-defined recursive target 'foo' *must* have a valid
 -      # associated 'foo-local' rule; we define it as an empty rule by
 -      # default, so that the user can transparently extend it in his
 -      # own Makefile.am.
 -      pretty_print_rule ("$target-local:", '', '');
 -      # $target-recursive might as well be undefined, so do not add
 -      # it here; it's taken care of in subdirs.am anyway.
 -      depend (".PHONY", "$target-am", "$target-local");
 +      define_variable ("am.clean.$kind.f.auto", INTERNAL, @{$f{$kind}});
 +      define_variable ("am.clean.$kind.d.auto", INTERNAL, @{$d{$kind}});
      }
 -}
 -
 -
 -# do_check_merge_target ()
 -# ------------------------
 -# Handle check merge target specially.
 -sub do_check_merge_target ()
 -{
 -  # Include user-defined local form of target.
 -  push @check_tests, 'check-local'
 -    if user_phony_rule 'check-local';
 -
 -  # The check target must depend on the local equivalent of
 -  # 'all', to ensure all the primary targets are built.  Then it
 -  # must build the local check rules.
 -  $output_rules .= "check-am: all-am\n";
 -  if (@check)
 -    {
 -      pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ", @check);
 -      depend ('.MAKE', 'check-am');
 -    }
 -
 -  if (@check_tests)
 -    {
 -      pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ",
 -                       @check_tests);
 -      depend ('.MAKE', 'check-am');
 -    }
 -
 -  depend '.PHONY', 'check', 'check-am';
 -  # Handle recursion.  We have to honor BUILT_SOURCES like for 'all:'.
 -  $output_rules .= ("check: "
 -                  . (var ('BUILT_SOURCES')
 -                     ? "\$(BUILT_SOURCES)\n\t\$(MAKE) \$(AM_MAKEFLAGS) "
 -                     : '')
 -                  . (var ('SUBDIRS') ? 'check-recursive' : 'check-am')
 -                  . "\n");
 -  depend ('.MAKE', 'check')
 -    if var ('BUILT_SOURCES');
 -}
 -
 -# handle_clean ($MAKEFILE)
 -# ------------------------
 -# Handle all 'clean' targets.
 -sub handle_clean ($)
 -{
 -  my ($makefile) = @_;
 -
 -  # Clean the files listed in user variables if they exist.
 -  $clean_files{'$(MOSTLYCLEANFILES)'} = MOSTLY_CLEAN
 -    if var ('MOSTLYCLEANFILES');
 -  $clean_files{'$(CLEANFILES)'} = CLEAN
 -    if var ('CLEANFILES');
 -  $clean_files{'$(DISTCLEANFILES)'} = DIST_CLEAN
 -    if var ('DISTCLEANFILES');
 -  $clean_files{'$(MAINTAINERCLEANFILES)'} = MAINTAINER_CLEAN
 -    if var ('MAINTAINERCLEANFILES');
 -
 -  # Built sources are automatically removed by maintainer-clean.
 -  $clean_files{'$(BUILT_SOURCES)'} = MAINTAINER_CLEAN
 -    if var ('BUILT_SOURCES');
 -
 -  # Compute a list of "rm"s to run for each target.
 -  my %rms = (MOSTLY_CLEAN, [],
 -           CLEAN, [],
 -           DIST_CLEAN, [],
 -           MAINTAINER_CLEAN, []);
 -
 -  foreach my $file (keys %clean_files)
 -    {
 -      my $when = $clean_files{$file};
 -      prog_error 'invalid entry in %clean_files'
 -      unless exists $rms{$when};
  
 -      my $rm = "rm -f $file";
 -      # If file is a variable, make sure when don't call 'rm -f' without args.
 -      $rm ="test -z \"$file\" || $rm"
 -      if ($file =~ /^\s*\$(\(.*\)|\{.*\})\s*$/);
 -
 -      push @{$rms{$when}}, "\t-$rm\n";
 -    }
 -
 -  $output_rules .= file_contents
 -    ('clean',
 -     new Automake::Location,
 -     MOSTLYCLEAN_RMS      => join ('', sort @{$rms{&MOSTLY_CLEAN}}),
 -     CLEAN_RMS            => join ('', sort @{$rms{&CLEAN}}),
 -     DISTCLEAN_RMS        => join ('', sort @{$rms{&DIST_CLEAN}}),
 -     MAINTAINER_CLEAN_RMS => join ('', sort @{$rms{&MAINTAINER_CLEAN}}),
 -     MAKEFILE             => basename $makefile,
 -     );
 +  verbatim ('clean');
  }
  
  
@@@ -3961,7 -4677,80 +3875,7 @@@ sub handle_factored_dependencies (
      }
  }
  
- sub handle_tests
 -
 -# handle_tests_dejagnu ()
 -# -----------------------
 -sub handle_tests_dejagnu ()
 -{
 -    push (@check_tests, 'check-DEJAGNU');
 -    $output_rules .= file_contents ('dejagnu', new Automake::Location);
 -}
 -
 -sub handle_per_suffix_test ($%)
 -{
 -  my ($test_suffix, %transform) = @_;
 -  my ($pfx, $generic, $am_exeext);
 -  if ($test_suffix eq '')
 -    {
 -      $pfx = '';
 -      $generic = 0;
 -      $am_exeext = 'FALSE';
 -    }
 -  else
 -    {
 -      prog_error ("test suffix '$test_suffix' lacks leading dot")
 -        unless $test_suffix =~ m/^\.(.*)/;
 -      $pfx = uc ($1) . '_';
 -      $generic = 1;
 -      $am_exeext = exists $configure_vars{'EXEEXT'} ? 'am__EXEEXT'
 -                                                    : 'FALSE';
 -    }
 -  # The "test driver" program, deputed to handle tests protocol used by
 -  # test scripts.  By default, it's assumed that no protocol is used, so
 -  # we fall back to the old behaviour, implemented by the 'test-driver'
 -  # auxiliary script.
 -  if (! var "${pfx}LOG_DRIVER")
 -    {
 -      require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
 -      define_variable ("${pfx}LOG_DRIVER",
 -                       "\$(SHELL) $am_config_aux_dir/test-driver",
 -                       INTERNAL);
 -    }
 -  my $driver = '$(' . $pfx . 'LOG_DRIVER)';
 -  my $driver_flags = '$(AM_' . $pfx . 'LOG_DRIVER_FLAGS)'
 -                       . ' $(' . $pfx . 'LOG_DRIVER_FLAGS)';
 -  my $compile = "${pfx}LOG_COMPILE";
 -  define_variable ($compile,
 -                   '$(' . $pfx . 'LOG_COMPILER)'
 -                      . ' $(AM_' .  $pfx . 'LOG_FLAGS)'
 -                      . ' $(' . $pfx . 'LOG_FLAGS)',
 -                     INTERNAL);
 -  $output_rules .= file_contents ('check2', new Automake::Location,
 -                                   GENERIC => $generic,
 -                                   DRIVER => $driver,
 -                                   DRIVER_FLAGS => $driver_flags,
 -                                   COMPILE => '$(' . $compile . ')',
 -                                   EXT => $test_suffix,
 -                                   am__EXEEXT => $am_exeext,
 -                                   %transform);
 -}
 -
 -# is_valid_test_extension ($EXT)
 -# ------------------------------
 -# Return true if $EXT can appear in $(TEST_EXTENSIONS), return false
 -# otherwise.
 -sub is_valid_test_extension ($)
 -{
 -  my $ext = shift;
 -  return 1
 -    if ($ext =~ /^\.[a-zA-Z_][a-zA-Z0-9_]*$/);
 -  return 1
 -    if (exists $configure_vars{'EXEEXT'} && $ext eq subst ('EXEEXT'));
 -  return 0;
 -}
 -
 -# Handle TESTS variable and other checks.
+ sub handle_tests ()
  {
    if (option 'dejagnu')
      {
@@@ -4600,42 -5506,56 +4514,48 @@@ sub check_gnits_standards (
  # Note that the calls to these functions are computed, so don't bother
  # searching for their precise names in the source.
  
 -# This is just a convenience function that can be used to determine
 -# when a subdir object should be used.
 -sub lang_sub_obj ()
 -{
 -    return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS;
 -}
 +# Header files are simply ignored.
 +sub lang_header_ignore { 1; }
  
 -# Rewrite a single header file.
 -sub lang_header_rewrite
 +# Vala '.vapi' are a kind of header files as well, and should
 +# not be processed into compilation rules.
- sub lang_vala_ignore
++sub lang_vala_ignore ($$$)
  {
 -    # Header files are simply ignored.
 -    return LANG_IGNORE;
 +    my ($directory, $base, $ext) = @_;
 +    return ($ext =~ m/\.vapi$/ ? 1 : 0);
  }
  
  # Rewrite a single Vala source file.
--sub lang_vala_rewrite
++sub lang_vala_rewrite ($$$)
  {
      my ($directory, $base, $ext) = @_;
 -
 -    (my $newext = $ext) =~ s/vala$/c/;
 -    return (LANG_SUBDIR, $newext);
 +    $ext =~ s/vala$/c/;
 +    return $ext;
  }
  
  # Rewrite a single yacc/yacc++ file.
--sub lang_yacc_rewrite
++sub lang_yacc_rewrite ($$$)
  {
      my ($directory, $base, $ext) = @_;
 -
 -    my $r = lang_sub_obj;
 -    (my $newext = $ext) =~ tr/y/c/;
 -    return ($r, $newext);
 +    $ext =~ tr/y/c/;
 +    return $ext;
 +}
- sub lang_yaccxx_rewrite { lang_yacc_rewrite (@_); };
++sub lang_yaccxx_rewrite ($$$)
++{
++  lang_yacc_rewrite (shift, shift, shift);
+ }
 -sub lang_yaccxx_rewrite { lang_yacc_rewrite (@_); };
  
  # Rewrite a single lex/lex++ file.
--sub lang_lex_rewrite
++sub lang_lex_rewrite ($$$)
  {
      my ($directory, $base, $ext) = @_;
 -
 -    my $r = lang_sub_obj;
 -    (my $newext = $ext) =~ tr/l/c/;
 -    return ($r, $newext);
 +    $ext =~ tr/l/c/;
 +    return $ext;
  }
--sub lang_lexxx_rewrite { lang_lex_rewrite (@_); };
 -
 -# Rewrite a single Java file.
 -sub lang_java_rewrite
++sub lang_lexxx_rewrite ($$$)
+ {
 -    return LANG_SUBDIR;
++  lang_lex_rewrite (shift, shift, shift);
+ }
  
  # The lang_X_finish functions are called after all source file
  # processing is done.  Each should handle defining rules for the
@@@ -4737,17 -5657,16 +4657,17 @@@ sub lang_vala_finish_target ($$
  # Add output rules to invoke valac and create stamp file as a witness
  # to handle multiple outputs. This function is called after all source
  # file processing is done.
- sub lang_vala_finish
+ sub lang_vala_finish ()
  {
    my ($self) = @_;
 +  my @names =
 +    (
 +      keys %known_programs,
 +      keys %known_libraries,
 +      keys %known_ltlibraries,
 +    );
  
 -  foreach my $prog (keys %known_programs)
 -    {
 -      lang_vala_finish_target ($self, $prog);
 -    }
 -
 -  while (my ($name) = each %known_libraries)
 +  foreach my $name (@names)
      {
        lang_vala_finish_target ($self, $name);
      }
@@@ -4821,10 -5740,10 +4741,10 @@@ sub lang_yacc_target_hook ($$$$%
              "$condstr${header}: $output\n"
              # Recover from removal of $header
              . "$condstr\t\@if test ! -f \$@; then rm -f $output; else :; fi\n"
 -            . "$condstr\t\@if test ! -f \$@; then \$(MAKE) \$(AM_MAKEFLAGS) $output; else :; fi\n";
 +            . "$condstr\t\@if test ! -f \$@; then \$(MAKE) $output; else :; fi\n";
          }
        # Distribute the generated file, unless its .y source was
-       # listed in a nodist_ variable.  (&handle_source_transform
+       # listed in a nodist_ variable.  (handle_source_transform()
        # will set DIST_SOURCE.)
        push_dist_common ($header)
          if $transform{'DIST_SOURCE'};
@@@ -4851,7 -5770,8 +4771,7 @@@ sub lang_lex_target_hook ($$$$%
      $clean_files{$output} = $transform{'DIST_SOURCE'} ? MAINTAINER_CLEAN : CLEAN;
  }
  
- sub lang_yacc_lex_finish
 -# This is a helper for both lex and yacc.
 -sub yacc_lex_finish_helper ()
++sub lang_yacc_lex_finish ()
  {
    return if defined $language_scratch{'lex-yacc-done'};
    $language_scratch{'lex-yacc-done'} = 1;
@@@ -5068,8 -6039,8 +4988,8 @@@ sub cond_stack_endif ($$$
  ## ------------------------ ##
  
  
- # &define_cond_variable ($VAR, $COND, $WHERE, @VALUE)
- # -----------------------------------------------------
 -# define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
++# define_cond_variable ($VAR, $COND, $WHERE, @VALUE)
+ # ----------------------------------------------------
  # Like define_variable, but the value is a list, and the variable may
  # be defined conditionally.  The second argument is the condition
  # under which the value should be defined; this should be the empty
@@@ -5137,13 -6110,14 +5057,13 @@@ sub define_compiler_variable ($
      my $libtool_tag = '';
      $libtool_tag = '--tag=' . $lang->libtool_tag . ' '
        if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
-     &define_variable ($var, INTERNAL, $value);
 -    define_variable ($var, $value, INTERNAL);
++    define_variable ($var, INTERNAL, $value);
      if (var ('LIBTOOL'))
        {
        my $verbose = define_verbose_libtool ();
-       &define_variable ("LT$var", INTERNAL,
-                         "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) "
-                         . "\$(LIBTOOLFLAGS) --mode=compile $value");
 -      define_variable ("LT$var",
 -                         "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS)"
 -                         . " \$(LIBTOOLFLAGS) --mode=compile $value",
 -                         INTERNAL);
++      define_variable ("LT$var", INTERNAL,
++                       "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) "
++                       . "\$(LIBTOOLFLAGS) --mode=compile $value");
        }
      define_verbose_tagvar ($lang->ccer || 'GEN');
  }
@@@ -5160,7 -6134,7 +5080,7 @@@ sub define_linker_variable ($
      $libtool_tag = '--tag=' . $lang->libtool_tag . ' '
        if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
      # CCLD = $(CC).
-     &define_variable ($lang->lder, INTERNAL, $lang->ld);
 -    define_variable ($lang->lder, $lang->ld, INTERNAL);
++    define_variable ($lang->lder, INTERNAL, $lang->ld);
      # CCLINK = $(CCLD) blah blah...
      my $link = '';
      if (var ('LIBTOOL'))
@@@ -5484,13 -6509,19 +5404,13 @@@ sub read_am_file ($$
  # ----------------------------
  # A helper for read_main_am_file which initializes configure variables
  # and variables from header-vars.am.
- sub define_standard_variables
+ sub define_standard_variables ()
  {
 -  my $saved_output_vars = $output_vars;
 -  my ($comments, undef, $rules) =
 -    file_contents_internal (1, "$libdir/am/header-vars.am",
 -                          new Automake::Location);
 -
    foreach my $var (sort keys %configure_vars)
      {
-       &define_configure_variable ($var);
+       define_configure_variable ($var);
      }
 -
 -  $output_vars .= $comments . $rules;
 +  $output_vars .= verbatim ('header-vars');
  }
  
  # Read main am file.
@@@ -5652,41 -6684,10 +5572,41 @@@ sub preprocess_file ($%
    return $_;
  }
  
 +# verbatim ($NAME)
 +# ----------------
 +# Load a "$libdir/am/$NAME.mk", stripping any '##'-style comment.  No
 +# extra parsing or post-processing is done (i.e., recognition of rules
 +# declaration or of make variables definitions).
 +# If used in scalar or list context, return the read makefile fragment.
 +# While if used in void context, append it to the '$output_verbatim'
 +# variable.
 +sub verbatim ($)
 +{
 +  my $name = shift;
 +  my $dir = "$config_aux_dir/am-ng";
 +  my $file = "$dir/$name.mk";
 +  my $text = slurp_makefile_fragment ("$libdir/am/$name.mk");
 +  mkdir ($dir, 0755) if ! -d $dir;
 +  my $fh = new Automake::XFile "> $file";
 +  verb "creating $file";
 +  print $fh $text;
 +  my $out = "include \@top_srcdir\@/$file\n";
 +  if (defined wantarray)
 +    {
 +      # Scalar or list context.
 +      return $out;
 +    }
 +  else
 +    {
 +      # Void context
 +      $output_verbatim .= $out;
 +      return;
 +    }
 +}
  
  # @PARAGRAPHS
- # &make_paragraphs ($MAKEFILE, [%TRANSFORM])
- # ------------------------------------------
+ # make_paragraphs ($MAKEFILE, [%TRANSFORM])
+ # -----------------------------------------
  # Load a $MAKEFILE, apply the %TRANSFORM, and return it as a list of
  # paragraphs.
  sub make_paragraphs ($%)
@@@ -6297,9 -7287,10 +6217,10 @@@ sub locate_aux_dir (
  }
  
  
- # &push_required_file ($DIR, $FILE, $FULLFILE)
- # --------------------------------------------------
- sub push_required_file
+ # push_required_file ($DIR, $FILE, $FULLFILE)
 -# -------------------------------------------------
++# -------------------------------------------
+ # Push the given file onto DIST_COMMON.
+ sub push_required_file ($$$)
  {
    my ($dir, $file, $fullfile) = @_;
  
@@@ -6492,13 -7483,15 +6413,13 @@@ sub required_file_check_or_copy ($$$
  }
  
  
- # &require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, @FILES)
- # --------------------------------------------------------------
 -# require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES)
 -# ---------------------------------------------------------------------
++# require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, @FILES)
++# -------------------------------------------------------------
  # Verify that the file must exist in $DIRECTORY, or install it.
  # $MYSTRICT is the strictness level at which this file becomes required.
 -# Worker threads may queue up the action to be serialized by the master,
 -# if $QUEUE is true
  sub require_file_internal ($$$@)
  {
 -  my ($where, $mystrict, $dir, $queue, @files) = @_;
 +  my ($where, $mystrict, $dir, @files) = @_;
  
    return
      unless $strictness >= $mystrict;
  sub require_file ($$@)
  {
      my ($where, $mystrict, @files) = @_;
 -    require_file_internal ($where, $mystrict, $relative_dir, 0, @files);
 +    require_file_internal ($where, $mystrict, $relative_dir, @files);
  }
  
- # &require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
- # -----------------------------------------------------------
+ # require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
+ # ----------------------------------------------------------
  sub require_file_with_macro ($$$@)
  {
      my ($cond, $macro, $mystrict, @files) = @_;
@@@ -6546,8 -7548,59 +6467,8 @@@ sub require_libsource_with_macro ($$$@
        }
  }
  
- # &require_conf_file ($WHERE, $MYSTRICT, @FILES)
- # ----------------------------------------------
 -# queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE,
 -#                                     $MYSTRICT, @FILES)
 -# --------------------------------------------------------------
 -sub queue_required_file_check_or_copy ($$$$@)
 -{
 -    my ($queue, $key, $dir, $where, $mystrict, @files) = @_;
 -    my @serial_loc;
 -    if (ref $where)
 -      {
 -        @serial_loc = (QUEUE_LOCATION, $where->serialize ());
 -      }
 -    else
 -      {
 -        @serial_loc = (QUEUE_STRING, $where);
 -      }
 -    $queue->enqueue ($key, $dir, @serial_loc, $mystrict, 0 + @files, @files);
 -}
 -
 -# require_queued_file_check_or_copy ($QUEUE)
 -# ------------------------------------------
 -sub require_queued_file_check_or_copy ($)
 -{
 -    my ($queue) = @_;
 -    my $where;
 -    my $dir = $queue->dequeue ();
 -    my $loc_key = $queue->dequeue ();
 -    if ($loc_key eq QUEUE_LOCATION)
 -      {
 -      $where = Automake::Location::deserialize ($queue);
 -      }
 -    elsif ($loc_key eq QUEUE_STRING)
 -      {
 -      $where = $queue->dequeue ();
 -      }
 -    else
 -      {
 -      prog_error "unexpected key $loc_key";
 -      }
 -    my $mystrict = $queue->dequeue ();
 -    my $nfiles = $queue->dequeue ();
 -    my @files;
 -    push @files, $queue->dequeue ()
 -      foreach (1 .. $nfiles);
 -    return
 -      unless $strictness >= $mystrict;
 -    foreach my $file (@files)
 -      {
 -        required_file_check_or_copy ($where, $config_aux_dir, $file);
 -      }
 -}
 -
+ # require_conf_file ($WHERE, $MYSTRICT, @FILES)
+ # ---------------------------------------------
  # Looks in configuration path, as specified by AC_CONFIG_AUX_DIR.
  sub require_conf_file ($$@)
  {
@@@ -6567,8 -7622,70 +6488,10 @@@ sub require_conf_file_with_macro ($$$@
  
  ################################################################
  
 -# Emit rules to create $DIRECTORY if needed, and return
 -# the file that any target requiring this directory should be made
 -# dependent upon.
 -# We don't want to emit the rule twice, and want to reuse it
 -# for directories with equivalent names (e.g., 'foo/bar' and './foo//bar').
 -sub require_build_directory ($)
 -{
 -  my $directory = shift;
 -
 -  return $directory_map{$directory} if exists $directory_map{$directory};
 -
 -  my $cdir = File::Spec->canonpath ($directory);
 -
 -  if (exists $directory_map{$cdir})
 -    {
 -      my $stamp = $directory_map{$cdir};
 -      $directory_map{$directory} = $stamp;
 -      return $stamp;
 -    }
 -
 -  my $dirstamp = "$cdir/\$(am__dirstamp)";
 -
 -  $directory_map{$directory} = $dirstamp;
 -  $directory_map{$cdir} = $dirstamp;
 -
 -  # Set a variable for the dirstamp basename.
 -  define_pretty_variable ('am__dirstamp', TRUE, INTERNAL, '.dirstamp');
 -
 -  # Directory must be removed by 'make distclean'.
 -  $clean_files{$dirstamp} = DIST_CLEAN;
 -
 -  $output_rules .= ("$dirstamp:\n"
 -                  . "\t\@\$(MKDIR_P) $directory\n"
 -                  . "\t\@: > $dirstamp\n");
 -
 -  return $dirstamp;
 -}
 -
 -# require_build_directory_maybe ($FILE)
 -# -------------------------------------
 -# If $FILE lies in a subdirectory, emit a rule to create this
 -# directory and return the file that $FILE should be made
 -# dependent upon.  Otherwise, just return the empty string.
 -sub require_build_directory_maybe ($)
 -{
 -    my $file = shift;
 -    my $directory = dirname ($file);
 -
 -    if ($directory ne '.')
 -    {
 -      return require_build_directory ($directory);
 -    }
 -    else
 -    {
 -      return '';
 -    }
 -}
 -
 -################################################################
 -
 -# Push a list of files onto dist_common.
+ # require_build_directory ($DIRECTORY)
+ # ------------------------------------
- sub push_dist_common
 +# Push a list of files onto @dist_common.
+ sub push_dist_common (@)
  {
    prog_error "push_dist_common run after handle_dist"
      if $handle_dist_run;
diff --cc bootstrap.sh
index 957c89f3abffed20d2ad028ebf79ba430781c890,6e49d278fe19b3357b8c21a33409745ace6bda12..1a7029b09c5a4ebcc6a23750d129f66932fbf0f8
@@@ -91,16 -91,17 +91,17 @@@ dosubst automake-$APIVERSION/Automake/C
  # Overwrite amversion.m4.
  dosubst m4/amversion.in m4/amversion.m4
  
- # Create temporary replacement for automake.
- dosubst automake.in automake.tmp
+ # Create temporary replacement for aclocal and automake.
+ for p in aclocal automake; do
+   dosubst $p.in $p.tmp
+   $PERL -w lib/gen-perl-protos $p.tmp > $p.tmp2
+   mv -f $p.tmp2 $p.tmp
+ done
  
  # Create required makefile snippets.
 -$PERL ./gen-testsuite-part > t/testsuite-part.tmp
 -chmod a-w t/testsuite-part.tmp
 -mv -f t/testsuite-part.tmp t/testsuite-part.am
 +$PERL ./gen-testsuite-part > testsuite-autodeps.tmp
 +chmod a-w testsuite-autodeps.tmp
 +mv -f testsuite-autodeps.tmp testsuite-autodeps.am
  
  # Run the autotools.  Bail out if any warning is triggered.
  # Use '-I' here so that our own *.m4 files in m4/ gets included,
index 9736e65a5f33e2ad3ef3628069e7897c9a229b9f,263e0ccb33642dc2243574dc184e943df223484f..71415f6ffad5b7e24c69fdb161740b7a4aa67d22
@@@ -8660,7 -8696,12 +8660,6 @@@ Generate a zip archive of the distribut
  
  @end table
  
 -The rule @code{dist} (and its historical synonym @code{dist-all})
 -will create archives in all the enabled formats (@pxref{List of
 -Automake options} for how to change this list).  By default, only
 -the @code{dist-gzip} target is hooked to @code{dist}.
 -
--
  @node Tests
  @chapter Support for test suites
  
diff --cc m4/init.m4
index d8166e72cca689a85ef8285866ded1971b3ad1aa,f9b0965d85368a807565fc32ae8347b482ecc11b..afae4545f2ba6bd8ff7038cebaebe08e92aee9f4
@@@ -99,8 -104,62 +99,50 @@@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX]
                  [m4_define([AC_PROG_OBJCXX],
                             m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
  ])
- AC_REQUIRE([AM_SILENT_RULES])])
+ AC_REQUIRE([AM_SILENT_RULES])dnl
 -dnl The testsuite driver may need to know about EXEEXT, so add the
 -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
 -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 -AC_CONFIG_COMMANDS_PRE(dnl
 -[m4_provide_if([_AM_COMPILER_EXEEXT],
 -  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+ # POSIX will say in a future version that running "rm -f" with no argument
+ # is OK; and we want to be able to make that assumption in our Makefile
+ # recipes.  So use an aggressive probe to check that the usage we want is
+ # actually supported "in the wild" to an acceptable degree.
+ # See automake bug#10828.
+ # To make any issue more visible, cause the running configure to be aborted
+ # by default if the 'rm' program in use doesn't match our expectations; the
+ # user can still override this though.
+ if rm -f && rm -fr && rm -rf; then : OK; else
+   cat >&2 <<'END'
+ Oops!
+ Your 'rm' program seems unable to run without file operands specified
+ on the command line, even when the '-f' option is present.  This is contrary
+ to the behaviour of most rm programs out there, and not conforming with
+ the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+ Please tell bug-automake@gnu.org about your system, including the value
+ of your $PATH and any error possibly output before this message.  This
+ can help us improve future automake versions.
+ END
+   if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+     echo 'Configuration will proceed anyway, since you have set the' >&2
+     echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+     echo >&2
+   else
+     cat >&2 <<'END'
+ Aborting the configuration process, to ensure you take notice of the issue.
+ You can download and install GNU coreutils to get an 'rm' implementation
+ that behaves properly: <http://www.gnu.org/software/coreutils/>.
+ If you want to complete the configuration process using your problematic
+ 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+ to "yes", and re-run configure.
+ END
+     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+   fi
+ fi])
  
 -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 -dnl mangled by Autoconf and run in a shell conditional statement.
 -m4_define([_AC_COMPILER_EXEEXT],
 -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 -
  dnl We have to redefine AC_PROG_CC to allow our compile rules to use
  dnl "-c -o" together also with losing compilers.
  dnl FIXME: Add references to the original discussion and bug report.
Simple merge
Simple merge
Simple merge
diff --cc t/lisp-flags.sh
Simple merge
index 398faf4db1028a11b4e2db1de663f6d121d98760,245d3e02b74d52eaf98ccc512074424d3c8ebe15..d36ac16751eb1d64bd2a5be0c284cd7bee86c299
@@@ -25,12 -28,15 +28,15 @@@ EN
  
  cat > Makefile.am << 'END'
  info_TEXINFOS = textutils.texi subdir/main.texi
- test: distdir
+ test-dist: distdir
+       test -f $(distdir)/textutils.info
+       test -f $(distdir)/subdir/main.info
 -      @echo DISTFILES = $(DISTFILES)
 -      @case '$(DISTFILES)' in \
 +      @echo am.dist.all-files = $(am.dist.all-files)
 +      @case '$(am.dist.all-files)' in \
-           *'~'*|*'.bak'*) exit 1;; \
+            *'~'*|*'.bak'*|*'.info-'*|*.i[0-9]*) exit 1;; \
 -           *) exit 0;; \
 -         esac
 +          *) exit 0;; \
 +        esac
        @st=0; \
         find $(distdir) | grep '~' && st=1; \
         find $(distdir) | grep '\.bak' && st=1; \