diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | NEWS | 10 | ||||
-rw-r--r-- | automake.in | 49 | ||||
-rw-r--r-- | lib/am/texibuild.am | 32 | ||||
-rw-r--r-- | lib/am/texinfos.am | 11 | ||||
-rwxr-xr-x | t/txinfo-no-clutter.sh | 3 |
6 files changed, 47 insertions, 60 deletions
diff --git a/.gitignore b/.gitignore index 130b39004..df004ba9e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,8 @@ /doc/automake*.dvi /doc/automake*.pdf /doc/automake*.ps +/doc/automake*.t2d/ +/doc/automake*.t2p/ /doc/automake*.1 /doc/aclocal*.1 /doc/stamp-vti @@ -4,6 +4,9 @@ New in 1.13: - Autoconf 2.65 or greater is required. + - The rules to build PDF and DVI output from Texinfo input now + requires Texinfo 4.9 or later. + * Obsolete features removed: - Use of the long-deprecated two- and three-arguments invocation forms @@ -56,6 +59,13 @@ New in 1.13: backward-compatibility only. In particular, its use does not disable the warnings in the 'portability-recursive' category anymore. +* Texinfo Support: + + - The rules to build PDF and DVI files from Texinfo input now use the + ' --build-dir' option, to keep the auxiliary files used by texi2dvi + and texi2pdf around without cluttering the build directory, and to + make it possible to run the "dvi" and "pdf" recipes in parallel. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 1.12.2: diff --git a/automake.in b/automake.in index 3f869b234..11e750d5a 100644 --- a/automake.in +++ b/automake.in @@ -2975,35 +2975,15 @@ sub handle_scripts ## Handling Texinfo files. ## ## ------------------------ ## -# ($OUTFILE, $VFILE, @CLEAN_FILES) +# ($OUTFILE, $VFILE) # &scan_texinfo_file ($FILENAME) # ------------------------------ # $OUTFILE - name of the info file produced by $FILENAME. # $VFILE - name of the version.texi file used (undef if none). -# @CLEAN_FILES - list of byproducts (indexes etc.) sub scan_texinfo_file ($) { my ($filename) = @_; - # Some of the following extensions are always created, no matter - # whether indexes are used or not. Other (like cps, fns, ... pgs) - # are only created when they are used. We used to scan $FILENAME - # for their use, but that is not enough: they could be used in - # included files. We can't scan included files because we don't - # know the include path. Therefore we always erase these files, no - # matter whether they are used or not. - # - # (tmp is only created if an @macro is used and a certain e-TeX - # feature is not available.) - my %clean_suffixes = - map { $_ => 1 } (qw(aux log toc tmp - cp cps - fn fns - ky kys - vr vrs - tp tps - pg pgs)); # grep 'new.*index' texinfo.tex - my $texi = new Automake::XFile "< $filename"; verb "reading $filename"; @@ -3031,23 +3011,6 @@ sub scan_texinfo_file ($) { $vfile = $1; } - - # Try to find new or unused indexes. - - # Creating a new category of index. - elsif (/^\@def(code)?index (\w+)/) - { - $clean_suffixes{$2} = 1; - $clean_suffixes{"$2s"} = 1; - } - - # Merging an index into an another. - elsif (/^\@syn(code)?index (\w+) (\w+)/) - { - delete $clean_suffixes{"$2s"}; - $clean_suffixes{"$3s"} = 1; - } - } if (! $outfile) @@ -3058,8 +3021,7 @@ sub scan_texinfo_file ($) my $infobase = basename ($filename); $infobase =~ s/\.te?xi(nfo)?$//; - return ($outfile, $vfile, - map { "$infobase.$_" } (sort keys %clean_suffixes)); + return ($outfile, $vfile); } @@ -3199,10 +3161,13 @@ sub handle_texinfo_helper ($) # If 'version.texi' is referenced by input file, then include # automatic versioning capability. - my ($out_file, $vtexi, @clean_files) = + my ($out_file, $vtexi) = scan_texinfo_file ("$relative_dir/$texi") or next; - push (@mostly_cleans, @clean_files); + # Directory of auxiliary files and build by-products used by texi2dvi + # and texi2pdf. + push @mostly_cleans, "$relative_dir/$infobase.t2d"; + push @mostly_cleans, "$relative_dir/$infobase.t2p"; # If the Texinfo source is in a subdirectory, create the # resulting info in this subdirectory. If it is in the current diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am index f77748a3e..0fe09b1f9 100644 --- a/lib/am/texibuild.am +++ b/lib/am/texibuild.am @@ -65,14 +65,18 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX% ## Must set MAKEINFO like this so that version.texi will be found even ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%). MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \ -## Do not use '-o' unless necessary: it is only supported since Texinfo 4.1. ## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead. ## We still want -q (%TEXIQUIET%) because it turns on batch mode. -## Use '--clean' to avoid leaving auxiliary files behind cluttering the build -## directory (see automake bug#11146). We should start using '--tidy' when we -## can assume Texinf 4.9 or later. -?GENERIC? $(TEXI2DVI) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL% -?!GENERIC? $(TEXI2DVI) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL% +## Use '--build-dir' so that TeX and Texinfo auxiliary files and build +## by-products are left in there, instead of cluttering the current +## directory (see automake bug#11146). Use a different build-dir for +## each file (and distinct from that of the corresponding PDF file) to +## avoid hitting a Texinfop bug that could cause low-probability racy +## failure when doing parallel builds; see: +## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html + $(TEXI2DVI) %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \ +?GENERIC? %SOURCE% +?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% ?GENERIC?%SOURCE_SUFFIX%.pdf: ?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP% @@ -80,14 +84,18 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX% ## Must set MAKEINFO like this so that version.texi will be found even ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%). MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \ -## Do not use '-o' unless necessary: it is only supported since Texinfo 4.1. ## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead. ## We still want -q (%TEXIQUIET%) because it turns on batch mode. -## Use '--clean' to avoid leaving auxiliary files behind cluttering the build -## directory (see automake bug#11146). We should start using '--tidy' when we -## can assume Texinf 4.9 or later. -?GENERIC? $(TEXI2PDF) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL% -?!GENERIC? $(TEXI2PDF) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL% +## Use '--build-dir' so that TeX and Texinfo auxiliary files and build +## by-products are left in there, instead of cluttering the current +## directory (see automake bug#11146). Use a different build-dir for +## each file (and distinct from that of the corresponding DVI file) to +## avoid hitting a Texinfop bug that could cause low-probability racy +## failure when doing parallel builds; see: +## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html + $(TEXI2PDF) %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \ +?GENERIC? %SOURCE% +?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% ?GENERIC?%SOURCE_SUFFIX%.html: ?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP% diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am index e78cdede6..6d45c950a 100644 --- a/lib/am/texinfos.am +++ b/lib/am/texinfos.am @@ -386,13 +386,14 @@ if %?LOCAL-TEXIS% .PHONY: mostlyclean-aminfo mostlyclean-aminfo: ## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also -## contain any directory created by "makeinfo --html". +## contain any directory created by "makeinfo --html", as well as the +## '*.t2d' and '*.t2p' directories used by texi2dvi and texi2pdf. -rm -rf %MOSTLYCLEAN% .PHONY clean-am: clean-aminfo clean-aminfo: -## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also -## contain any directory created by "makeinfo --html". +## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo' +## above for details. ?TEXICLEAN? -test -z "%TEXICLEAN%" \ ?TEXICLEAN? || rm -rf %TEXICLEAN% @@ -404,8 +405,8 @@ maintainer-clean-aminfo: echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done -## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also -## contain any directory created by "makeinfo --html". +## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo' +## above for details. ?MAINTCLEAN? -test -z "%MAINTCLEAN%" \ ?MAINTCLEAN? || rm -rf %MAINTCLEAN% diff --git a/t/txinfo-no-clutter.sh b/t/txinfo-no-clutter.sh index ae5e9f2d1..7c7856f0d 100755 --- a/t/txinfo-no-clutter.sh +++ b/t/txinfo-no-clutter.sh @@ -93,7 +93,8 @@ for fmt in info pdf ps dvi html all; do $MAKE $fmt ls -l . sub # For debugging. ls -d foo* baz* sub/bar* > lst - $EGREP -v '^(foo|sub/bar|baz)\.(texi|dvi|ps|pdf|html|info)$' lst && Exit 1 + $EGREP -v '^(foo|sub/bar|baz)\.(texi|dvi|ps|pdf|html|info|t2[dp])$' \ + lst && Exit 1 $MAKE clean done |