[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: make libltdl work on platforms without loader
From: |
Ralf Wildenhues |
Subject: |
FYI: make libltdl work on platforms without loader |
Date: |
Mon, 29 Nov 2004 21:56:32 +0100 |
User-agent: |
Mutt/1.5.6+20040722i |
* Gary V. Vaughan wrote on Sun, Nov 28, 2004 at 10:04:44PM CET:
> Ralf Wildenhues wrote:
>
> >Back to above (rightfully) rejected patch. This one seems to do
> >the trick. Not beautiful, but much shorter. OK to apply? Does
> >HAVE_NO_DLLOADER constitute disallowed infringement on autoconf
> >namespace?
>
> No that's fine wrt namespace. It seems odd to say #ifndef HAVE_NO_FOO
> when #ifdef HAVE_FOO is more idiomatic though...
Yes. It definitely was too late last night.
> > (what about my dietlibc patches?)
>
> They arrived just as I was on my way out so I didn't look at them yet :-)
Thanks for reviewing them. They're on their way in.
*big snip*
> Instead of this hunk, near the end of LT_LIB_DLLOAD just before
> AC_LANG_POP (completely untested btw!):
>
> m4_pattern_allow([^LT_DLPREOPEN$])
> LT_DLPREOPEN=
> if test -n "$LT_DLLOADERS"
> then
> for lt_loader in $LT_DLLOADERS; do
> LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen loaders/$lt_loader "
> done
> else
> AC_DEFINE([HAVE_LIBDLLOADER], [1],
> [Define if libdlloader will be built on this platform])
> fi
> AC_SUBST([LT_DLPREOPEN])
Actually, both you and I were wrong. My patches would not catch some of
the loaders (my first cut would simply add the dummy too often, the
second cut would have broken several loaders), and yours simply gets the
logic backward. ;-)
I checked in the following on HEAD and branch-2-0, which does Just The
Right Thing[tm].
Cheers,
Ralf
2004-11-29 Ralf Wildenhues <address@hidden>
* m4/ltdl.m4 (LT_LIB_DLLOAD): Define HAVE_LIBDLLOADER if we
have a dlloader to preload.
* libltdl/ltdl.c (lt_dlinit): Only preload if HAVE_LIBDLLOADER, only
declare preloaded_symbols then. Fixes libltdl on static platforms.
* NEWS: Updated.
Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.168.2.10
diff -u -r1.168.2.10 NEWS
--- NEWS 24 Nov 2004 17:24:30 -0000 1.168.2.10
+++ NEWS 29 Nov 2004 20:56:25 -0000
@@ -2,6 +2,7 @@
New in 1.9h: 2004-??-??; CVS version 1.9g, Libtool team:
* Support for Portland Group compiler on Linux.
+* Fix libltdl on static platforms.
New in 1.9f: 2004-10-23; CVS version 1.9e, Libtool team:
* Calculate dllsearchpath correctly for wrapper scripts on cygwin.
Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.217.2.3
diff -u -r1.217.2.3 ltdl.c
--- libltdl/ltdl.c 1 Nov 2004 14:05:02 -0000 1.217.2.3
+++ libltdl/ltdl.c 29 Nov 2004 20:56:27 -0000
@@ -189,7 +189,9 @@
#define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols)
LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data);
+#ifdef HAVE_LIBDLLOADER
LT_SCOPE lt_dlsymlist preloaded_symbols;
+#endif
/* Initialize libltdl. */
int
@@ -211,6 +213,7 @@
/* Now open all the preloaded module loaders, so the application
can use _them_ to lt_dlopen its own modules. */
+#ifdef HAVE_LIBDLLOADER
if (!errors)
{
errors += lt_dlpreload (&preloaded_symbols);
@@ -220,6 +223,7 @@
{
errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback);
}
+#endif /* HAVE_LIBDLLOADER */
}
return errors;
Index: m4/ltdl.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/ltdl.m4,v
retrieving revision 1.20.2.2
diff -u -r1.20.2.2 ltdl.m4
--- m4/ltdl.m4 10 Nov 2004 13:20:52 -0000 1.20.2.2
+++ m4/ltdl.m4 29 Nov 2004 20:56:27 -0000
@@ -459,9 +459,14 @@
m4_pattern_allow([^LT_DLPREOPEN$])
LT_DLPREOPEN=
-for lt_loader in $LT_DLLOADERS; do
- LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen loaders/$lt_loader "
-done
+if test -n "$LT_DLLOADERS"
+then
+ for lt_loader in $LT_DLLOADERS; do
+ LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen loaders/$lt_loader "
+ done
+ AC_DEFINE([HAVE_LIBDLLOADER], [1],
+ [Define if libdlloader will be built on this platform])
+fi
AC_SUBST([LT_DLPREOPEN])
dnl This isn't used anymore, but set it for backwards compatibility