]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/am/texibuild.am: Don't remove the target info files. Instead,
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 24 Feb 2003 22:09:21 +0000 (22:09 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 24 Feb 2003 22:09:21 +0000 (22:09 +0000)
back up and restore them if makeinfo fails.
* tests/txinfo20.test: New file.
* tests/Makefile.am (TESTS): Add txinfo20.test.

ChangeLog
Makefile.in
NEWS
aclocal.m4
configure
lib/am/texibuild.am
tests/Makefile.am
tests/Makefile.in
tests/txinfo20.test [new file with mode: 0755]

index ea5f4c01d0fb6a6961d9f6d6dac3a57389ac2cdc..b54fcc4815d4e7b919c437736e162a9247196715 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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)
index c8a50d2a2202b7e1390977d28e50fb902977bc09..cfe5432d47ec9244fa01f6cc1b05a187078c702d 100644 (file)
@@ -198,9 +198,18 @@ uninstall-binSCRIPTS:
        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" \
@@ -255,9 +264,10 @@ uninstall-info-am:
        @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
 
@@ -280,11 +290,10 @@ mostlyclean-aminfo:
          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
@@ -492,7 +501,7 @@ distcheck: dist
        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" \
@@ -600,7 +609,9 @@ install-info-am: $(INFO_DEPS)
        @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"; \
diff --git a/NEWS b/NEWS
index 89a5dc4a6752a858a525fac23535ad6de3ba85f7..0974445fe74a98118cba19b3787b710e6e7528d7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,8 @@ New in 1.7a:
   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.
index 444454ad77ca88b5b431bbbacd86e14989c265ba..fe224085ccf2923d3227787e876861bcaf056ed1 100644 (file)
@@ -583,11 +583,17 @@ AC_CACHE_CHECK([dependency style of $depcc],
     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
 
index 72cc8a09acb6a8b3e17f25d51f4193d017e019b9..92b3fbd1c442de0f4d4d732c77c172415310a6cb 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /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>.
 #
@@ -852,7 +852,7 @@ test -n "$ac_init_help" && exit 0
 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.
@@ -867,7 +867,7 @@ This file contains any messages produced by compilers while
 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 $@
 
@@ -1454,15 +1454,6 @@ echo "${ECHO_T}no" >&6
   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
@@ -2196,7 +2187,7 @@ _ASBOX
 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
@@ -2251,7 +2242,7 @@ _ACEOF
 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
index 00fecc5db26589c0cab3b6843cee684e39409a1f..d7665a23975912d3b97b29c33982716d0e32140c 100644 (file)
 
 ?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%
index 194ffd4aa080ae7c237866f9b786214659c8b697..8c3f92161a74a4560695546a5846bef5902aaee3 100644 (file)
@@ -425,6 +425,7 @@ txinfo16.test \
 txinfo17.test \
 txinfo18.test \
 txinfo19.test \
+txinfo20.test \
 transform.test \
 unused.test \
 vars.test \
index b9bd15e83b9be4ac1e38350f3c955f94a43f1e02..c6caa3f4a3881d1aa89b13210fe591a81d80fb4a 100644 (file)
@@ -519,6 +519,7 @@ txinfo16.test \
 txinfo17.test \
 txinfo18.test \
 txinfo19.test \
+txinfo20.test \
 transform.test \
 unused.test \
 vars.test \
diff --git a/tests/txinfo20.test b/tests/txinfo20.test
new file mode 100755 (executable)
index 0000000..bcc3b8a
--- /dev/null
@@ -0,0 +1,82 @@
+#! /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