back up and restore them if makeinfo fails.
* tests/txinfo20.test: New file.
* tests/Makefile.am (TESTS): Add txinfo20.test.
+2003-02-22 Bruno Haible <bruno@clisp.org>
+ Alexandre Duret-Lutz <adl@gnu.org>
+
+ * lib/am/texibuild.am: Don't remove the target info files. Instead,
+ back up and restore them if makeinfo fails.
+ * tests/txinfo20.test: New file.
+ * tests/Makefile.am (TESTS): Add txinfo20.test.
+
2003-02-23 Alexandre Duret-Lutz <adl@gnu.org>
* automake.texi (FAQ, CVS, maintainer-mode, wildcards)
done
.texi.info:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ backupdir=somedir && rm -rf $$backupdir && mkdir $$backupdir && \
+ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+ if test -f $$f; then \
+ mv $$f $$backupdir; \
+ fi \
+ done; \
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+ -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ rc=$$?; \
+ test $$rc != 0 && mv $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+ rm -rf $$backupdir; \
+ exit $$rc
.texi.dvi:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
@list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
(if cd $(DESTDIR)$(infodir); then \
- echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9])"; \
- rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]; \
+ echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
+ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
else :; fi); \
done
automake.vrs automake.dvi automake.pdf automake.ps
maintainer-clean-aminfo:
- list='$(INFO_DEPS)'; for i in $$list; do \
- rm -f $$i; \
- if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
- rm -f $$i-[0-9]*; \
- fi; \
+ @list='$(INFO_DEPS)'; for i in $$list; do \
+ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
+ 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
# This directory's subdirectories are mostly independent; you can cd
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd` \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
@list='$(INFO_DEPS)'; \
for file in $$list; do \
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 \
+ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
+ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
+ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
versions of Automake, because AC_PROG_CC defines this variable since
Autoconf 2.54.)
+* Texinfo rules back up and restore info files when makeinfo fails.
+
\f
New in 1.7:
* Autoconf 2.54 is required.
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
+ $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
+ >/dev/null 2>conftest.err &&
grep conftest.h conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- am_cv_$1_dependencies_compiler_type=$depmode
- break
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
fi
done
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57a for GNU Automake 1.7a.
+# Generated by GNU Autoconf 2.57 for GNU Automake 1.7a.
#
# Report bugs to <bug-automake@gnu.org>.
#
if $ac_init_version; then
cat <<\_ACEOF
GNU Automake configure 1.7a
-generated by GNU Autoconf 2.57a
+generated by GNU Autoconf 2.57
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
running configure, to aid debugging if configure makes a mistake.
It was created by GNU Automake $as_me 1.7a, which was
-generated by GNU Autoconf 2.57a. Invocation command line was
+generated by GNU Autoconf 2.57. Invocation command line was
$ $0 $@
SET_MAKE="MAKE=${MAKE-make}"
fi
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
cat >&5 <<_CSEOF
This file was extended by GNU Automake $as_me 1.7a, which was
-generated by GNU Autoconf 2.57a. Invocation command line was
+generated by GNU Autoconf 2.57. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
GNU Automake config.status 1.7a
-configured by $0, generated by GNU Autoconf 2.57a,
+configured by $0, generated by GNU Autoconf 2.57,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%:
?!GENERIC_INFO?%DEST_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
-## Note that we also remove the possible output files before running
-## makeinfo. Otherwise, if the texinfo file shrinks (or if you start
-## using --no-split), you'll be left with some dead info files lying
-## around -- dead files which will end up in the distribution.
-## *.iNN files are used on DJGPP. See the comments in install-info-am
- @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
## It is wrong to have `info' files dependent on %DIRSTAMP%, because
## `info' files are distributed and %DIRSTAMP% isn't: a distributed file
## should never be dependent upon a non-distributed built file.
## Therefore we ensure that %DIRSTAMP% exists in the rule.
?DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) %DIRSTAMP%
- $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
- -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%
+## 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.)
+## *.iNN files are used on DJGPP. See the comments in install-info-am
+ restore=: && \
+ backupdir="$(am__leading_dot)am$$$$" && \
+ rm -rf $$backupdir && mkdir $$backupdir && \
+ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+ if test -f $$f; then \
+ mv $$f $$backupdir; \
+ restore=mv; \
+ fi; \
+ done; \
+ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
+ -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
+ then rc=0; else \
+ rc=$$?; \
+## Beware that backup info files might come from a subdirectory.
+ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+ fi; \
+ rm -rf $$backupdir; \
+ exit $$rc
?GENERIC?%SOURCE_SUFFIX%.dvi:
?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
txinfo17.test \
txinfo18.test \
txinfo19.test \
+txinfo20.test \
transform.test \
unused.test \
vars.test \
txinfo17.test \
txinfo18.test \
txinfo19.test \
+txinfo20.test \
transform.test \
unused.test \
vars.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure info files survive makeinfo errors.
+
+required=makeinfo
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = main.texi sub/main.texi
+END
+
+mkdir sub
+
+cat > main.texi << 'END'
+\input texinfo
+@setfilename main
+@settitle main
+@node Top
+Hello walls.
+@bye
+END
+
+cp main.texi sub/main.texi
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+$MAKE
+
+# Feign more info files.
+: > main-1
+: > sub/main-1
+
+# Break main.texi
+$sleep
+cp main.texi main.old
+cat > main.texi << 'END'
+\input texinfo
+@setfilename main
+@settitle main
+@node Top
+@unknown_macro{Hello walls.}
+@bye
+END
+
+# makeinfo will bail out, but we should conserve the old info files.
+$MAKE && exit 1
+test -f main
+test -f main-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