From e67dd5e8fb7170aec5d1fe35f5f19c1e66f1434a Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Mon, 29 Nov 2004 20:58:55 +0000 Subject: [PATCH] * 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. --- ChangeLog | 8 ++++++++ NEWS | 1 + libltdl/ltdl.c | 4 ++++ m4/ltdl.m4 | 11 ++++++++--- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77bb3faa4..0d48b6751 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-11-29 Ralf Wildenhues + + * 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. + 2004-11-28 Ralf Wildenhues * config/ltmain.m4sh (func_mode_link): $dlsymsobj is really diff --git a/NEWS b/NEWS index 08b81a16c..f6138b160 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ NEWS - list of user-visible changes between releases of GNU Libtool 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. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index a85eeeaa7..0b0b297e8 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -189,7 +189,9 @@ loader_init (lt_get_vtable *vtable_func, lt_user_data data) #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 @@ lt_dlinit (void) /* 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 @@ lt_dlinit (void) { errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback); } +#endif /* HAVE_LIBDLLOADER */ } return errors; diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index 2c329e945..ade1e1fc3 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 @@ -459,9 +459,14 @@ AC_SUBST([LIBADD_DLD_LINK]) 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 -- 2.47.2