No semantic change is intended.
* lib/am/texibuild.am: Use a make-runtime $(foreach) loop to define the
conversion rules for all the accepted Texinfo suffixes ('.txi', '.texi',
'.texinfo'), with the help of ...
(am__texi_rules_for_suffix): ... this new internal make function.
* automake.in (handle_texinfo): Adjust.
* t/txinfo6.sh: Adjust and extend.
* t/txinfo-rules-once.sh: Remove as obsolete.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
define_verbose_texinfo;
# Keep this list in sync with the $infobase transform done
# in &handle_texinfo_helper.
- foreach my $valid_texinfo_suf (qw/texi texinfo txi/)
- {
- $output_verbatim .= preprocess_file (
- "$libdir/am/texibuild.am",
- AM_V_MAKEINFO => verbose_flag('MAKEINFO'),
- AM_V_TEXI2DVI => verbose_flag('TEXI2DVI'),
- AM_V_TEXI2PDF => verbose_flag('TEXI2PDF'),
- TEXIQUIET => verbose_flag('texinfo'),
- TEXIDEVNULL => verbose_flag('texidevnull'),
- 'TEXI-SUFFIX' => $valid_texinfo_suf
- );
- }
+ my @valid_texinfo_suffixes = qw/texi texinfo txi/;
+ $output_verbatim .= preprocess_file (
+ "$libdir/am/texibuild.am",
+ AM_V_MAKEINFO => verbose_flag('MAKEINFO'),
+ AM_V_TEXI2DVI => verbose_flag('TEXI2DVI'),
+ AM_V_TEXI2PDF => verbose_flag('TEXI2PDF'),
+ TEXIQUIET => verbose_flag('texinfo'),
+ TEXIDEVNULL => verbose_flag('texidevnull'),
+ 'TEXI-SUFFIXES' => "@valid_texinfo_suffixes",
+ );
($mostlyclean, $clean, $maintclean) = handle_texinfo_helper ($info_texinfos);
chomp $mostlyclean;
chomp $clean;
fi
endef
-%.info: %.%TEXI-SUFFIX%
- $(call am__texibuild_info,$(am__info_insrc))
-
-%.dvi: %.%TEXI-SUFFIX%
- $(call am__texibuild_dvi_or_pdf,%AM_V_TEXI2DVI%,$(TEXI2DVI))
-
-%.pdf: %.%TEXI-SUFFIX%
- $(call am__texibuild_dvi_or_pdf,%AM_V_TEXI2PDF%,$(TEXI2PDF))
+define am__texi_rules_for_suffix
+%.info: %.$1
+ $$(call am__texibuild_info,$$(am__info_insrc))
+%.dvi: %.$1
+ $$(call am__texibuild_dvi_or_pdf,$$(AM_V_TEXI2DVI),$$(TEXI2DVI))
+%.pdf: %.$1
+ $$(call am__texibuild_dvi_or_pdf,$$(AM_V_TEXI2PDF),$$(TEXI2PDF))
+%.html: %.$1
+ $$(am__texibuild_html)
+endef
-%.html: %.%TEXI-SUFFIX%
- $(am__texibuild_html)
+$(foreach s,%TEXI-SUFFIXES%,$(eval $(call am__texi_rules_for_suffix,$s)))
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2003-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/>.
-
-# Some grepping checks on Texinfo support.
-
-. ./defs || Exit 1
-
-echo AC_OUTPUT >> configure.ac
-
-$ACLOCAL
-
-: > texinfo.tex
-
-echo info_TEXINFOS = main.texi other.texi sub/x.texi > Makefile.am
-mkdir sub
-echo @setfilename main.info > main.texi
-echo @setfilename other.info > other.texi
-echo @setfilename sub/x.info > sub/x.texi
-$AUTOMAKE
-$EGREP '\.(info|texi)' Makefile.in # For debugging.
-test $(grep -c '^%\.info: %\.texi$' Makefile.in) -eq 1
-
-:
# 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 '.txi' extension works.
+# Make sure '.txi' and '.texinfo' are accepted Texinfo extensions.
. ./defs || Exit 1
-cat > Makefile.am << 'END'
-info_TEXINFOS = foo.txi
-END
+echo AC_OUTPUT >> configure.ac
+echo info_TEXINFOS = foo.txi doc/bar.texinfo > Makefile.am
+mkdir doc
echo '@setfilename foo.info' > foo.txi
+echo '@setfilename bar.info' > doc/bar.texinfo
: > texinfo.tex
$ACLOCAL
+$AUTOCONF
$AUTOMAKE
-grep '^%\.info: %\.txi$' Makefile.in
+./configure
+
+for fmt in info pdf dvi html; do
+ $MAKE -n "$fmt" > stdout || { cat stdout; Exit 1; }
+ cat stdout
+ for basename in foo doc/bar; do
+ grep "[/ $tab]$basename\\.$fmt[; $tab]" stdout
+ done
+done
: