libtool-patches
[Top][All Lists]
Advanced

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

Re: FYI: 333-gary-refactor-LTDL_INIT.patch


From: Ralf Wildenhues
Subject: Re: FYI: 333-gary-refactor-LTDL_INIT.patch
Date: Wed, 16 Jan 2008 07:22:42 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Ralf Wildenhues wrote on Tue, Jan 08, 2008 at 08:34:05AM CET:
> * Gary V. Vaughan wrote on Tue, Jan 08, 2008 at 05:23:24AM CET:
> > >
> > >Sure you want to disallow users just passing in appropriate CPPFLAGS  
> > >and
> > >LDFLAGS to find an installed libltdl?  I would count that as an
> > >incompatible API change, too.
> > 
> > CPPFLAGS and LDFLAGS will continue to work as they always have done.  It
> > seems far too obvious to mention in the docs though.  I have noticed  
> > that many autotools users seem to prefer passing --enable/with-options
> > though so I'm providing those too.
> 
> Oh, I thought they wouldn't work.  Guess I should have tested that.

Nevermind.  The testsuite shows that they work.

> > >This fails to mention whether $(LIBLTDL) may be used as a dependency  
> > >in,
> > >say, libfoo_la_DEPENDENCIES.  The case where it is `-lltdl' is the
> > >tricky one, as it leads to a make error, so we may have to introduce
> > >another variable?  See M4 build failures on Bob's build farm for an
> > >example of this.
> > 
> > Hmm.  Bummer.  Could you add a test?  Or, Bob, if you could give me
> > access to your build logs, I'll look into creating one myself.
> 
> Sorry about the confusion.  I meant Bob Proulx, and these buildds:
> <http://www.proulx.com/sys/build-daemons/>
> Seems the M4 one is off-line ATM.

Below's a patch for that issue.

> > >These two paragraphs are factually wrong if top_build_prefix is
> > >available (i.e., with new enough Autoconf).
> > 
> > Oh.  Guess I haven't been paying attention to the Autoconf developments
> > for a while then :-(  What should I have written instead?
> 
> Well if $top_build_prefix is available, then that will be the start of
> the path names for LIBLTDL, instead of $top_builddir/
> The difference is that, in case $top_builddir is `.', $top_build_prefix
> is empty, which helps non-GNU make as they see `FILE' not `./FILE'
> (which isn't the same for them).

Also dealt with in the patch below.

OK to apply?

Cheers,
Ralf

2008-01-16  Ralf Wildenhues  <address@hidden>

        New variable LIBLTDL_DEP for use in output_DEPENDENCIES.
        * libltdl/m4/ltdl.m4 (_LTDL_CONVENIENCE, _LTDL_INSTALLABLE)
        (LTDL_INIT): Set and substitute LIBLTDL_DEP according to chosen
        method.
        * tests/configure-iface.at (installable libltdl)
        (--with-ltdl-include/lib, --with-included-ltdl): Test it.
        * doc/libtool.texi (Distributing libltdl): Document LIBLTDL_DEP.
        Also clarify that `${top_build_prefix}' may be used in place of
        `${top_builddir}/'.
        * NEWS: Update.
        Dependency bug exposed by Eric Blake in M4, found by Bob Proulx
        build daemon.

Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.214
diff -u -r1.214 NEWS
--- NEWS        12 Jan 2008 17:00:51 -0000      1.214
+++ NEWS        16 Jan 2008 06:21:03 -0000
@@ -52,6 +52,7 @@
     The Libtool package itself builds libltdl nonrecursively.
   - The 'nonrecursive', 'recursive' and 'subproject' libltdl build
     modes are given as LTDL_INIT options.
+  - New make variable LIBLTDL_DEP for use in output_DEPENDENCIES.
   - New multi-module-loader safe libltdl handle iteration APIs:
     lt_dlhandle_iterate, lt_dlhandle_fetch, lt_dlhandle_map.
   - New lt_dlinterface_register to maintain separation of concerns
Index: doc/libtool.texi
===================================================================
RCS file: /cvsroot/libtool/libtool/doc/libtool.texi,v
retrieving revision 1.234
diff -u -r1.234 libtool.texi
--- doc/libtool.texi    6 Jan 2008 16:33:30 -0000       1.234
+++ doc/libtool.texi    16 Jan 2008 06:21:06 -0000
@@ -4443,10 +4443,11 @@
 @option{--with-included-ltdl}.
 
 If an installed @code{libltdl} is found, then @code{LIBLTDL} is set to
-the link flags needed to use it, and @code{LTDLINCL} to the
-preprocessor flags needed to find the installed headers.  Note,
-however, that no version checking is performed.  You should manually
-check for the @code{libltdl} features you need in @file{configure.ac}:
+the link flags needed to use it, @code{LIBLTDL_DEP} is empty, and
address@hidden to the preprocessor flags needed to find the installed
+headers.  Note, however, that no version checking is performed.  You
+should manually check for the @code{libltdl} features you need in
address@hidden:
 
 @example
 LT_INIT([dlopen])
@@ -4585,7 +4586,7 @@
 to cause it to be built as a convenience library.  If you're not
 using automake, you will need to define @code{top_build_prefix},
 @code{top_builddir}, and @code{top_srcdir} in your makefile so that
address@hidden and @code{LTDLINCL} expand correctly.
address@hidden, @code{LIBLTDL_DEP}, and @code{LTDLINCL} expand correctly.
 
 One advantage of the convenience library is that it is not installed,
 so the fact that you use @code{libltdl} will not be apparent to the
@@ -4609,42 +4610,46 @@
 to cause it to be built as an installable library.  If you're not
 using automake, you will need to define @code{top_build_prefix},
 @code{top_builddir} and @code{top_srcdir} in your makefile so that
address@hidden and @code{LTDLINCL} are expanded properly.
address@hidden, @code{LIBLTDL_DEP}, and @code{LTDLINCL} are expanded
+properly.
 
 Be aware that you could overwrite another @code{libltdl} already
 installed to the same directory if you use this option.
 @end table
 @end defmac
 
-Whatever method you use, @samp{LTDL_INIT} will define both the shell
-variable @var{LIBLTDL} to the link flag that you should use to link
-with @code{libltdl}, and the shell variable @var{LTDLINCL} to the
-preprocessor flag that you should use to compile programs that
-include @file{ltdl.h}. So, when you want to link a program with
-libltdl, be it a convenience, installed or installable library, just
-use @samp{$(LTDLINCL)} for preprocessing and compilation, and
+Whatever method you use, @samp{LTDL_INIT} will define the shell variable
address@hidden to the link flag that you should use to link
+with @code{libltdl}, the shell variable @var{LIBLTDL_DEP} to the file
+that can be used as @command{make} dependency, and the shell variable
address@hidden to the preprocessor flag that you should use to compile
+programs that include @file{ltdl.h}. So, when you want to link a program
+with libltdl, be it a convenience, installed or installable library,
+just use @samp{$(LTDLINCL)} for preprocessing and compilation, and
 @samp{$(LIBLTDL)} for linking.
 
 @itemize @bullet
 @item
-If your package is built using an installed version of
address@hidden, @var{LIBLTDL} will be set to the compiler flags
-needed to link against the installed library, and
address@hidden will be set to the compiler flags needed to find
-the @code{libltdl} header files.
+If your package is built using an installed version of @code{libltdl},
address@hidden will be set to the compiler flags needed to link against
+the installed library, @var{LIBLTDL_DEP} will be empty, and
address@hidden will be set to the compiler flags needed to find the
address@hidden header files.
 
 @item
 If your package is built using the convenience libltdl, @var{LIBLTDL}
-will be the pathname for the convenience version of libltdl
-(starting with @address@hidden@}/}) and @var{LTDLINCL} will be
+and @var{LIBLTDL_DEP} will be the pathname for the convenience version
+of libltdl (starting with @address@hidden@}/} or
address@hidden@address@hidden), and @var{LTDLINCL} will be
 @option{-I} followed by the directory that contains @file{ltdl.h}
 (starting with @address@hidden@}/}).
 
 @item
 If an installable version of the included @code{libltdl} is being
-built, its pathname starting with @address@hidden@}/}, will be
-stored in @var{LIBLTDL}, and @var{LTDLINCL} will be set just like in
-the case of convenience library.
+built, its pathname starting with @address@hidden@}/} or
address@hidden@address@hidden, will be stored in @var{LIBLTDL} and
address@hidden, and @var{LTDLINCL} will be set just like in the case
+of convenience library.
 @end itemize
 
 You should probably also use the @samp{dlopen} option to @code{LT_INIT}
@@ -4684,7 +4689,7 @@
 
 myprog_LDFLAGS = -export-dynamic
 myprog_LDADD = $(LIBLTDL) -dlopen self -dlopen foo1.la
-myprog_DEPENDENCIES = $(LIBLTDL) foo1.la
+myprog_DEPENDENCIES = $(LIBLTDL_DEP) foo1.la
 ...
 @end example
 
Index: libltdl/m4/ltdl.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/ltdl.m4,v
retrieving revision 1.40
diff -u -r1.40 ltdl.m4
--- libltdl/m4/ltdl.m4  12 Jan 2008 17:00:51 -0000      1.40
+++ libltdl/m4/ltdl.m4  16 Jan 2008 06:21:09 -0000
@@ -96,9 +96,11 @@
       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
 esac
 LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
+LIBLTDL_DEP=$LIBLTDL
 LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
 
 AC_SUBST([LIBLTDL])
+AC_SUBST([LIBLTDL_DEP])
 AC_SUBST([LTDLINCL])
 
 # For backwards non-gettext consistent compatibility...
@@ -165,16 +167,19 @@
 case $enable_ltdl_install in
   no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
       LIBLTDL="-lltdl"
+      LIBLTDL_DEP=
       LTDLINCL=
       ;;
   *)  enable_ltdl_install=yes
       ac_configure_args="$ac_configure_args --enable-ltdl-install"
       LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
+      LIBLTDL_DEP=$LIBLTDL
       LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
       ;;
 esac
 
 AC_SUBST([LIBLTDL])
+AC_SUBST([LIBLTDL_DEP])
 AC_SUBST([LTDLINCL])
 
 # For backwards non-gettext consistent compatibility...
@@ -282,6 +287,7 @@
        AC_DEFINE([HAVE_LTDL], [1],
          [Define this if a modern libltdl is already installed])
        LIBLTDL=-lltdl
+       LIBLTDL_DEP=
        LTDLINCL=
        ;;
   ,no*,no,*)
@@ -289,6 +295,7 @@
        ;;
   *)   with_included_ltdl=no
        LIBLTDL="-L$with_ltdl_lib -lltdl"
+       LIBLTDL_DEP=
        LTDLINCL="-I$with_ltdl_include"
        ;;
 esac
Index: tests/configure-iface.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/configure-iface.at,v
retrieving revision 1.5
diff -u -r1.5 configure-iface.at
--- tests/configure-iface.at    12 Jan 2008 14:07:02 -0000      1.5
+++ tests/configure-iface.at    16 Jan 2008 06:21:09 -0000
@@ -132,6 +132,7 @@
 bin_PROGRAMS           = main
 main_LDFLAGS           = -dlopen libmodule.la
 main_LDADD             = $(LIBLTDL)
+main_DEPENDENCIES      = $(LIBLTDL_DEP)
 ]])
 
 # Install everything!
@@ -144,6 +145,10 @@
 AT_CHECK([test -f $prefix/lib/libltdl.la])
 AT_CHECK([test -f $prefix/include/ltdl.h])
 
+# Check that main is rebuilt if libltdl.la is newer
+rm -f libltdl/libltdl.la
+AT_CHECK([$MAKE -q main$EXEEXT || exit 1], [1], [ignore], [ignore])
+
 AT_CLEANUP
 
 
@@ -196,6 +201,7 @@
 bin_PROGRAMS           = main
 main_LDFLAGS           = -dlopen libmodule.la
 main_LDADD             = $(LIBLTDL)
+main_DEPENDENCIES      = $(LIBLTDL_DEP)
 ]])
 
 # We don't use 'libtoolize --ltdl', so that we get an error if the test
@@ -249,6 +255,7 @@
 bin_PROGRAMS           = main
 main_LDFLAGS           = -dlopen libmodule.la
 main_LDADD             = $(LIBLTDL)
+main_DEPENDENCIES      = $(LIBLTDL_DEP)
 ]])
 
 LT_AT_BOOTSTRAP([--ltdl], [-I libltdl/m4], [], [--add-missing], [],
@@ -262,6 +269,10 @@
 ## previously installed system libltdl.
 LT_AT_NOINST_EXEC_CHECK([./main], [-dlopen libmodule.la], [], [expout], [])
 
+# Check that main is rebuilt if libltdlc.la is newer
+rm -f libltdl/libltdlc.la
+AT_CHECK([$MAKE -q main$EXEEXT || exit 1], [1], [ignore], [ignore])
+
 AT_CLEANUP
 
 dnl Be careful not to let the definition leak into other tests




reply via email to

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