Subject: bug#9506: makeinfo in VPATH builds fails

From: Stefano Lattarini <[email-masked]>
Date: Thu, 15 Sep 2011 11:42:26 +0200

tags 9506 wontfix
close 9506
thanks

Hi Sebastian, thanks for the bug report.

On Wednesday 14 September 2011, Sebastian Freundt wrote:
> Package: automake
> Version: 1.11a
> 
> VPATH build of a project using makeinfo fails if $(srcdir) isn't writable.
>
Yes, this is a consequence of the fact that `.info' files are "preferably"
generated in the srcdir; the comments in automake explain in great detail
why and how this is done:

  # Until Automake 1.6.3, .info files were built in the source tree.
  # This was an obstacle to the support of non-distributed `.info'
  # files, and non-distributed `.texi' files
  #
  # [SNIP]
  #
  # Back to the point, it should be clear that in order to support
  # non-distributed .info files, we need to build them in the build
  # tree, not in the source tree.  In Automake 1.7 .info build rules
  # have been largely cleaned up so that .info files get always build
  # in the build tree, even when distributed.  The idea was that
  #   (1) if during a VPATH build the .info file was found to be
  #       absent or out-of-date (in the source tree or in the
  #       build tree), Make would rebuild it in the build tree.
  #       If an up-to-date source-tree of the .info file existed,
  #       make would not rebuild it in the build tree.
  #   (2) having two copies of .info files, one in the source tree
  #       and one (newer) in the build tree is not a problem because
  #       `make dist' always pick files in the build tree first.
  #
  # However it turned out the be a bad idea for several reasons:
  #   * Tru64, OpenBSD, and FreeBSD (not NetBSD) Make do not behave
  #     like GNU Make on point (1) above.  These implementations
  #     of Make would always rebuild .info files in the build
  #     tree, even if such files were up to date in the source
  #     tree.  Consequently, it was impossible to perform a VPATH
  #     build of a package containing Texinfo files using these
  #     Make implementations.
  #     (Refer to the Autoconf Manual, section "Limitation of
  #     Make", paragraph "VPATH", item "target lookup", for an
  #     account of the differences between these implementations.)
  #   * The GNU Coding Standards require these files to be built
  #     in the source-tree (when they are distributed, that is).
  #   * Keeping a fresher copy of distributed files in the
  #     build tree can be annoying during development because
  #     - if the files is kept under CVS, you really want it to be
  #       updated in the source tree
  #     - it is confusing that `make distclean' does not erase all
  #       files in the build tree.
  #
  # Consequently, starting with Automake 1.8, .info files are
  # built in the source tree again.  Because we still plan to
  # support non-distributed .info files at some point, we
  # have a single variable ($INSRC) that controls whether
  # the current .info file must be built in the source tree
  # or in the build tree.  Actually this variable is switched
  # off for .info files that appear to be cleaned; this is
  # for backward compatibility with package such as Texinfo ...
  #
  # [SNIP]

The main point is that if you're distributing you `.info' files, you should
ensure that they are *not* rebuilt when building from a distribution tarball
(as that would wreak havoce with at least FreeBSD make).  OTOH, if you *want*
them to be rebuilt, you should *not* distribute them, and *also* add them to
CLEANFILES; in this case automake will build them in the buiilddir (if it
doesn't, than that's a bug we should fix ASAP).

I've marked this bug closed as "wontfix", but feel free to continue the
discussion here if you have further doubts to clarify or ideas to contribute.

Regards,
  Stefano