libtool-patches
[Top][All Lists]
Advanced

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

libtool --help: honor $AUTOCONF, $AUTOMAKE


From: Ralf Wildenhues
Subject: libtool --help: honor $AUTOCONF, $AUTOMAKE
Date: Sat, 20 Nov 2010 10:30:37 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

I came across an interesting bug: the perl coverage output for a full
run of the Automake test suite was showing a single invocation of the
installed automake program, rather than the uninstalled
  $builddir/tests/automake-1.11a

which should have been run.

Some tracking revealed that this happened in automake/tests/subobj9.test
which looks innocent enough.  Turns out that it comes from './libtool
--help' which tries to be helpful in printing some 'automake --version'
output.  This is flawed for a couple of reasons: the automake command at
the time './libtool --help' is run may be unrelated to the automake used
for bootstrapping the package; also, the user may have wanted to use an
override by setting $AUTOMAKE.

Now, the issue could be fixed with the two patches below, to Libtool and
Automake, respectively.  Question is whether we could do better than
that:

In Libtool, getopt.m4sh is used for the libtoolize and libtool scripts.
For libtoolize, it seems appropriate to do as below.  For libtool, the
best answer would be the Autoconf and Automake versions used to
bootstrap the package that created this particular libtool script.

Comments before I apply?

Thanks,
Ralf

    Avoid running installed automake from 'libtool --help'.
    
    * tests/subobj9.test: Export AUTOCONF and AUTOMAKE.
    Together with fixed Libtool, this fixes check-coverage to not
    invoke installed automake.

diff --git a/tests/subobj9.test b/tests/subobj9.test
index 2045d58..83f3a31 100755
--- a/tests/subobj9.test
+++ b/tests/subobj9.test
@@ -64,6 +64,9 @@ $AUTOMAKE -a
 # Skip this test on configure errors (e.g., broken C++ compilers).
 ./configure || Exit 77
 
+# Ensure './libtool --help' will use the right tool versions.
+export AUTOCONF AUTOMAKE
+
 # Opportunistically check that --tag=CXX is used when supported.
 if ./libtool --help | grep tag=TAG; then
   $MAKE print >stdout || { cat stdout; Exit 1; }



    Honor $AUTOCONF, $AUTOMAKE in --help output.
    
    * libltdl/config/getopt.m4sh (func_help): Use $AUTOCONF and
    $AUTOMAKE if set, for --version outout.

diff --git a/libltdl/config/getopt.m4sh b/libltdl/config/getopt.m4sh
index 2196743..e9363bc 100644
--- a/libltdl/config/getopt.m4sh
+++ b/libltdl/config/getopt.m4sh
@@ -592,8 +592,8 @@ func_help ()
        s*\$LTCFLAGS*'"$LTCFLAGS"'*
        s*\$LD*'"$LD"'*
        s/\$with_gnu_ld/'"$with_gnu_ld"'/
-       s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-       s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+       s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null 
|$SED 1q`"'/
+       s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null 
|$SED 1q`"'/
        p
        d
      }



reply via email to

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