automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] texi: info files can be generated in the builddir


From: Stefano Lattarini
Subject: Re: [PATCH] texi: info files can be generated in the builddir
Date: Wed, 02 Jan 2013 13:06:03 +0100

And here is the patch deprecating the "CLEANFILES hack".  This too is
for maint, and scheduled to appear in Automake 1.13.2.  I will push
it with together with the patch introducing the new 'info-in-builddir'
option, tomorrow.

Regards,
  Stefano

---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----

>From c1a8f56295d9c1621c65de28400cd1d93f037063 Mon Sep 17 00:00:00 2001
Message-Id: <address@hidden>
From: Stefano Lattarini <address@hidden>
Date: Wed, 2 Jan 2013 00:33:42 +0100
Subject: [PATCH] texi: deprecate hack about info files in CLEANFILES variables

For quite a long time, Automake has been implementing an undocumented
hack which ensured that '.info' files which appeared to be cleaned (by
e.g. being listed in the CLEANFILES or DISTCLEANFILES variables) were
built in the builddir rather than in the srcdir; this hack was introduced
to ensure better 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 should
be longer necessary, so we deprecate it with runtime warnings.  It is
scheduled to be removed altogether in Automake 1.14.

* automake.in (handle_texinfo_helper): Raise proper runtime warnings
if the hack is triggered.
* NEWS: Update.
* t/txinfo28.sh: Adjust.
* t/txinfo23.sh: Likewise.
* t/txinfo25.sh: Adjust and extend.
* t/txinfo24.sh: Likewise.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 NEWS          | 20 ++++++++++++++++++++
 automake.in   | 15 +++++++++++++++
 t/txinfo23.sh |  5 ++++-
 t/txinfo24.sh |  2 +-
 t/txinfo25.sh |  7 ++++++-
 t/txinfo28.sh |  2 +-
 6 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 804805e..6fd1c75 100644
--- a/NEWS
+++ b/NEWS
@@ -58,6 +58,26 @@ New in 1.13.2:
     bfd library.  See the extensive discussion about automake bug#11034
     for more details.

+  - For quite a long time, Automake has been implementing an undocumented
+    hack which ensured that '.info' files which appeared to be cleaned
+    (by e.g. being listed in the CLEANFILES or DISTCLEANFILES variables)
+    were built in the builddir rather than in the srcdir; this hack was
+    introduced to ensure better 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 generated '.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 should
+    be longer necessary, so we deprecate it with runtime warnings.  It will
+    likely be removed altogether in Automake 1.14.
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 New in 1.13.1:
diff --git a/automake.in b/automake.in
index e56ea65..fe7f459 100644
--- a/automake.in
+++ b/automake.in
@@ -3140,6 +3140,21 @@ sub handle_texinfo_helper ($)
   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;
+  if (@f && !option 'info-in-builddir')
+  {
+    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
+  }
   @f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$&|g; s|\*|[^/]*|g; $_; } @f;
   my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$';

diff --git a/t/txinfo23.sh b/t/txinfo23.sh
index c2b2797..6c2d9ce 100755
--- a/t/txinfo23.sh
+++ b/t/txinfo23.sh
@@ -53,9 +53,12 @@ I'm included.
 END

 $ACLOCAL
-$AUTOMAKE --add-missing
 $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
diff --git a/t/txinfo24.sh b/t/txinfo24.sh
index bfad312..9daa82e 100755
--- a/t/txinfo24.sh
+++ b/t/txinfo24.sh
@@ -41,7 +41,7 @@ Hello walls.
 END

 $ACLOCAL
-$AUTOMAKE --add-missing
+$AUTOMAKE --add-missing -Wno-obsolete
 $AUTOCONF

 mkdir build
diff --git a/t/txinfo25.sh b/t/txinfo25.sh
index 369a759..aad0cb7 100755
--- a/t/txinfo25.sh
+++ b/t/txinfo25.sh
@@ -53,9 +53,14 @@ Hello walls.
 END

 $ACLOCAL
-$AUTOMAKE --add-missing
 $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
diff --git a/t/txinfo28.sh b/t/txinfo28.sh
index 171632a..191a218 100755
--- a/t/txinfo28.sh
+++ b/t/txinfo28.sh
@@ -50,7 +50,7 @@ Hello walls.
 END

 $ACLOCAL
-$AUTOMAKE --add-missing
+$AUTOMAKE --add-missing -Wno-error
 $AUTOCONF

 mkdir build
-- 
1.8.1.rc3.27.g3b73c7d



reply via email to

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