texi: build version.texi and stamp-vti in srcdir
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 19 May 2013 14:48:19 +0000 (16:48 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 19 May 2013 20:13:13 +0000 (22:13 +0200)
Do so even when the 'info-in-builddir' option is present, or when
the corresponding '*.info' files are listed in $(CLEANFILES) or in
$(DISTCLEANFILES).

This fixes failures in the following tests, when they are run with
$MAKE pointing to FreeBSD make:

    - txinfo-nodist-info.sh
    - txinfo23.sh
    - txinfo24.sh
    - txinfo28.sh
    - txinfo25.sh

BTW, notice that the test 'txinfo-builddir.sh' fails with FreeBSD make
as well, but that is due to a known FreeBSD make VPATH issue (the same
described in automake bug#7884).  But that is not a regression, since
the 'info-in-builddir' option will be new in Automake 1.14.  Moreover,
we already warn in the manual that the use of that option can indeed
cause problems with VPATH builds done by non-GNU make.

* bin/automake.in (handle_texinfo_helper): New local variable
'$soutdir'.  Use it instead of '$outdir' where appropriate (in
particular, in the transform used on file 'texi-vers.am'.
* t/txinfo-builddir.sh: Adjust to avoid spurious failures.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
bin/automake.in
t/txinfo-builddir.sh

index c95289f..8f3fb48 100644 (file)
@@ -3217,6 +3217,7 @@ sub handle_texinfo_helper
       #      was once done when the (now removed) 'cygnus' option was
       #      given.  See automake bug#11034 for more discussion.
       my $insrc = 1;
+      my $soutdir = '$(srcdir)/' . $outdir;
 
       if (option 'info-in-builddir')
         {
@@ -3239,12 +3240,12 @@ Oops!
 EOF
         }
 
-      $outdir = '$(srcdir)/' . $outdir if $insrc;
+      $outdir = $soutdir if $insrc;
 
       # If user specified file_TEXINFOS, then use that as explicit
       # dependency list.
       @texi_deps = ();
-      push (@texi_deps, "$outdir$vtexi") if $vtexi;
+      push (@texi_deps, "${soutdir}${vtexi}") if $vtexi;
 
       my $canonical = canonicalize ($infobase);
       if (var ($canonical . "_TEXINFOS"))
@@ -3298,8 +3299,8 @@ EOF
                                          new Automake::Location,
                                          TEXI     => $texi,
                                          VTI      => $vti,
-                                         STAMPVTI => "${outdir}stamp-$vti",
-                                         VTEXI    => "$outdir$vtexi",
+                                         STAMPVTI => "${soutdir}stamp-$vti",
+                                         VTEXI    => "$soutdir$vtexi",
                                          MDDIR    => $conf_dir,
                                          DIRSTAMP => $dirstamp);
        }
index e0156c5..42d4112 100644 (file)
 required='makeinfo tex texi2dvi'
 . test-init.sh
 
+if useless_vpath_rebuild; then
+  skip_ "$MAKE has brittle VPATH support"
+fi
+
 echo AC_OUTPUT >> configure.ac
 
 cat > Makefile.am << 'END'
@@ -86,38 +90,38 @@ $MAKE info
 test -f foo.info
 test -f subdir/bar.info
 test -f mu.info
-test -f stamp-vti
-test -f version.texi
+test -f ../stamp-vti
+test -f ../version.texi
 test ! -e ../foo.info
 test ! -e ../subdir/bar.info
 test ! -e ../mu.info
-test ! -e ../stamp-vti
-test ! -e ../version.texi
 $MAKE clean
 test -f foo.info
 test -f subdir/bar.info
 test ! -e mu.info
-test -f stamp-vti
-test -f version.texi
+test -f ../stamp-vti
+test -f ../version.texi
 
 # Make sure stamp-vti is older that version.texi.
 # (A common situation in a real tree).
 $sleep
-touch stamp-vti
+touch ../stamp-vti
 
 $MAKE distcheck
 # Being distributed, this file should have been rebuilt.
 test -f mu.info
 
 $MAKE distclean
-test -f stamp-vti
-test -f version.texi
+test -f ../stamp-vti
+test -f ../version.texi
 test -f foo.info
 test -f subdir/bar.info
 test ! -e mu.info
 
 ../configure
 $MAKE maintainer-clean
+test ! -e ../stamp-vti
+test ! -e ../version.texi
 test ! -e stamp-vti
 test ! -e version.texi
 test ! -e foo.info