See automake bug#13351 and bug#12320.
Automake-generated recipes have for a long time supported "split"
info files:
http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Tag-and-Split-Files
When I asked the rationale for this feature:
http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00015.html
Karl Berry confirmed that the reason for its existence was indeed
"efficiency, especially memory size":
http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html
He also added that "The Elisp manual is one of the largest ones around.
Looks like it would be maybe 3.5mb as one file." Not in any way big by
modern standards.
OTOH, it appears that the use of split info files (at least in the way
they have been handled by Automake-generated rules for a long time) can
cause real problems in some (admittedly quite corner-case) situations:
http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3963
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12320
So we now follow suit with Automake-NG (see commit
v1.12.2-901-gdd603e2,
<http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
and have Automake-generated makefiles pass the '--no-split' option
unconditionally to makeinfo invocations.
This allow some nice simplifications in our Texinfo recipes, and offer
an automatic fix for bug#12320.
Another *very* good aspect of such a change is that it should be 100%
transparent to the Automake users.
* lib/am/texinfos.am: Simplify moderately.
* lib/am/texibuild.am: Simplify greatly the recipe for the creation
of info files.
* t/txinfo-makeinfo-error-no-clobber.sh: Adjust.
* t/txinfo-no-split.sh: New test.
* t/list-of-tests.mk: Add it.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
## should never be dependent upon a non-distributed built file.
## Therefore we ensure that %DIRSTAMP% exists in the rule.
?!INSRC??DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
-## Back up the info files before running makeinfo. This is the cheapest
-## way to ensure that
-## 1) If the texinfo file shrinks (or if you start using --no-split),
-## you'll not be left with some dead info files lying around -- dead
-## files which would end up in the distribution.
-## 2) If the texinfo file has some minor mistakes which cause makeinfo
-## to fail, the info files are not removed. (They are needed by the
-## developer while he writes documentation.)
- %AM_V_MAKEINFO%restore=: && backupdir=.am$$$$ && \
-?INSRC? am__cwd=`pwd` && $(am__cd) $(srcdir) && \
- rm -rf $$backupdir && mkdir $$backupdir && \
-## If makeinfo is not installed we must not backup the files so
-## 'missing' can do its job and touch $@ if it exists.
- if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
- for f in $@ $@-[0-9] $@-[0-9][0-9]; do \
- if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
- done; \
- else :; fi && \
-?INSRC? cd "$$am__cwd"; \
- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-?!INSRC? -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
-?INSRC??!GENERIC_INFO? -o $@ $(srcdir)/%SOURCE_INFO%; \
-?INSRC??GENERIC_INFO? -o $@ $<; \
- then \
- rc=0; \
-?INSRC? $(am__cd) $(srcdir); \
- else \
- rc=$$?; \
-## Beware that backup info files might come from a subdirectory.
-?INSRC? $(am__cd) $(srcdir) && \
- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
- fi; \
- rm -rf $$backupdir; exit $$rc
+## If the texinfo file has some minor mistakes which cause makeinfo
+## to fail, the info files are not removed.
+ $(AM_V_MAKEINFO)$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+ %MAKEINFOFLAGS% --no-split -o $@-t \
+?!INSRC? `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%
+?INSRC??!GENERIC_INFO? $(srcdir)/%SOURCE_INFO%
+?INSRC??GENERIC_INFO? $<
+ $(AM_V_at)mv -f $@-t $@
INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
- if test -f $$ifile; then \
- echo "$$ifile"; \
- else : ; fi; \
- done; \
+ if test -f $$file; then \
+ echo ./$$file; \
+ else \
+ echo $(srcdir)/$$file; \
+ fi; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
(if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
- echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]"; \
- rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]; \
+ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile"; \
+ rm -f $$relfile; \
else :; fi); \
done
case $$base in \
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
- if test -f $$base; then d=.; else d=$(srcdir); fi; \
- for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9]; do \
- if test -f $$file; then \
-## Strip leading '$$d/'.
- relfile=`expr "$$file" : "$$d/\(.*\)"`; \
- test -f "$(distdir)/$$relfile" || \
- cp -p $$file "$(distdir)/$$relfile"; \
- else :; fi; \
- done; \
+ if test -f $$base; then \
+ file=./$$base; \
+ else \
+ file=$(srcdir)/$$base; \
+ fi; \
+ if test -f $$file && test ! -f "$(distdir)/$$base"; then \
+ cp -p $$file "$(distdir)/$$base"; \
+ fi; \
done
endif %?LOCAL-TEXIS%
.PHONY maintainer-clean-am: maintainer-clean-aminfo
maintainer-clean-aminfo:
- @list='$(INFO_DEPS)'; for i in $$list; do \
- echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9]"; \
- rm -f $$i $$i-[0-9] $$i-[0-9][0-9]; \
- done
+ -test -z "$(INFO_DEPS)" || rm -f $(INFO_DEPS)
## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
## above for details.
?MAINTCLEAN? -test -z "%MAINTCLEAN%" \
t/txinfo-no-extra-dist.sh \
t/txinfo-no-installinfo.sh \
t/txinfo-no-repeated-targets.sh \
+t/txinfo-no-split.sh \
t/txinfo-other-suffixes.sh \
t/txinfo-override-infodeps.sh \
t/txinfo-override-texinfo-tex.sh \
./configure
$MAKE
-# Feign more info files.
-: > main.info-1
-: > sub/main.info-1
-
# Break main.texi.
$sleep
cp main.texi main.old
# makeinfo will bail out, but we should conserve the old info files.
$MAKE && exit 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.info
-test ! -e main.info-1
test -f sub/main.info
-test -f sub/main.info-1
:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2013 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/>.
+
+# Info split files should not be produced (automake bug#13351).
+
+required=makeinfo
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'END'
+MAKEINFO = makeinfo --split-size 10
+info_TEXINFOS = foo.texi
+
+test-split: # A sanity check.
+ $(MAKEINFO) -o split.info foo.texi
+
+check-local:
+ test -f $(srcdir)/foo.info
+ test ! -f $(srcdir)/foo.info-1
+ test "`find $(srcdir) . | grep '\.info'`" = "$(srcdir)/foo.info"
+END
+
+cat > foo.texi << 'END'
+\input texinfo
+@setfilename foo.info
+@settitle foo
+@dircategory Dummy utilities
+@direntry
+* Foo: (foo). Does nothing at all.
+@end direntry
+
+@node Top
+@top Foo
+
+@menu
+* Intro:: Introduction
+* Planets:: List of Planets
+@end menu
+
+@node Intro
+@chapter Introduction
+Will list planets.
+
+@node Planets
+@chapter List of planets
+Hello Mercury.
+Hello Venus
+Hello Earth
+Hello Mars.
+Hello Jupiter.
+Hello Saturn.
+Hello Uran.
+Hello Neptune.
+Hello Pluto.
+@bye
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE test-split
+ls -l # For debugging.
+test -f split.info
+test -f split.info-1
+test -f split.info-2
+rm -f split*
+
+$MAKE
+
+ls -l # For debugging.
+test -f foo.info
+test ! -f foo.info-1
+test "$(find . | $FGREP '.info' | sed 's|^\./||')" = foo.info
+
+$MAKE distcheck
+
+: