automake-patches
[Top][All Lists]
Advanced

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

[FYI] {master} texinfo: remove hack about info files in CLEANFILES varia


From: Stefano Lattarini
Subject: [FYI] {master} texinfo: remove hack about info files in CLEANFILES variables
Date: Sun, 28 Dec 2014 16:53:01 +0100

Automake used to implement an undocumented hack causing '.info' files
that appeared to be cleaned (by e.g. being listed in the CLEANFILES
variable) to also be built in the builddir rather than in the srcdir;
this was for backward compatibility with packages such as Texinfo,
which did 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.

Now that we have the 'info-in-builddir' option that explicitly causes
generated '.info' files to be placed in the builddir, this hack is no
longer necessary, and we can remove it (after having deprecated it in
the Automake 1.14 release already).

* bin/automake.in (handle_texinfo_helper): Remove the hack.  Adjust
comments accordingly.
* NEWS: Update.
* t/txinfo23.sh: Delete as obsolete.
* t/txinfo25.sh: Likewise.
* t/txinfo24.sh: Likewise.
* t/txinfo28.sh: Delete as mostly obsolete, its only still relevant
parts moved ...
* t/mdate5.sh: ... into this test.
* t/txinfo-clean.sh: Remove references to deleted tests.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 NEWS               |  22 +++++++++-
 bin/automake.in    |  66 ++++++------------------------
 t/list-of-tests.mk |   4 --
 t/mdate5.sh        |  51 ++++++++++++++---------
 t/txinfo-clean.sh  |   1 -
 t/txinfo23.sh      |  69 -------------------------------
 t/txinfo24.sh      |  83 --------------------------------------
 t/txinfo25.sh      | 116 -----------------------------------------------------
 t/txinfo28.sh      |  89 ----------------------------------------
 9 files changed, 65 insertions(+), 436 deletions(-)
 delete mode 100644 t/txinfo23.sh
 delete mode 100644 t/txinfo24.sh
 delete mode 100644 t/txinfo25.sh
 delete mode 100644 t/txinfo28.sh

diff --git a/NEWS b/NEWS
index 3d8b363..bb011a8 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,26 @@ New in 2.0:
    and later will *unconditionally* behave as older Automake versions did
    when the 'subdir-objects' option was given.
 
+* Texinfo support:
+
+  - Automake used to implement an undocumented hack causing '.info' files
+    that appeared to be cleaned (by e.g. being listed in the CLEANFILES
+    variable) to also be built in the builddir rather than in the srcdir;
+    this was for backward compatibility with packages such as Texinfo,
+    which did 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.
+
+    Now that we have the 'info-in-builddir' option that explicitly causes
+    generated '.info' files to be placed in the builddir, this hack is no
+    longer necessary.  We have thus removed\ it.
+
 * Aclocal search path:
 
   - Third-party m4 files located in the system-wide aclocal directory,
@@ -308,7 +328,7 @@ New in 1.14:
     Now that we have the 'info-in-builddir' option that explicitly causes
     generated '.info' files to be placed in the builddir, this hack should
     be longer necessary, so we deprecate it with runtime warnings.  It will
-    likely be removed altogether in Automake 2.0.
+    be removed altogether in Automake 2.0.
 
 * Relative directory in Makefile fragments:
 
diff --git a/bin/automake.in b/bin/automake.in
index c06fc0f..c6bf923 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -2948,15 +2948,6 @@ sub handle_texinfo_helper
   my $done = 0;
   my (@mostly_cleans, @texi_cleans, @maint_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 (inner_expand => 1) if $d;
-  push @f, $c->value_as_list_recursive (inner_expand => 1) 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 (inner_expand => 1))
     {
@@ -2996,6 +2987,7 @@ sub handle_texinfo_helper
       # generic rules.
       my $outdir = dirname ($texi) . '/';
       $outdir = "" if $outdir eq './';
+      my $src_outdir = '$(srcdir)/'. $outdir;
       $out_file =  $outdir . $out_file;
 
       # Until Automake 1.6.3, .info files were built in the
@@ -3086,54 +3078,22 @@ sub handle_texinfo_helper
       # 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
+      # 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 in two cases:
-      #  (1) 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.
-      #  (2) When the undocumented option 'info-in-builddir' is given.
-      #      This is done to allow the developers of GCC, GDB, GNU
-      #      binutils and the GNU bfd library to force the '.info' files
-      #      to be generated in the builddir rather than the srcdir, as
-      #      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')
-        {
-          $insrc = 0;
-        }
-      elsif ($out_file =~ $user_cleaned_files)
-        {
-          $insrc = 0;
-          msg 'obsolete', "$am_file.am", <<EOF;
-Oops!
-    It appears this file (or files included by it) are triggering
-    an undocumented, soon-to-be-removed automake hack.
-    Future automake versions will no longer place in the builddir
-    (rather than in the srcdir) the generated '.info' files that
-    appear to be cleaned, by e.g. being listed in CLEANFILES or
-    DISTCLEANFILES.
-    If you want your '.info' files to be placed in the builddir
-    rather than in the srcdir, you have to use the shiny new
-    'info-in-builddir' automake option.
-EOF
-        }
-
-      $outdir = $soutdir if $insrc;
+      # off when the automake option 'info-in-builddir' is given.
+      # This is done to allow the developers of GCC, GDB, GNU
+      # binutils and the GNU bfd library to force the '.info' files
+      # to be generated in the builddir rather than the srcdir, as
+      # was once done when the (now removed) 'cygnus' option was
+      # given.  See automake bug#11034 for more discussion.
+      my $insrc = ! option 'info-in-builddir';
+      $outdir = $src_outdir if $insrc;
 
       # If user specified file_TEXINFOS, then use that as explicit
       # dependency list.
       @texi_deps = ();
-      push (@texi_deps, "${soutdir}${vtexi}") if $vtexi;
+      push (@texi_deps, "${src_outdir}${vtexi}") if $vtexi;
 
       my $canonical = canonicalize ($infobase);
       if (var ($canonical . "_TEXINFOS"))
@@ -3187,8 +3147,8 @@ EOF
                                          new Automake::Location,
                                          TEXI     => $texi,
                                          VTI      => $vti,
-                                         STAMPVTI => "${soutdir}stamp-$vti",
-                                         VTEXI    => "$soutdir$vtexi",
+                                         STAMPVTI => "${src_outdir}stamp-$vti",
+                                         VTEXI    => "${src_outdir}$vtexi",
                                          MDDIR    => $conf_dir,
                                          DIRSTAMP => $dirstamp);
        }
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 630417c..85f58ad 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1220,10 +1220,6 @@ t/txinfo-vtexi2.sh \
 t/txinfo-vtexi3.sh \
 t/txinfo-vtexi4.sh \
 t/txinfo-without-info-suffix.sh \
-t/txinfo23.sh \
-t/txinfo24.sh \
-t/txinfo25.sh \
-t/txinfo28.sh \
 t/transform.sh \
 t/transform2.sh \
 t/transform3.sh \
diff --git a/t/mdate5.sh b/t/mdate5.sh
index 89ee0c4..108569e 100644
--- a/t/mdate5.sh
+++ b/t/mdate5.sh
@@ -21,25 +21,36 @@ am_create_testdir=empty
 
 get_shell_script mdate-sh
 
-set x $(./mdate-sh mdate-sh)
-shift
-echo "$*" # For debugging.
-
-# Check that mdate output looks like a date:
-test $# = 3
-case $1$3 in *[!0-9]*) exit 1;; esac
-test $1 -lt 32
-# Hopefully automake will be obsolete in 80 years ;-)
-case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac
-case $2 in
-  January|February|March|April|May|June|July|August) ;;
-  September|October|November|December) ;;
-  *) exit 1
-esac
-
-# Stricter checks on the year required a POSIX date(1) command.
-if year=$(date +%Y) && test $year -gt 2010; then
-  test $year = $3 || exit 1
-fi
+year=$(date +%Y) && test $year -gt 2010 || year=NONE
+
+do_checks ()
+{
+  set x $(./mdate-sh mdate-sh)
+  shift
+  echo "$*" # For debugging.
+
+  # Check that mdate output looks like a date.
+  test $# = 3 || exit 1
+  case $1$3 in *[!0-9]*) exit 1;; esac
+  test $1 -lt 32 || exit 1
+  # Hopefully automake will be obsolete in 80 years ;-)
+  case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac
+  case $2 in
+    January|February|March|April|May|June|July|August) ;;
+    September|October|November|December) ;;
+    *) exit 1
+  esac
+
+  # Stricter checks on the year require a POSIX date(1) command.
+  test $year = NONE || test $year = $3 || exit 1
+}
+
+TIME_STYLE=; unset TIME_STYLE
+do_checks
+
+# This setting, when honored by GNU ls, used to cause an infinite
+# loop in mdate-sh.
+TIME_STYLE="+%Y-%m-%d %H:%M:%S"; export TIME_STYLE
+do_checks
 
 :
diff --git a/t/txinfo-clean.sh b/t/txinfo-clean.sh
index b936e41..f5e8745 100644
--- a/t/txinfo-clean.sh
+++ b/t/txinfo-clean.sh
@@ -15,7 +15,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # DVIS, PDFS, PSS, HTMLS should not be cleaned upon 'mostlyclean'.
-# Similar to txinfo25.sh.
 
 required='makeinfo tex texi2dvi dvips'
 . test-init.sh
diff --git a/t/txinfo23.sh b/t/txinfo23.sh
deleted file mode 100644
index e71fc57..0000000
--- a/t/txinfo23.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
-#
-# This program 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.
-#
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir when needed.
-# Test with subdir Texinfo.
-# (Similar to txinfo13.sh, plus DISTCLEANFILES).
-# (See also txinfo24.sh and txinfo25.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-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
-$AUTOCONF
-
-AUTOMAKE_run --add-missing -Wno-error
-grep "Makefile\.am:.*undocumented.* automake hack" stderr
-grep "Makefile\.am:.*'info-in-builddir' automake option" stderr
-
-mkdir build
-cd build
-../configure
-$MAKE distcheck
-test -f subdir/main.info
-test ! -e ../subdir/main.info
-
-:
diff --git a/t/txinfo24.sh b/t/txinfo24.sh
deleted file mode 100644
index df202a8..0000000
--- a/t/txinfo24.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
-#
-# This program 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.
-#
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir when needed.
-# (Similar to txinfo16.sh, plus CLEANFILES).
-# (See also txinfo23.sh and txinfo25.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-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 -Wno-obsolete
-$AUTOCONF
-
-mkdir build
-cd build
-../configure
-$MAKE
-test ! -e ../main.info
-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 ! -e ../main.info
-$MAKE dvi
-test -f main.dvi
-
-$MAKE distcheck
-
-:
diff --git a/t/txinfo25.sh b/t/txinfo25.sh
deleted file mode 100644
index 8d7f127..0000000
--- a/t/txinfo25.sh
+++ /dev/null
@@ -1,116 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
-#
-# This program 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.
-#
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir and in srcdir can safely
-# co-exist.  This setup is obtained by having two info files, only one
-# of which being cleaned.
-# (Similar to txinfo16.sh, plus CLEANFILES).
-# (See also txinfo23.sh and txinfo24.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-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
-$AUTOCONF
-
-AUTOMAKE_fails --add-missing
-grep "Makefile\.am:.*undocumented.* automake hack" stderr
-grep "Makefile\.am:.*'info-in-builddir' automake option" stderr
-
-$AUTOMAKE --add-missing -Wno-obsolete
-
-mkdir build
-cd build
-../configure
-$MAKE
-test -f main.info
-test ! -e ../main.info
-test ! -e 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 ! -e other.info
-$MAKE dvi
-test -f main.dvi
-test -f other.dvi
-
-$MAKE distcheck
-
-:
diff --git a/t/txinfo28.sh b/t/txinfo28.sh
deleted file mode 100644
index 93929c3..0000000
--- a/t/txinfo28.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
-#
-# This program 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.
-#
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir when needed.
-# Similar to txinfo24.sh, but obfuscating filenames with variable
-# references.
-# Report from Ralf Corsepius.
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-# This setting, when honored by GNU ls, used to cause an infinite loop
-# in mdate-sh.
-TIME_STYLE="+%Y-%m-%d %H:%M:%S"
-export TIME_STYLE
-
-echo AC_OUTPUT >> configure.ac
-
-cat > Makefile.am << 'END'
-MA = ma
-IN = in
-PROJ = $(MA)$(IN)
-include fragment.mk
-info_TEXINFOS = ma$(IN).texi
-END
-
-echo 'CLEANFILES = $(PROJ).info' > fragment.mk
-
-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 -Wno-error
-$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 ! -e ../main.info
-$MAKE dvi
-test -f main.dvi
-
-$MAKE distcheck
-- 
2.1.3




reply via email to

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