Build info files in builddir instead of srcdir (for PR automake/168),
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 30 Jul 2002 20:15:32 +0000 (20:15 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 30 Jul 2002 20:15:32 +0000 (20:15 +0000)
and prepare support for info files in subdirecties.
* automake.in (output_texinfo_build_rules): New function.
(handle_texinfo_helper): Use output_texinfo_build_rules, and
prepare to support subdir texinfos.  Define am__TEXINFO_TEX_DIR.
* lib/am/texi-vers.am: Build version.texi and stamp-vti in the
current directory, not $(srcdir).  Use %STAMPVTI% to name the stamp
file.
* lib/am/texibuild.am: Rewrite to output files in the current
directory, not $(srcdir).  Also, support both generic and
non-generic output.  Pass `-o $@' to makeinfo, texinfo, and
texi2dvi -- this is a partial fix for PR automake/339.
* tests/texinfo3.test: Make sure the `.texi:' rule is output.
* tests/texinfo10.test: Use set -e, so the checks are not ignored.
* tests/texinfo16.test: New file.
* tests/Makefile.am (TESTS): Add texinfo16.test.

12 files changed:
ChangeLog
Makefile.in
NEWS
automake.in
lib/am/texi-vers.am
lib/am/texibuild.am
stamp-vti
tests/Makefile.am
tests/Makefile.in
tests/texinfo10.test
tests/texinfo16.test [new file with mode: 0755]
tests/texinfo3.test

index d20e599..163df1a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2002-07-30  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       Build info files in builddir instead of srcdir (for PR automake/168),
+       and prepare support for info files in subdirecties.
+       * automake.in (output_texinfo_build_rules): New function.
+       (handle_texinfo_helper): Use output_texinfo_build_rules, and
+       prepare to support subdir texinfos.  Define am__TEXINFO_TEX_DIR.
+       * lib/am/texi-vers.am: Build version.texi and stamp-vti in the
+       current directory, not $(srcdir).  Use %STAMPVTI% to name the stamp
+       file.
+       * lib/am/texibuild.am: Rewrite to output files in the current
+       directory, not $(srcdir).  Also, support both generic and
+       non-generic output.  Pass `-o $@' to makeinfo, texinfo, and
+       texi2dvi -- this is a partial fix for PR automake/339.
+       * tests/texinfo3.test: Make sure the `.texi:' rule is output.
+       * tests/texinfo10.test: Use set -e, so the checks are not ignored.
+       * tests/texinfo16.test: New file.
+       * tests/Makefile.am (TESTS): Add texinfo16.test.
+
 2002-07-29  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        * aclocal.in (write_aclocal): Don't write the filename ($output_file)
index a21e40f..9309335 100644 (file)
@@ -116,6 +116,7 @@ SCRIPTS = $(bin_SCRIPTS)
 
 DIST_SOURCES =
 TEXINFO_TEX = $(top_srcdir)/lib/texinfo.tex
+am__TEXINFO_TEX_DIR = $(top_srcdir)/lib
 INFO_DEPS = automake.info
 DVIS = automake.dvi
 PDFS = automake.pdf
@@ -176,52 +177,43 @@ uninstall-binSCRIPTS:
          echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
          rm -f $(DESTDIR)$(bindir)/$$f; \
        done
-
-$(srcdir)/version.texi:  $(srcdir)/stamp-vti
-       @:
-$(srcdir)/stamp-vti: automake.texi $(top_srcdir)/configure.in
-       @(set `$(SHELL) $(top_srcdir)/lib/mdate-sh $(srcdir)/automake.texi`; \
+version.texi:  stamp-vti
+stamp-vti: automake.texi $(top_srcdir)/configure.in
+       @(dir=.; test -f ./automake.texi || dir=$(srcdir); \
+       set `$(SHELL) $(top_srcdir)/lib/mdate-sh $$dir/automake.texi`; \
        echo "@set UPDATED $$1 $$2 $$3"; \
        echo "@set UPDATED-MONTH $$2 $$3"; \
        echo "@set EDITION $(VERSION)"; \
        echo "@set VERSION $(VERSION)") > vti.tmp
-       @cmp -s vti.tmp $(srcdir)/version.texi \
-         || (echo "Updating $(srcdir)/version.texi"; \
-             cp vti.tmp $(srcdir)/version.texi)
+       @cmp -s vti.tmp version.texi \
+         || (echo "Updating version.texi"; \
+             cp vti.tmp version.texi)
        -@rm -f vti.tmp
-       @cp $(srcdir)/version.texi $@
+       @cp version.texi $@
 
 mostlyclean-vti:
        -rm -f vti.tmp
 
 maintainer-clean-vti:
-       -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
-
-automake.info: automake.texi $(srcdir)/version.texi
-automake.dvi: automake.texi $(srcdir)/version.texi
-automake.pdf: automake.texi $(srcdir)/version.texi
+       -rm -f stamp-vti version.texi
 
 .texi.info:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
-              `echo $< | sed 's,.*/,,'`
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+       `test -f '$<' || echo '$(srcdir)/'`$< -o $@
 
 .texi.dvi:
-       TEXINPUTS="$(top_srcdir)/lib$(PATH_SEPARATOR)$$TEXINPUTS" \
+       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2DVI) $<
+       $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
 
 .texi.pdf:
-       TEXINPUTS="$(top_srcdir)/lib$(PATH_SEPARATOR)$$TEXINPUTS" \
+       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2PDF) $<
-
-.texi:
-       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-       cd $(srcdir) \
-         && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
-              `echo $< | sed 's,.*/,,'`
+       $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
+automake.info: version.texi
+automake.dvi: version.texi
+automake.pdf: version.texi
 TEXI2DVI = texi2dvi
 
 TEXI2PDF = $(TEXI2DVI) --pdf
diff --git a/NEWS b/NEWS
index 37e5577..114504b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-New in 1.6b:
+New in 1.6c:
 * Autoconf 2.53b is required.
 * `aclocal' and `automake' will no longer warn about obsolete
   configure macros.  This is done by `autoconf -Wobsolete'.
@@ -16,6 +16,7 @@ New in 1.6b:
 * A new option, std-options, tests that programs support --help and --version
   when `make installcheck' is run.  This is enabled by --gnits.
 * Texinfo rules now support the `ps' and `pdf' targets.
+* Info files are now created in the build directory, not the source directory.
 * `make distcheck' will enforce DESTDIR support by attempting
   a DESTDIR install.
 * `+=' can be used in conditionals, even if the augmented variable
index c78a364..cce7b51 100755 (executable)
@@ -3525,6 +3525,74 @@ sub scan_texinfo_file
     return ($outfile, $vfile, (sort keys %clean_files));
 }
 
+# output_texinfo_build_rules ($SOURCE, $DEST, @DEPENDENCIES)
+# ----------------------------------------------------------
+# SOURCE - the source Texinfo file
+# DEST - the destination Info file
+# DEPENDENCIES - known dependencies
+sub output_texinfo_build_rules ($$@)
+{
+  my ($source, $dest, @deps) = @_;
+
+  # Split `a.texi' into `a' and `.texi'.
+  my ($spfx, $ssfx) = ($source =~ /^(.*?)(\.[^.]*)?$/);
+  my ($dpfx, $dsfx) = ($dest =~ /^(.*?)(\.[^.]*)?$/);
+
+  $ssfx ||= "";
+  $dsfx ||= "";
+
+  # We can output two kinds of rules: the "generic" rules
+  # use Make suffix rules and are appropritate when
+  # $source and $dest lie in the current directory; the "specifix"
+  # rules is needed in the other case.
+  #
+  # The former are output only once (this is not really apparent
+  # here, but just remember that some logic deeper in Automake will
+  # not output the same rule twice); while the later need to be output
+  # for each Texinfo source.
+  my $generic;
+  my $makeinfoflags;
+  my $sdir = dirname $source;
+  if ($sdir eq '.' && dirname ($dest) eq '.')
+    {
+      $generic = 1;
+      $makeinfoflags = '-I $(srcdir)';
+    }
+  else
+    {
+      $generic = 0;
+      $makeinfoflags = "-I $sdir -I \$(srcdir)/$sdir";
+    }
+
+  # If the resulting file lie into a subdirectory,
+  # make sure this directory will exist.
+  my $dirstamp = require_build_directory_maybe ($dest);
+
+  # It is wrong to make $SOURCE dependent on $DIRSTAMP, because
+  # $SOURCE is distributed and $DIRSTAMP is not.  A generated file
+  # should never be dependent upon a non-distributed built file.
+  #
+  # So don't do that:
+  #
+  #   push @deps, $dirstamp;
+  #
+  # Instead we append all dirstamps to the $(am__texinfo_dirstamps)
+  # variable and have this variable in the dependencies of
+  # info, dvi, etc.  (FIXME: this is not done yet -- support for
+  # Texinfo files in subdirectories is not complete.)
+  macro_define ('am__texinfo_dirstamps', VAR_AUTOMAKE, '+', 'TRUE',
+               $dirstamp, 'internal');
+
+  $output_rules .= &file_contents ('texibuild',
+                                   GENERIC       => $generic,
+                                   SOURCE_SUFFIX => $ssfx,
+                                   SOURCE => ($generic ? '$<' : $source),
+                                   DEST_PREFIX   => $dpfx,
+                                   DEST_SUFFIX   => $dsfx,
+                                   MAKEINFOFLAGS => $makeinfoflags,
+                                   DEPS          => "@deps");
+}
+
 
 # ($DO-SOMETHING, $TEXICLEANS)
 # handle_texinfo_helper ()
@@ -3545,7 +3613,6 @@ sub handle_texinfo_helper
     my @texi_cleans;
     my $canonical;
 
-    my %texi_suffixes;
     foreach my $info_cursor (@texis)
     {
         my $infobase = $info_cursor;
@@ -3557,7 +3624,6 @@ sub handle_texinfo_helper
            err_am "texinfo file `$info_cursor' has unrecognized extension";
            next;
          }
-       $texi_suffixes{$1} = 1;
 
        # If 'version.texi' is referenced by input file, then include
        # automatic versioning capability.
@@ -3566,6 +3632,14 @@ sub handle_texinfo_helper
            or next;
        push (@texi_cleans, @clean_files);
 
+       # If the Texinfo source is in a subdirectory, create the
+       # resulting info in this subdirectory.  If it is in the
+       # current directory, try hard to not prefix "./" because
+       # it breaks the generic rules.
+       my $outdir = dirname ($info_cursor) . '/';
+       $outdir = "" if $outdir eq './';
+       $out_file =  $outdir . $out_file;
+
        if ($vtexi)
        {
            err_am ("`$vtexi', included in `$info_cursor', "
@@ -3601,20 +3675,18 @@ sub handle_texinfo_helper
            {
                $conf_dir = '$(srcdir)/';
            }
-           $output_rules .= &file_contents ('texi-vers',
-                                            ('TEXI'  => $info_cursor,
-                                             'VTI'   => $vti,
-                                             'VTEXI' => $vtexi,
-                                             'MDDIR' => $conf_dir));
+                   $output_rules .= &file_contents ('texi-vers',
+                                            TEXI     => $info_cursor,
+                                            VTI      => $vti,
+                                            STAMPVTI => "${outdir}stamp-$vti",
+                                            VTEXI    => "$outdir$vtexi",
+                                            MDDIR    => $conf_dir);
        }
 
        # If user specified file_TEXINFOS, then use that as explicit
        # dependency list.
        @texi_deps = ();
-       push (@texi_deps, $info_cursor);
-       # Prefix with $(srcdir) because some version of make won't
-       # work if the target has it and the dependency doesn't.
-       push (@texi_deps, '$(srcdir)/' . $vtexi) if $vtexi;
+       push (@texi_deps, "$outdir$vtexi") if $vtexi;
 
        my $canonical = &canonicalize ($infobase);
        if (variable_defined ($canonical . "_TEXINFOS"))
@@ -3623,13 +3695,8 @@ sub handle_texinfo_helper
            &push_dist_common ('$(' . $canonical . '_TEXINFOS)');
        }
 
-       $output_rules .= ("\n" . $out_file . ": "
-                         . "@texi_deps"
-                         . "\n" . $infobase . ".dvi: "
-                         . "@texi_deps"
-                         . "\n" . $infobase . ".pdf: "
-                         . "@texi_deps"
-                         . "\n");
+       output_texinfo_build_rules ($info_cursor, $out_file,
+                                   @texi_deps);
 
        push (@info_deps_list, $out_file);
        push (@dvis_list, $infobase . '.dvi');
@@ -3663,13 +3730,7 @@ sub handle_texinfo_helper
         $texinfodir = '$(srcdir)';
        $need_texi_file = 1;
     }
-
-    foreach my $txsfx (sort keys %texi_suffixes)
-    {
-       $output_rules .= &file_contents ('texibuild',
-                                        ('TEXINFODIR' => $texinfodir,
-                                         'SUFFIX'     => $txsfx));
-    }
+    &define_variable ('am__TEXINFO_TEX_DIR', $texinfodir);
 
     # The return value.
     my $texiclean = &pretty_print_internal ("", "\t  ", @texi_cleans);
index a0f7bea..4429e62 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001
+## Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-DIST_COMMON += %VTEXI% stamp-%VTI%
+DIST_COMMON += %VTEXI% %STAMPVTI%
 
-$(srcdir)/%VTEXI%: %MAINTAINER-MODE% $(srcdir)/stamp-%VTI%
-       @:
+## Don't give this rule a command (even `@:').
+## %STAMPVTI% is always newer than %VTEXI%, so this rule is always
+## triggered.  If you equip this rule with a command, GNU make will
+## assume %VTEXI% has been rebuild in the current directory and
+## discard any %VTEXI% file found in a VPATH seatch.
+%VTEXI%: %MAINTAINER-MODE% %STAMPVTI%
 
 ## Depend on %CONFIGURE-AC% so that version number updates cause a
 ## rebuild.
-$(srcdir)/stamp-%VTI%: %TEXI% $(top_srcdir)/%CONFIGURE-AC%
-       @(set `$(SHELL) %MDDIR%mdate-sh $(srcdir)/%TEXI%`; \
+%STAMPVTI%: %TEXI% $(top_srcdir)/%CONFIGURE-AC%
+       @(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
+       set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
        echo "@set UPDATED $$1 $$2 $$3"; \
        echo "@set UPDATED-MONTH $$2 $$3"; \
        echo "@set EDITION $(VERSION)"; \
@@ -33,11 +38,11 @@ $(srcdir)/stamp-%VTI%: %TEXI% $(top_srcdir)/%CONFIGURE-AC%
 ## Use cp and rm here because some older "mv"s can't move across
 ## filesystems.  Furthermore, GNU "mv" in the AmigaDOS environment
 ## can't handle this.
-       @cmp -s %VTI%.tmp $(srcdir)/%VTEXI% \
-         || (echo "Updating $(srcdir)/%VTEXI%"; \
-             cp %VTI%.tmp $(srcdir)/%VTEXI%)
+       @cmp -s %VTI%.tmp %VTEXI% \
+         || (echo "Updating %VTEXI%"; \
+             cp %VTI%.tmp %VTEXI%)
        -@rm -f %VTI%.tmp
-       @cp $(srcdir)/%VTEXI% $@
+       @cp %VTEXI% $@
 
 mostlyclean-am: mostlyclean-%VTI%
 mostlyclean-%VTI%:
@@ -45,6 +50,6 @@ mostlyclean-%VTI%:
 
 maintainer-clean-am: maintainer-clean-%VTI%
 maintainer-clean-%VTI%:
-%MAINTAINER-MODE%      -rm -f $(srcdir)/stamp-%VTI% $(srcdir)/%VTEXI%
+%MAINTAINER-MODE%      -rm -f %STAMPVTI% %VTEXI%
 
 .PHONY: mostlyclean-%VTI% maintainer-clean-%VTI%
index 4152348..aee95ab 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-.%SUFFIX%.info:
-## We want to force the .info file to be built in srcdir.  This is
-## probably the simplest way.  However, at Cygnus .info files are
-## always put into the build directory.  So at runtime we select which
-## rule to use.
+
+?GENERIC?%SOURCE_SUFFIX%%DEST_SUFFIX%:
+?!GENERIC?%DEST_PREFIX%%DEST_SUFFIX%: %SOURCE% %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.
-?!CYGNUS?      @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-?!CYGNUS?      cd $(srcdir) \
-?!CYGNUS?        && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
-?!CYGNUS?             `echo $< | sed 's,.*/,,'`
-?CYGNUS?       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
-?CYGNUS?       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
-?CYGNUS?         -I $(srcdir) $<
+       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
+       `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -o $@
 
-.%SUFFIX%.dvi:
-       TEXINPUTS="%TEXINFODIR%$(PATH_SEPARATOR)$$TEXINPUTS" \
+?GENERIC?%SOURCE_SUFFIX%.dvi:
+?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS%
+       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
-## if it is in srcdir.
-       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2DVI) $<
+## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
+       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
+       $(TEXI2DVI) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -o $@
 
-.%SUFFIX%.pdf:
-       TEXINPUTS="%TEXINFODIR%$(PATH_SEPARATOR)$$TEXINPUTS" \
+?GENERIC?%SOURCE_SUFFIX%.pdf:
+?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS%
+       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
-## if it is in srcdir.
-       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2PDF) $<
+## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
+       MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
+       $(TEXI2PDF) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -o $@
 
-.%SUFFIX%:
-## We want to force the .info file to be built in srcdir.  This is
-## probably the simplest way.  However, at Cygnus .info files are
-## always put into the build directory.  So at runtime we select which
-## rule to use.
-## 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.
-?!CYGNUS?      @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-?!CYGNUS?      cd $(srcdir) \
-?!CYGNUS?        && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
-?!CYGNUS?             `echo $< | sed 's,.*/,,'`
-?CYGNUS?       @rm -f $@ $@-[0-9] $@-[0-9][0-9]
-?CYGNUS?       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
-?CYGNUS?         -I $(srcdir) $<
+## If we are using the generic rules, we need separate dependencies.
+if %?GENERIC%
+%DEST_PREFIX%%DEST_SUFFIX%: %DEPS%
+%DEST_PREFIX%.dvi: %DEPS%
+%DEST_PREFIX%.pdf: %DEPS%
+endif %?GENERIC%
index 781d4ea..de0ca61 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 21 July 2002
+@set UPDATED 30 July 2002
 @set UPDATED-MONTH July 2002
 @set EDITION 1.6c
 @set VERSION 1.6c
index 90be880..a1ecc8a 100644 (file)
@@ -383,6 +383,7 @@ texinfo7.test \
 texinfo8.test \
 texinfo9.test \
 texinfo10.test \
+texinfo16.test \
 transform.test \
 unused.test \
 vars.test \
index 792ec3f..c780a5a 100644 (file)
@@ -471,6 +471,7 @@ texinfo7.test \
 texinfo8.test \
 texinfo9.test \
 texinfo10.test \
+texinfo16.test \
 transform.test \
 unused.test \
 vars.test \
index d6a1701..50ff742 100755 (executable)
@@ -5,6 +5,8 @@
 
 . $srcdir/defs || exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 SUBDIRS = sub
 END
@@ -17,8 +19,8 @@ END
 echo '@setfilename maude.info' > sub/maude.texi
 : > sub/texinfo.tex
 
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep dvi-recursive Makefile.in
 grep '[^-]info-recursive' Makefile.in
diff --git a/tests/texinfo16.test b/tests/texinfo16.test
new file mode 100755 (executable)
index 0000000..ac92851
--- /dev/null
@@ -0,0 +1,69 @@
+#! /bin/sh
+
+# Check that info files are built in $(srcdir).
+
+required='GNUmake makeinfo'
+. $srcdir/defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = main.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
+@setfilename main.info
+@settitle main
+@node Top
+Hello walls.
+@include version.texi
+@bye
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+mkdir build
+cd build
+../configure
+$MAKE
+test -f main.info
+
+cd ..
+rm -rf build
+./configure
+$MAKE
+test -f main.info
+
+# Make sur stamp-vti is older that version.texi.
+# (A common situation in a real tree.)
+# This is needed to test the "subtle" issue described below.
+test -f stamp-vti
+test -f version.texi
+sleep 2
+touch stamp-vti
+
+$MAKE distclean
+test -f stamp-vti
+test -f version.texi
+
+mkdir build
+cd build
+../configure
+$MAKE
+# main.info should not be rebuilt in the current directory, since
+# it's up-to-date in $(srcdir).
+# This can be caused by a subtle issue related to VPATH handling
+# of version.texi (see also the comment in texi-vers.am): because
+# stamp-vti is newer than version.texi, the `version.texi: stamp-vti'
+# rule is always triggered.  Still that's not a reason for `make'
+# to think `version.texi' has been created...
+test ! -f main.info
+$MAKE dvi
+test -f main.dvi
+
+$MAKE distcheck
index ce6c68e..d763aed 100755 (executable)
@@ -4,6 +4,8 @@
 
 . $srcdir/defs || exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
 END
@@ -11,7 +13,8 @@ END
 echo '@setfilename textutils' > textutils.texi
 : > texinfo.tex
 
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^INFO_DEPS.*textutils$' Makefile.in
+grep '^.texi:$' Makefile.in