bug-autoconf
[Top][All Lists]
Advanced

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

2.58: wrong @abs_*@ computation, autoconf no longer bootstrap :( (Was: R


From: Alexandre Duret-Lutz
Subject: 2.58: wrong @abs_*@ computation, autoconf no longer bootstrap :( (Was: Re: AC_CONFIG_FILES assumes that build directories have sibling in the source tree)
Date: Tue, 04 Nov 2003 21:41:01 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

>>> "Akim" == Akim Demaille <address@hidden> writes:

[...]

 Akim> I installed it as the following.

 Akim> Index: ChangeLog
 Akim> from  Akim Demaille  <address@hidden>

 Akim> AC_CONFIG_FILE([d1/foo:d2/foo]) triggers error messages when
 Akim> computing the absolute path to d1 in the source hierarchy: it may
 Akim> not exist at all.  So don't cd into it.
 Akim> From Alexandre Duret-Lutz.
 Akim> http://mail.gnu.org/archive/html/bug-autoconf/2003-10/msg00205.html

 Akim> * lib/m4sugar/m4sh.m4 (AS_SET_CATFILE): New.
 Akim> From Paul Eggert, but named after Perl's IO::Spec->catfile.
 Akim> * doc/autoconf.texi (Programming in M4sh): Document.
 Akim> * lib/autoconf/status.m4 (_AC_SRCPATHS): Use it.

I'm sorry I'm just testing this, now that 2.58 is released.
This patch breaks the Automake test suite :(

The reason is that Automake (like Autoconf) is building a
wrapper from "test/automake.in" in which
"@abs_top_builddir@/automake" is executed.

In the past, "@abs_top_builddir@/automake" used to be
substituted with something like "/build/tree/automake", but now
it becomes "tests/.././automake".  I.e., this is no longer an
absolute path.

Although Autoconf uses a similar trick, the issue was not
apparent because the configure script shipped with autoconf-2.58
was built with an earlier version [*] that still uses the old
pwd-based computation of "@abs_top_builddir@".  If you rebuild
Autoconf's configure with autoconf-2.58, you'll see that
Autoconf now fails to build.

[*] version 2.57f which BTW still suffers from the pdksh "((" bug.

Here is a proposal.

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

        * lib/autoconf/status.m4 (_AC_SRCPATHS): Fix use of AS_SET_CATFILE
        so that ac_abs_builddir, ac_abs_top_builddir, ac_abs_srcdir,
        and ac_abs_top_srcdir be absolute paths.
        * lib/m4sugar/m4sh.m4 (AS_SET_CATFILE): Remove misleading comment.

Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.38
diff -u -r1.38 status.m4
--- lib/autoconf/status.m4      4 Nov 2003 08:32:07 -0000       1.38
+++ lib/autoconf/status.m4      4 Nov 2003 20:34:39 -0000
@@ -160,10 +160,14 @@
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-AS_SET_CATFILE([ac_abs_builddir],     [$1], [$ac_builddir])
-AS_SET_CATFILE([ac_abs_top_builddir], [$1], [${ac_top_builddir}.])
-AS_SET_CATFILE([ac_abs_srcdir],       [$1], [$ac_srcdir])
-AS_SET_CATFILE([ac_abs_top_srcdir],   [$1], [$ac_top_srcdir])
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+AS_SET_CATFILE([ac_abs_builddir],   [`pwd`],            [$1])
+AS_SET_CATFILE([ac_abs_top_builddir],
+                                   [$ac_abs_builddir], [${ac_top_builddir}.])
+AS_SET_CATFILE([ac_abs_srcdir],     [$ac_abs_builddir], [$ac_srcdir])
+AS_SET_CATFILE([ac_abs_top_srcdir], [$ac_abs_builddir], [$ac_top_srcdir])
 ])# _AC_SRCPATHS
 
 
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.105
diff -u -r1.105 m4sh.m4
--- lib/m4sugar/m4sh.m4 4 Nov 2003 08:32:07 -0000       1.105
+++ lib/m4sugar/m4sh.m4 4 Nov 2003 20:34:41 -0000
@@ -752,8 +752,6 @@
 # ----------------------------------------
 # Set VAR to DIR-NAME/FILE-NAME.
 # Optimize the common case where $2 or $3 is '.'.
-# Don't blindly perform a $1=`cd $2/$3 && pwd`, since $3 can be absolute,
-# and also $3 might not exist yet.
 m4_define([AS_SET_CATFILE],
 [case $2 in
 .) $1=$3;;
-- 
Alexandre Duret-Lutz





reply via email to

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