texi: require Texinfo >= 4.9, related enhancements
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 17 Jun 2012 10:23:18 +0000 (12:23 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 20 Jun 2012 08:37:33 +0000 (10:37 +0200)
commit205c7572497789676bea3167b9cdeede69236a16
tree781af51a459742765d4f401c5b8898d7399cab92
parentffe04c8d92d775712e6e574103215eb863adfb29
texi: require Texinfo >= 4.9, related enhancements

We start passing the '--build-dir' option to the texi2dvi and texi2pdf
invocations done in our Texinfo-related rules.  The argument for this
option will be specific for each info_TEXINFOS entry, to work around a
texi2dvi bug that could otherwise cause racy failures in parallel make
builds:
<http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html>
That bug seems already fixed in the development version of texi2dvi,
though:
<http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00074.html>
so the details of our '--build-dir' usage can be revisited once we can
assume Texinfo 5.0 or later.

Since the '--build-dir' options has been only supported since Texinfo
4.9, we lose compatibility with all older Texinfo versions.

But we also get some real improvements.

First, the '--build-dir' option implies the '--tidy' option; this, like
the '--clean' option that we were formerly using, prevents cluttering of
the build directory with all the TeX and Texinfo auxiliary files and
build by-products, but, differently from '--clean', keeps them around
for later re-runs to use; this shortens the rebuild times considerably.

Second, the use of '--build-dir' also allows us to specify different
build directories for the PDF and DVI output, preventing the rules
building them from stomping on each other's feet when run in parallel.
This is demonstrated by the test cases 'txinfo-no-clutter.sh' and
'txinfo33.sh', which before this change used to fail when run with
MAKE="make -j4", but now succeed even in that case.

* NEWS: Update.
* lib/am/texibuilds.am: Do not try to avoid texi2dvi/texi2pdf option
'-o'; it has been supported since Texinfo 4.1, and we now require
Texinfo >= 4.9.  Remove an obsolete comment.  Modify calls to texi2dvi
and texi2pdf to use the '--build-dir' option, so that TeX auxiliary
files and build by-products for a 'foo.texi' input will be placed in
a 'foo.t2d' directory (for texi2dvi) or in a 'foo.t2p' directory (for
texi2pdf).
* automake.in (scan_texinfo_file): Greatly simplify the implementation,
since we don't need anymore to keep track of the TeX auxiliary files and
build by-products to clean.  Drop the '@CLEAN_FILES' part of the return
value.
(handle_texinfo_helper): Adjust the 'scan_texinfo_file()' call to its
new signature.  Append the "work directories" now created by texi2dvi
and texi2pdf invocation to the list of files/directories removed upon
"make mostlyclean".
* lib/am/texinfos.am: Update the cleaning rules (and comments)
accordingly.
* t/txinfo-no-clutter.sh: Minimal adjustment to avoid spurious failures.
* .gitignore: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
.gitignore
NEWS
automake.in
lib/am/texibuild.am
lib/am/texinfos.am
t/txinfo-no-clutter.sh