Such support is seldom used, and will get in the way of future, useful refactorings. We can still re-introduce it at a later time, after the dust is settled, and if there are users' requests in this direction.
* automake.in (scan_texinfo_file): Error out if a input '.texi' file specifies an output (in the '@setfilename' directive) that doesn't have a '.info' extension. (output_texinfo_build_rules): Simplify, by assuming generated info files ought to have the '.info' extension. * lib/am/texibuild.am: Likewise. * t/txinfo3.sh: Remove as obsolete. * t/txinfo-unrecognized-extension-2.sh: New test. * t/primary-prefix-valid-couples.sh: Adjust to avoid spurious failures. * t/txinfo17.sh: Likewise. * t/txinfo20.sh: Likewise. * t/vtexi2.sh: Likewise. * t/mdate2.sh: Likewise. Signed-off-by: Stefano Lattarini <[email protected]> --- automake.in | 2 +- lib/am/texibuild.am | 10 ++--- t/mdate2.sh | 2 +- t/primary-prefix-valid-couples.sh | 2 +- t/txinfo-unrecognized-extension-2.sh | 38 ++++++++++++++++++ t/txinfo17.sh | 4 +- t/txinfo20.sh | 22 ++++++----- t/txinfo3.sh | 72 ---------------------------------- t/vtexi2.sh | 2 +- 9 files changed, 61 insertions(+), 93 deletions(-) create mode 100755 t/txinfo-unrecognized-extension-2.sh delete mode 100755 t/txinfo3.sh diff --git a/automake.in b/automake.in index 45f70eb..dbff5a8 100644 --- a/automake.in +++ b/automake.in @@ -2796,7 +2796,7 @@ sub scan_texinfo_file ($) next if $outfile; $outfile = $1; - if ($outfile =~ /\.([^.]+)$/ && $1 ne 'info') + if ($outfile !~ /\.info$/) { error ("$filename:$.", "output '$outfile' has unrecognized extension"); diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am index 349ef7a..dad84f3 100644 --- a/lib/am/texibuild.am +++ b/lib/am/texibuild.am @@ -14,7 +14,7 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see <http://www.gnu.org/licenses/>. -%%DEST_SUFFIX%: %%SOURCE_SUFFIX% +%.info: %%SOURCE_SUFFIX% $(if $(am__info_insrc),,@$(am__ensure_target_dir_exists)) ## Back up the info files before running makeinfo. This is the cheapest ## way to ensure that @@ -48,7 +48,7 @@ fi; \ rm -rf $$backupdir; exit $$rc -INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX% +INFO_DEPS += %DEST_INFO_PREFIX%.info %.dvi: %%SOURCE_SUFFIX% %AM_V_TEXI2DVI%$(am__ensure_target_dir_exists) && \ @@ -100,14 +100,14 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX% exit 1; \ fi -%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS% -?INSRC?%DEST_INFO_PREFIX%%DEST_SUFFIX%: am__info_insrc=yes +%DEST_INFO_PREFIX%.info: %SOURCE_REAL% %DEPS% +?INSRC?%DEST_INFO_PREFIX%.info: am__info_insrc=yes %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS% %DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS% %DEST_PREFIX%.html: %SOURCE_REAL% %DEPS% -%DEST_INFO_PREFIX%%DEST_SUFFIX% \ +%DEST_INFO_PREFIX%.info \ %DEST_PREFIX%.dvi \ %DEST_PREFIX%.pdf \ %DEST_PREFIX%.html \ diff --git a/t/mdate2.sh b/t/mdate2.sh index 093de5e..ef08121 100755 --- a/t/mdate2.sh +++ b/t/mdate2.sh @@ -29,7 +29,7 @@ END # Required when using Texinfo. : > texinfo.tex : > mdate-sh -echo '@setfilename textutils' > textutils.texi +echo '@setfilename textutils.info' > textutils.texi # Use "././" to confuse Automake into thinking this is a subdir build. $ACLOCAL diff --git a/t/primary-prefix-valid-couples.sh b/t/primary-prefix-valid-couples.sh index 989ca4b..df21c6b 100755 --- a/t/primary-prefix-valid-couples.sh +++ b/t/primary-prefix-valid-couples.sh @@ -38,7 +38,7 @@ AC_DEFUN([AC_PROG_LIBTOOL], END # Other required files. -echo '@setfilename foo' > foo.texi +echo '@setfilename foo.info' > foo.texi : > texinfo.tex : > py-compile : > elisp-comp diff --git a/t/txinfo-unrecognized-extension-2.sh b/t/txinfo-unrecognized-extension-2.sh new file mode 100755 index 0000000..9c28cd8 --- /dev/null +++ b/t/txinfo-unrecognized-extension-2.sh @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (C) 2012 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Test that automake complains properly when texinfo input files +# specify output info files with an invalid extension. + +. ./defs || Exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = foo.texi bar.texi baz.texi +END + +echo '@setfilename foo.inf' > foo.texi +echo '@setfilename bar' > bar.texi +echo '@setfilename baz.texi' > baz.texi +: > texinfo.tex + +$ACLOCAL +AUTOMAKE_fails + +grep "foo\.texi:.* 'foo.inf'.*unrecognized extension" stderr +grep "bar\.texi:.* 'bar'.*unrecognized extension" stderr +grep "baz\.texi:.* 'baz.texi'.*unrecognized extension" stderr + +: diff --git a/t/txinfo17.sh b/t/txinfo17.sh index a1fc0ec..f743853 100755 --- a/t/txinfo17.sh +++ b/t/txinfo17.sh @@ -24,7 +24,7 @@ info_TEXINFOS = texinfo.texi END cat > texinfo.texi << 'END' -@setfilename texinfo +@setfilename texinfo.info ... @verbatim @setfilename foobar.info @@ -36,6 +36,6 @@ $ACLOCAL $AUTOMAKE --add-missing grep 'foobar' Makefile.in && Exit 1 -grep 'texinfo:' Makefile.in +grep 'texinfo\.info:' Makefile.in : diff --git a/t/txinfo20.sh b/t/txinfo20.sh index 5c07880..98c044e 100755 --- a/t/txinfo20.sh +++ b/t/txinfo20.sh @@ -29,7 +29,7 @@ mkdir sub cat > main.texi << 'END' \input texinfo -@setfilename main +@setfilename main.info @settitle main @node Top Hello walls. @@ -46,15 +46,15 @@ $AUTOCONF $MAKE # Feign more info files. -: > main-1 -: > sub/main-1 +: > main.info-1 +: > sub/main.info-1 # Break main.texi. $sleep cp main.texi main.old cat > main.texi << 'END' \input texinfo -@setfilename main +@setfilename main.info @settitle main @node Top @unknown_macro{Hello walls.} @@ -63,14 +63,16 @@ END # makeinfo will bail out, but we should conserve the old info files. $MAKE && Exit 1 -test -f main -test -f main-1 +test -f main.info +test -f main.info-1 # Restore main.texi, and break sub/main.texi. cp main.texi sub/main.texi mv main.old main.texi $MAKE && Exit 1 -test -f main -test ! -f main-1 -test -f sub/main -test -f sub/main-1 +test -f main.info +test ! -f main.info-1 +test -f sub/main.info +test -f sub/main.info-1 + +: diff --git a/t/txinfo3.sh b/t/txinfo3.sh deleted file mode 100755 index 7363c39..0000000 --- a/t/txinfo3.sh +++ /dev/null @@ -1,72 +0,0 @@ -#! /bin/sh -# Copyright (C) 1997-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Test to make sure .info-less @setfilename works. - -required='makeinfo tex texi2dvi' -. ./defs || Exit 1 - -cat >> configure.ac << 'END' -AC_OUTPUT -END - -cat > Makefile.am << 'END' -info_TEXINFOS = textutils.texi doc/automake-ng.texi -.PHONY: echo-info-deps -echo-info-deps: - echo ' ' $(INFO_DEPS) ' ' -END - -cat > textutils.texi <<EOF -\input texinfo -@setfilename textutils -@settitle main -@node Top -Hello walls. -@bye -EOF - -mkdir doc -cat > doc/automake-ng.texi <<EOF -\input texinfo -@setfilename automake-ng -@settitle automake-ng -@node Top -Blurb. -@bye -EOF - -$ACLOCAL -$AUTOCONF -$AUTOMAKE --add-missing - -./configure -$MAKE distcheck - -$MAKE -test -f textutils -test -f doc/automake-ng -test ! -f textutils.info -test ! -f doc/automake-ng.info - -$MAKE distdir -test -f $distdir/textutils -test -f $distdir/doc/automake-ng - -$MAKE echo-info-deps | grep '[ /]textutils ' -$MAKE echo-info-deps | grep '[ /]doc/automake-ng ' - -: diff --git a/t/vtexi2.sh b/t/vtexi2.sh index 18f1e9e..8cde8c4 100755 --- a/t/vtexi2.sh +++ b/t/vtexi2.sh @@ -26,7 +26,7 @@ info_TEXINFOS = zardoz.texi END cat > zardoz.texi << 'END' -@setfilename zardoz +@setfilename zardoz.info @include version.texi END -- 1.7.9.5
