automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: update .info files in $(srcdir) again


From: Alexandre Duret-Lutz
Subject: FYI: update .info files in $(srcdir) again
Date: Sat, 08 Nov 2003 14:00:51 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

I'm installing the following patch on HEAD.

I have been postponing this for months, because the way these
info build rules mixed with stamp files and VPATH builds behave
differently in each Make implementation can really drive someone
crazy.  But it really had to be done before 1.8.

I've run the test suite with GNU Make, FreeBSD Make, and pmake
(close to NetBSD Make), and the Texinfo tests that used to fail
with FreeBSD Make now pass.  (lex3.test this still failing for
the same reason txinfo*.test did -- flex/bison rules need
to be updated in $(srcdir) -- I'll look at this separately.)

I've retained the possibility to build .info in the build tree,
because it will be useful the day Automake supports
non-distributed .info files.

Some packages like Texinfo (actually this is the only package I
know) already have hacks so that .info files are not
distributed.  This works only if .info files are built in the
build directory.  This patch keep backward compatibility with
these packages by building .info files in the build directory
when it detects that these .info files are cleaned.  Although I
don't want to document this ugly hack (which is incomplete BTW,
you still have to override the "dist-info" target to prevent
distribution), there are test cases, and I've successfully
distchecked the Texinfo package with this new version.
(Karl I'm just cc-ing you so you don't sigh when reading NEWS,
it is expected to work for Texinfo despite what it says.)


2003-11-08  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/texibuild.am (%DEST_PREFIX%%DEST_SUFFIX%): Rename as ...
        (%DEST_INFO_PREFIX%%DEST_SUFFIX%): ... this, and honor ?INSRC?
        to select $(srcdir) or `.' builds.
        (INFO_DEPS): Define here.
        * lib/am/texinfos.am (dist-info): Strip filename starting with
        "$(srcdir)/".
        * automake.in (output_texinfo_build_rules): Take a new argument
        $insrc, and adjust substitutions in 'texibuild'.
        (handle_texinfo_helper): Compute a regex of all user-cleaned
        files, and use this to select whether to build .info files in `.'
        or $(srcdir).  Give an account of the $(srcdir) vs `.' debacle.
        Alway build the version.texi and stamp files in $(srcdir).  Do not
        define INFO_DEPS.
        * tests/Makefile.am (TESTS): Add txinfo23.test, txinfo24.test,
        and txinfo25.test.
        * tests/txinfo23.test, tests/txinfo24.test, tests/txinfo25.test:
        New files.
        * tests/txinfo13.test, tests/txinfo16.test, tests/txinfo3.test,
        tests/vtexi.test: Adjust to new rules.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.235
diff -u -r1.235 NEWS
--- NEWS        5 Nov 2003 21:31:34 -0000       1.235
+++ NEWS        8 Nov 2003 12:54:55 -0000
@@ -175,6 +175,12 @@
 
   - Do not assume that make files are called Makefile in cleaning rules.
 
+  - Update .info files in the source tree, not in the build tree.  This
+    is what the GNU Coding Standard recommend.  Only Automake 1.7.x
+    used to update these files in the build tree (previous versions did
+    it in the source tree too), and it caused several problems, varying
+    from mere annoyance to portability issues.
+
 * Miscellaneous
 
   - The Automake manual is now distributed under the terms of the GNU FDL.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1510
diff -u -r1.1510 automake.in
--- automake.in 27 Oct 2003 07:51:59 -0000      1.1510
+++ automake.in 8 Nov 2003 12:55:00 -0000
@@ -2595,14 +2595,15 @@
 
 
 # ($DIRSTAMP, @CLEAN_FILES)
-# output_texinfo_build_rules ($SOURCE, $DEST, @DEPENDENCIES)
-# ----------------------------------------------------------
+# output_texinfo_build_rules ($SOURCE, $DEST, $INSRC, @DEPENDENCIES)
+# ------------------------------------------------------------------
 # SOURCE - the source Texinfo file
 # DEST - the destination Info file
+# INSRC - wether DEST should be built in the source tree
 # DEPENDENCIES - known dependencies
-sub output_texinfo_build_rules ($$@)
+sub output_texinfo_build_rules ($$$@)
 {
-  my ($source, $dest, @deps) = @_;
+  my ($source, $dest, $insrc, @deps) = @_;
 
   # Split `a.texi' into `a' and `.texi'.
   my ($spfx, $ssfx) = ($source =~ /^(.*?)(\.[^.]*)?$/);
@@ -2612,8 +2613,8 @@
   $dsfx ||= "";
 
   # We can output two kinds of rules: the "generic" rules use Make
-  # suffix rules and are appropriate when $source and $dest lie in
-  # the current directory; the "specific" rules are needed in the other
+  # suffix rules and are appropriate when $source and $dest do not lie
+  # in a sub-directory; the "specific" rules are needed in the other
   # case.
   #
   # The former are output only once (this is not really apparent here,
@@ -2634,6 +2635,15 @@
       $makeinfoflags = "-I $sdir -I \$(srcdir)/$sdir";
     }
 
+  # A directory can contain two kinds of info files: some built in the
+  # source tree, and some built in the build tree.  The rules are
+  # different in each case.  However we cannot output two different
+  # set of generic rules.  Because in-source builds are more usual, we
+  # use generic rules in this case and fall back to "specific" rules
+  # for build-dir builds.  (It should not be a problem to invert this
+  # if needed.)
+  $generic = 0 unless $insrc;
+
   # We cannot use a suffix rule to build info files with an empty
   # extension.  Otherwise we would output a single suffix inference
   # rule, with separate dependencies, as in
@@ -2652,20 +2662,26 @@
   # make sure this directory will exist.
   my $dirstamp = require_build_directory_maybe ($dest);
 
+  my $dipfx = ($insrc ? '$(srcdir)/' : '') . $dpfx;
+
   $output_rules .= file_contents ('texibuild',
                                  new Automake::Location,
-                                 GENERIC       => $generic,
-                                 GENERIC_INFO  => $generic_info,
-                                 SOURCE_SUFFIX => $ssfx,
-                                 SOURCE => ($generic ? '$<' : $source),
-                                 SOURCE_INFO   => ($generic_info ?
-                                                   '$<' : $source),
-                                 SOURCE_REAL   => $source,
-                                 DEST_PREFIX   => $dpfx,
-                                 DEST_SUFFIX   => $dsfx,
-                                 MAKEINFOFLAGS => $makeinfoflags,
-                                 DEPS          => "@deps",
-                                 DIRSTAMP      => $dirstamp);
+                                 DEPS             => "@deps",
+                                 DEST_PREFIX      => $dpfx,
+                                 DEST_INFO_PREFIX => $dipfx,
+                                 DEST_SUFFIX      => $dsfx,
+                                 DIRSTAMP         => $dirstamp,
+                                 GENERIC          => $generic,
+                                 GENERIC_INFO     => $generic_info,
+                                 INSRC            => $insrc,
+                                 MAKEINFOFLAGS    => $makeinfoflags,
+                                 SOURCE           => ($generic
+                                                      ? '$<' : $source),
+                                 SOURCE_INFO      => ($generic_info
+                                                      ? '$<' : $source),
+                                 SOURCE_REAL      => $source,
+                                 SOURCE_SUFFIX    => $ssfx,
+                                 );
   return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps", "$dpfx.html");
 }
 
@@ -2682,6 +2698,15 @@
   my $done = 0;
   my @texi_cleans;
 
+  # Build a regex matching user-cleaned files.
+  my $d = var 'DISTCLEANFILES';
+  my $c = var 'CLEANFILES';
+  my @f = ();
+  push @f, $d->value_as_list_recursive (TRUE) if $d;
+  push @f, $c->value_as_list_recursive (TRUE) if $c;
+  @f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$&|g; s|\*|[^/]*|g; $_; } @f;
+  my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$';
+
   foreach my $texi ($info_texinfos->value_as_list_recursive ('all'))
     {
       my $infobase = $texi;
@@ -2711,10 +2736,114 @@
       $outdir = "" if $outdir eq './';
       $out_file =  $outdir . $out_file;
 
+      # Until Automake 1.6.3, .info files were built in the
+      # source tree.  This was an obstacle to the support of
+      # non-distributed .info files, and non-distributed .texi
+      # files.
+      #
+      # * Non-distributed .texi files is important in some packages
+      #   where .texi files are built at make time, probably using
+      #   other binaries built in the package itself, maybe using
+      #   tools or information found on the build host.  Because
+      #   these files are not distributed they are always rebuilt
+      #   at make time; they should therefore not lie in the source
+      #   directory.  One plan was to support this using
+      #   nodist_info_TEXINFOS or something similar.  (Doing this
+      #   requires some sanity checks.  For instance Automake should
+      #   not allow:
+      #      dist_info_TEXINFO = foo.texi
+      #      nodist_foo_TEXINFO = included.texi
+      #   because a distributed file should never depend on a
+      #   non-distributed file.)
+      #
+      # * If .texi files are not distributed, then .info files should
+      #   not be distributed either.  There are also cases where one
+      #   want to distribute .texi files, but do not want to
+      #   distribute the .info files.  For instance the Texinfo package
+      #   distributes the tool used to build these files; it would
+      #   be a waste of space to distribute them.  It's not clear
+      #   which syntax we should use to indicate that .info files should
+      #   not be distributed.  Akim Demaille suggested that eventually
+      #   we switch to a new syntax:
+      #   |  Maybe we should take some inspiration from what's already
+      #   |  done in the rest of Automake.  Maybe there is too much
+      #   |  syntactic sugar here, and you want
+      #   |     nodist_INFO = bar.info
+      #   |     dist_bar_info_SOURCES = bar.texi
+      #   |     bar_texi_DEPENDENCIES = foo.texi
+      #   |  with a bit of magic to have bar.info represent the whole
+      #   |  bar*info set.  That's a lot more verbose that the current
+      #   |  situation, but it is # not new, hence the user has less
+      #   |  to learn.
+      #          |
+      #   |  But there is still too much room for meaningless specs:
+      #   |     nodist_INFO = bar.info
+      #   |     dist_bar_info_SOURCES = bar.texi
+      #   |     dist_PS = bar.ps something-written-by-hand.ps
+      #   |     nodist_bar_ps_SOURCES = bar.texi
+      #   |     bar_texi_DEPENDENCIES = foo.texi
+      #   |  here bar.texi is dist_ in line 2, and nodist_ in 4.
+      #
+      # Back to the point, it should be clear that in order to support
+      # non-distributed .info files, we need to build them in the
+      # build tree, not in the source tree (non-distributed .texi
+      # files are less of a problem, because we do not output build
+      # rules for them).  In Automake 1.7 .info build rules have been
+      # largely cleaned up so that .info files get always build in the
+      # build tree, even when distributed.  The idea was that
+      #   (1) if during a VPATH build the .info file was found to be
+      #       absent or out-of-date (in the source tree or in the
+      #       build tree), Make would rebuild it in the build tree.
+      #       If an up-to-date source-tree of the .info file existed,
+      #       make would not rebuild it in the build tree.
+      #   (2) having two copies of .info files, one in the source tree
+      #       and one (newer) in the build tree is not a problem
+      #       because `make dist' always pick files in the build tree
+      #       first.
+      # However it turned out the be a bad idea for several reasons:
+      #   * Tru64, OpenBSD, and FreeBSD (not NetBSD) Make do behave
+      #     like GNU Make on point (1) above.  These implementations
+      #     of Make would always rebuild .info files in the build
+      #     tree, even if such files were up to date in the source
+      #     tree.  Consequently, it was impossible the perform a VPATH
+      #     build of a package containing Texinfo files using these
+      #     Make implementations.
+      #     (Refer to the Autoconf Manual, section "Limitation of
+      #     Make", paragraph "VPATH", item "target lookup", for
+      #     an account of the differences between these
+      #     implementations.)
+      #   * The GNU Coding Standards require these files to be built
+      #     in the source-tree (when they are distributed, that is).
+      #   * Keeping a fresher copy of distributed files in the
+      #     build tree can be annoying during development because
+      #     - if the files is kept under CVS, you really want it
+      #       to be updated in the source tree
+      #     - it os confusing that `make distclean' does not erase
+      #       all files in the build tree.
+      #
+      # Consequently, starting with Automake 1.8, .info files are
+      # built in the source tree again.  Because we still plan to
+      # support non-distributed .info files at some point, we
+      # have a single variable ($INSRC) that controls whether
+      # the current .info file must be built in the source tree
+      # or in the build tree.  Actually this variable is switched
+      # off for .info files that appear to be cleaned; this is
+      # for backward compatibility with package such as Texinfo,
+      # which do things like
+      #   info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+      #   DISTCLEANFILES = texinfo texinfo-* info*.info*
+      #   # Do not create info files for distribution.
+      #   dist-info:
+      # in order not to distribute .info files.
+      my $insrc = ($out_file =~ $user_cleaned_files) ? 0 : 1;
+
+      my $soutdir = '$(srcdir)/' . $outdir;
+      $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"))
@@ -2724,7 +2853,7 @@
        }
 
       my ($dirstamp, @cfiles) =
-       output_texinfo_build_rules ($texi, $out_file, @texi_deps);
+       output_texinfo_build_rules ($texi, $out_file, $insrc, @texi_deps);
       push (@texi_cleans, @cfiles);
 
       push (@info_deps_list, $out_file);
@@ -2769,8 +2898,8 @@
                                          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);
        }
@@ -2814,7 +2943,6 @@
       unshift (@all, '$(INFO_DEPS)');
     }
 
-  define_variable ("INFO_DEPS", "@info_deps_list", INTERNAL);
   define_files_variable ("DVIS", @infobase, 'dvi', INTERNAL);
   define_files_variable ("PDFS", @infobase, 'pdf', INTERNAL);
   define_files_variable ("PSS", @infobase, 'ps', INTERNAL);
Index: doc/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/doc/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- doc/Makefile.in     27 Oct 2003 07:51:59 -0000      1.6
+++ doc/Makefile.in     8 Nov 2003 12:55:01 -0000
@@ -43,15 +43,15 @@
        $(top_srcdir)/m4/strip.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
-DIST_COMMON = $(automake_TEXINFOS) $(srcdir)/Makefile.in Makefile.am \
-       stamp-vti version.texi
+DIST_COMMON = $(automake_TEXINFOS) $(srcdir)/Makefile.in \
+       $(srcdir)/stamp-vti $(srcdir)/version.texi Makefile.am
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 SOURCES =
 DIST_SOURCES =
+INFO_DEPS = $(srcdir)/automake.info
 TEXINFO_TEX = $(top_srcdir)/lib/texinfo.tex
 am__TEXINFO_TEX_DIR = $(top_srcdir)/lib
-INFO_DEPS = automake.info
 DVIS = automake.dvi
 PDFS = automake.pdf
 PSS = automake.ps
@@ -173,6 +173,7 @@
 .texi.info:
        restore=: && \
        backupdir="$(am__leading_dot)am$$$$" && \
+       am__cwd=`pwd` && cd $(srcdir) && \
        rm -rf $$backupdir && mkdir $$backupdir && \
        for f in $@ address@hidden address@hidden $(@:.info=).i[0-9] 
$(@:.info=).i[0-9][0-9]; do \
          if test -f $$f; then \
@@ -180,10 +181,15 @@
            restore=mv; \
          fi; \
        done; \
+       cd "$$am__cwd"; \
        if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-        -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-       then rc=0; else \
+        -o $@ $<; \
+       then \
+         rc=0; \
+         cd $(srcdir); \
+       else \
          rc=$$?; \
+         cd $(srcdir) && \
          $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
        fi; \
        rm -rf $$backupdir; \
@@ -202,29 +208,29 @@
 .texi.html:
        $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) --html -I $(srcdir) \
         -o $@ $<
-automake.info: automake.texi version.texi $(automake_TEXINFOS)
-automake.dvi: automake.texi version.texi $(automake_TEXINFOS)
-automake.pdf: automake.texi version.texi $(automake_TEXINFOS)
-automake.html: automake.texi version.texi $(automake_TEXINFOS)
-version.texi:  stamp-vti
-stamp-vti: automake.texi $(top_srcdir)/configure
+$(srcdir)/automake.info: automake.texi $(srcdir)/version.texi 
$(automake_TEXINFOS)
+automake.dvi: automake.texi $(srcdir)/version.texi $(automake_TEXINFOS)
+automake.pdf: automake.texi $(srcdir)/version.texi $(automake_TEXINFOS)
+automake.html: automake.texi $(srcdir)/version.texi $(automake_TEXINFOS)
+$(srcdir)/version.texi:  $(srcdir)/stamp-vti
+$(srcdir)/stamp-vti: automake.texi $(top_srcdir)/configure
        @(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 version.texi \
-         || (echo "Updating version.texi"; \
-             cp vti.tmp version.texi)
+       @cmp -s vti.tmp $(srcdir)/version.texi \
+         || (echo "Updating $(srcdir)/version.texi"; \
+             cp vti.tmp $(srcdir)/version.texi)
        address@hidden -f vti.tmp
-       @cp version.texi $@
+       @cp $(srcdir)/version.texi $@
 
 mostlyclean-vti:
        -rm -f vti.tmp
 
 maintainer-clean-vti:
-       -rm -f stamp-vti version.texi
+       -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
 .dvi.ps:
        $(DVIPS) -o $@ $<
 
@@ -251,8 +257,12 @@
        done
 
 dist-info: $(INFO_DEPS)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
        list='$(INFO_DEPS)'; \
        for base in $$list; do \
+         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*; do \
            relfile=`expr "$$file" : "$$d/\(.*\)"`; \
Index: lib/am/texibuild.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texibuild.am,v
retrieving revision 1.17
diff -u -r1.17 texibuild.am
--- lib/am/texibuild.am 14 Apr 2003 19:59:30 -0000      1.17
+++ lib/am/texibuild.am 8 Nov 2003 12:55:02 -0000
@@ -19,12 +19,12 @@
 
 
 ?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%:
-?!GENERIC_INFO?%DEST_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
+?!GENERIC_INFO?%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
 ## 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%
+?!INSRC??DIRSTAMP?     @test -f %DIRSTAMP% || $(MAKE) %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),
@@ -36,6 +36,7 @@
 ## *.iNN files are used on DJGPP.  See the comments in install-info-am
        restore=: && \
        backupdir="$(am__leading_dot)am$$$$" && \
+?INSRC?        am__cwd=`pwd` && cd $(srcdir) && \
        rm -rf $$backupdir && mkdir $$backupdir && \
        for f in $@ address@hidden address@hidden $(@:.info=).i[0-9] 
$(@:.info=).i[0-9][0-9]; do \
          if test -f $$f; then \
@@ -43,16 +44,25 @@
            restore=mv; \
          fi; \
        done; \
+?INSRC?        cd "$$am__cwd"; \
        if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-        -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
-       then rc=0; else \
+?!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?          cd $(srcdir); \
+       else \
          rc=$$?; \
 ## Beware that backup info files might come from a subdirectory.
+?INSRC?          cd $(srcdir) && \
          $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
        fi; \
        rm -rf $$backupdir; \
        exit $$rc
 
+INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
+
 ?GENERIC?%SOURCE_SUFFIX%.dvi:
 ?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
        TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
@@ -83,7 +93,7 @@
 ## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
 ## rules.)
 if %?GENERIC_INFO%
-%DEST_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
+%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
 endif %?GENERIC_INFO%
 if %?GENERIC%
 %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
Index: lib/am/texinfos.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texinfos.am,v
retrieving revision 1.106
diff -u -r1.106 texinfos.am
--- lib/am/texinfos.am  3 Oct 2003 08:58:00 -0000       1.106
+++ lib/am/texinfos.am  8 Nov 2003 12:55:02 -0000
@@ -222,8 +222,12 @@
 if %?LOCAL-TEXIS%
 .PHONY: dist-info
 dist-info: $(INFO_DEPS)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
        list='$(INFO_DEPS)'; \
        for base in $$list; do \
+         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*; do \
 ## Strip leading '$$d/'.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.522
diff -u -r1.522 Makefile.am
--- tests/Makefile.am   27 Oct 2003 21:17:15 -0000      1.522
+++ tests/Makefile.am   8 Nov 2003 12:55:05 -0000
@@ -476,6 +476,9 @@
 txinfo20.test \
 txinfo21.test \
 txinfo22.test \
+txinfo23.test \
+txinfo24.test \
+txinfo25.test \
 transform.test \
 unused.test \
 vars.test \
Index: tests/txinfo13.test
===================================================================
RCS file: /cvs/automake/automake/tests/txinfo13.test,v
retrieving revision 1.2
diff -u -r1.2 txinfo13.test
--- tests/txinfo13.test 14 Apr 2003 19:13:15 -0000      1.2
+++ tests/txinfo13.test 8 Nov 2003 12:55:05 -0000
@@ -62,4 +62,5 @@
 cd build
 ../configure
 $MAKE distcheck
-test -f subdir/main.info
+test -f ../subdir/main.info
+test ! -f subdir/main.info
Index: tests/txinfo16.test
===================================================================
RCS file: /cvs/automake/automake/tests/txinfo16.test,v
retrieving revision 1.1
diff -u -r1.1 txinfo16.test
--- tests/txinfo16.test 13 Jan 2003 19:17:54 -0000      1.1
+++ tests/txinfo16.test 8 Nov 2003 12:55:05 -0000
@@ -18,7 +18,7 @@
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-# Check that info files are built in $(srcdir).
+# Check that info files are not built in $(srcdir).
 
 required='makeinfo tex'
 . ./defs || exit 1
@@ -49,15 +49,20 @@
 cd build
 ../configure
 $MAKE
-test -f main.info
+test -f ../main.info
+test ! -f main.info
+test -f ../stamp-vti
+test ! -f stamp-vti
+test -f ../version.texi
+test ! -f version.texi
 
 cd ..
-rm -rf build
+rm -rf build make.info* stamp-vti version.texi
 ./configure
 $MAKE
 test -f main.info
 
-# Make sur stamp-vti is older that version.texi.
+# Make sure 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
Index: tests/txinfo23.test
===================================================================
RCS file: tests/txinfo23.test
diff -N tests/txinfo23.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/txinfo23.test 8 Nov 2003 12:55:05 -0000
@@ -0,0 +1,66 @@
+#! /bin/sh
+# Copyright (C) 2002, 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 autoconf; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check for subdir Texinfo in $(srcdir).
+# (Similar to txinfo13.test, plus DISTCLEANFILES.)
+
+required='makeinfo tex texi2dvi-o'
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+DISTCLEANFILES = subdir/*.info*
+info_TEXINFOS = subdir/main.texi
+subdir_main_TEXINFOS = subdir/inc.texi
+
+installcheck-local:
+       test -f $(infodir)/main.info
+END
+
+mkdir subdir
+
+cat > subdir/main.texi << 'END'
+\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
+Hello walls.
address@hidden version.texi
address@hidden inc.texi
address@hidden
+END
+
+cat > subdir/inc.texi << 'END'
+I'm included.
+END
+
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+mkdir build
+cd build
+../configure
+$MAKE distcheck
+test -f subdir/main.info
Index: tests/txinfo24.test
===================================================================
RCS file: tests/txinfo24.test
diff -N tests/txinfo24.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/txinfo24.test 8 Nov 2003 12:55:05 -0000
@@ -0,0 +1,83 @@
+#! /bin/sh
+# Copyright (C) 2002, 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 autoconf; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check that info files are built in builddir when needed.
+# (Similar to txinfo16.test, plus CLEANFILES.)
+
+required='makeinfo tex'
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+CLEANFILES = main.info
+info_TEXINFOS = main.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
+Hello walls.
address@hidden version.texi
address@hidden
+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 sure stamp-vti is older that version.texi.
+# (A common situation in a real tree.)
+test -f stamp-vti
+test -f version.texi
+$sleep
+touch stamp-vti
+
+$MAKE distclean
+test -f stamp-vti
+test -f version.texi
+
+mkdir build
+cd build
+../configure
+$MAKE
+# main.info should be rebuilt in the current directory
+test -f main.info
+test ! -f ../main.info
+$MAKE dvi
+test -f main.dvi
+
+$MAKE distcheck
Index: tests/txinfo25.test
===================================================================
RCS file: tests/txinfo25.test
diff -N tests/txinfo25.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/txinfo25.test 8 Nov 2003 12:55:05 -0000
@@ -0,0 +1,110 @@
+#! /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 autoconf; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Similar to texinfo24.test, but with two info files, only one of
+# which being cleaned.
+
+required='makeinfo tex'
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+CLEANFILES = [a-m]*.info
+info_TEXINFOS = main.texi other.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
+Hello walls.
address@hidden version.texi
address@hidden
+END
+
+cat > other.texi << 'END'
+\input texinfo
address@hidden other.info
address@hidden other
address@hidden Top
+Hello walls.
address@hidden version2.texi
address@hidden
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+mkdir build
+cd build
+../configure
+$MAKE
+test -f main.info
+test ! -f ../main.info
+test ! -f other.info
+test -f ../other.info
+
+cd ..
+rm -rf build
+./configure
+$MAKE
+test -f main.info
+test -f other.info
+
+# Make sure 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
+test -f stamp-1
+test -f version2.texi
+$sleep
+touch stamp-vti
+touch stamp-1
+
+$MAKE distclean
+test -f stamp-vti
+test -f stamp-1
+test -f version.texi
+test -f version2.texi
+
+mkdir build
+cd build
+../configure
+$MAKE
+# other.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
+test ! -f other.info
+$MAKE dvi
+test -f main.dvi
+test -f other.dvi
+
+$MAKE distcheck
Index: tests/txinfo3.test
===================================================================
RCS file: /cvs/automake/automake/tests/txinfo3.test,v
retrieving revision 1.1
diff -u -r1.1 txinfo3.test
--- tests/txinfo3.test  13 Jan 2003 19:17:54 -0000      1.1
+++ tests/txinfo3.test  8 Nov 2003 12:55:05 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1997, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -49,7 +49,7 @@
 # We should not use single suffix inference rules (with separate
 # dependencies), this confuses Solaris make.
 grep '^.texi:$' Makefile.in && exit 1
-grep '^textutils: textutils.texi' Makefile.in
+grep 'textutils: textutils.texi' Makefile.in
 
 ./configure
 $MAKE distcheck
Index: tests/vtexi.test
===================================================================
RCS file: /cvs/automake/automake/tests/vtexi.test,v
retrieving revision 1.14
diff -u -r1.14 vtexi.test
--- tests/vtexi.test    6 Sep 2003 05:36:57 -0000       1.14
+++ tests/vtexi.test    8 Nov 2003 12:55:05 -0000
@@ -1,5 +1,6 @@
 #!/bin/sh
-# Copyright (C) 1996, 1997, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003
+#   Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -46,15 +47,15 @@
 #   textutils.info: textutils.texi version.texi
 # (Today this should be `textutils.info: version.texi')
 
-grep '^textutils\.info:.*version\.texi$' Makefile.in
+grep 'textutils\.info:.*version\.texi$' Makefile.in
 
 
 # Test for bug reported by Lars Hecking:
 # When running the first version of configure.ac aware automake,
 # @CONFIGURE_AC@ was not properly substituted.
 
-$EGREP '^stamp-vti:.*textutils\.texi( .*)?$' Makefile.in
-$EGREP '^stamp-vti:.*\$\(top_srcdir\)/configure( .*)?$' Makefile.in
+$EGREP 'stamp-vti:.*textutils\.texi( .*)?$' Makefile.in
+$EGREP 'stamp-vti:.*\$\(top_srcdir\)/configure( .*)?$' Makefile.in
 
 
 # Check that the path to mdate-sh is correct.  Over escaping of `$'
-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]