[Linux-ha-dev] libltdl bugfix and improvement

David Lee t.d.lee at durham.ac.uk
Fri Aug 26 10:48:21 MDT 2005


Around July 10 (10/7), Andrew (after discussion with a few of us) adjusted 
the "configure" behaviour of heartbeat, and its interaction with possibly 
pre-installed libtool items.

This idea seems to have been a good and successful improvement.  But 
(there's always a "but", isn't there?!) I noticed at the time a minor 
technical problem, although it is only now (because of intervening 
holidays and unforeseen domestic issues) that I have got around to looking 
deeper.

Briefly: The tar and untar of the "libltdl" seems unnecessary. Worse, in 
some circumstances it can fail.  I think we can simply remove all that 
"tar" activity, yet still keep the benefits of Andrew's 10/7 work.

Detail:
1. "bootstrap" runs "libtoolize" which (amongst other things) produces
    a subdirectory "libltdl".  Note that this is done in the context of the
    _source_ directory tree.  Or, in autoconf terms, relative to "$srcdir"
    (although we're not actually in autoconf here).

2. Andrew's 10/7 work augments this "bootstrap" behaviour; it tars then
    removes, this "libltdl" subdirectory.

3. "configure" decides whether it needs the "libltdl" stuff (or instead
    should use the OS-installed things).  If needed, it untars that tar
    file.  That is, it simply aims to reinstate the "libltdl" subdirectory.
    BUT... this is being done in the context of the _build_, not source
    directory ($builddir, not $srcdir).

4. For most folk building heartbeat, $srcdir and $builddir are the same
    so this concpetual difference is irrelevant.  But where these are
    different the untar fails (as does, of course, subsequent activity that
    would use the result).

Basically, if "libltdl" is to be used, it is important that:
  (a) it actually be there (obviously!);
  (b) its placement be in the _source_ directory.

At first sight, the quick fix would be for configure to switch its context
from $builddir to $srcdir for this untar.  But:
  1. I think all this is unnecessary (see below);
  2. Building for multiple platforms (multiple $builddir) from a single
     source (single $srcdir), may well impose conflicting requirements.
     (From within configure, we ought to regard $srcdir as read-only.)

I think there is a simpler solution: simply remove all the tar/untar 
stuff.  This simply leaves "libltdl" in place (as it always had done prior 
to that 10/7 update), and configure chooses whether or not to use it.

I suspect the tar/untar is a redundant vestige of earlier stages of 
Andrew's changes, whose necessity quietly disappeared duing its later 
stages.

Below is the patch I propose.  This reverts "bootstrap" to its former
(pre-10/7) state and from "configure" removes the then-redundant untar.

------------------- snip ---------------------
--- bootstrap.orig	Fri Jul 29 11:41:21 2005
+++ bootstrap	Fri Aug 26 15:38:43 2005
@@ -161,14 +161,8 @@
    autoheader
  fi

-rm -rf libltdl libltdl.tar
  echo libtoolize --ltdl --force --copy
  libtoolize --ltdl --force --copy
-
-# Emulate the old --ltdl-tar option...
-#  If the libltdl directory is required we will unpack it later
-tar -cf libltdl.tar libltdl
-rm -rf libltdl

  echo automake --add-missing --include-deps --copy
  automake --add-missing --include-deps --copy
--- configure.in.orig	Fri Aug 26 15:02:23 2005
+++ configure.in	Fri Aug 26 15:37:57 2005
@@ -1218,7 +1218,6 @@
  if test $ac_cv_lib_ltdl_lt_dlopen != yes ; then
     AC_MSG_RESULT(Installing local ltdl)
     LIBLTDL_DIR=libltdl
-   $TAR -xvf libltdl.tar
     AC_CONFIG_SUBDIRS(libltdl)
  else
     LIBS="$LIBS -lltdl"
------------------- snip ---------------------

I've been testing this for a few days on a variety of machines, some 
requiring libltdl, some using the OS one; some with $srcdir == $builddir, 
some with them different.  It seems to work fine.  And it also seems to 
retain the speed-up (avoid multiple configure) changes that the remaining 
(non-tar) sections of Andrew's 10/7 work so beneficially introduced.


Thoughts?  (Particularly from Andrew, Horms and Alan, please.)


Particularly welcome would be the results of trials of that patch.  For 
simple "$srcdir == $builddir" (i.e "./configure [...]") use, it ought to 
be no different.  For "$srdir != $builddir" use, it ought to fix problems 
that you would previously have hit.



-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:                                           Durham University     :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :
-------------- next part --------------
--- bootstrap.orig	Fri Jul 29 11:41:21 2005
+++ bootstrap	Fri Aug 26 15:38:43 2005
@@ -161,14 +161,8 @@
   autoheader
 fi
 
-rm -rf libltdl libltdl.tar
 echo libtoolize --ltdl --force --copy
 libtoolize --ltdl --force --copy
-
-# Emulate the old --ltdl-tar option...
-#  If the libltdl directory is required we will unpack it later
-tar -cf libltdl.tar libltdl
-rm -rf libltdl
 
 echo automake --add-missing --include-deps --copy
 automake --add-missing --include-deps --copy
--- configure.in.orig	Fri Aug 26 15:02:23 2005
+++ configure.in	Fri Aug 26 15:37:57 2005
@@ -1218,7 +1218,6 @@
 if test $ac_cv_lib_ltdl_lt_dlopen != yes ; then
    AC_MSG_RESULT(Installing local ltdl)
    LIBLTDL_DIR=libltdl
-   $TAR -xvf libltdl.tar
    AC_CONFIG_SUBDIRS(libltdl)
 else
    LIBS="$LIBS -lltdl"


More information about the Linux-HA-Dev mailing list