Author: brbarret
Date: 2007-08-17 00:08:23 EDT (Fri, 17 Aug 2007)
New Revision: 15903
URL: https://svn.open-mpi.org/trac/ompi/changeset/15903
Log:
Support versions of the Libtool 2.1a snapshots after the
lt_dladvise code
was brought in. This supercedes the GLOBL patch that we had been
using
with Libtool 2.1a versions prior to the lt_dladvise code. Autogen
tries to figure out which version you're on, so either will now
work with
the trunk.
Text files modified:
trunk/configure.ac | 18 +++++
+++++++++++--
trunk/opal/mca/base/mca_base_component_find.c | 8 +++++
+++
trunk/opal/mca/base/mca_base_component_repository.c | 24 +++++
+++++++++++++++++++
3 files changed, 48 insertions(+), 2 deletions(-)
Modified: trunk/configure.ac
=====================================================================
=
========
--- trunk/configure.ac (original)
+++ trunk/configure.ac 2007-08-17 00:08:23 EDT (Fri, 17 Aug 2007)
@@ -995,10 +995,15 @@
ompi_show_subtitle "Libtool configuration"
+m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), 2.0), -1, [
AC_LIBLTDL_CONVENIENCE(opal/libltdl)
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
-
+], [
+LT_CONFIG_LTDL_DIR([opal/libltdl], [subproject])
+LTDL_CONVENIENCE
+LT_INIT([dlopen win32-dll])
+])
ompi_show_subtitle "GNU libltdl setup"
# AC_CONFIG_SUBDIRS appears to be broken for non-gcc compilers
(i.e.,
@@ -1038,6 +1043,13 @@
if test "$HAPPY" = "1"; then
LIBLTDL_SUBDIR=libltdl
+ CPPFLAGS_save="$CPPFLAGS"
+ CPPFLAGS="-I."
+ AC_EGREP_HEADER([lt_dladvise_init], [opal/libltdl/ltdl.h],
+ [OPAL_HAVE_LTDL_ADVISE=1],
+ [OPAL_HAVE_LTDL_ADVISE=0])
+ CPPFLAGS="$CPPFLAGS"
+
# Arrgh. This is gross. But I can't think of any other
way to do
# it. :-(
@@ -1057,7 +1069,7 @@
AC_MSG_WARN([libltdl support disabled (by --disable-dlopen)])
LIBLTDL_SUBDIR=
- LIBLTDL=
+ OPAL_HAVE_LTDL_ADVISE=0
# append instead of prepend, since LIBS are going to be system
# type things needed by everyone. Normally, libltdl will push
@@ -1073,6 +1085,8 @@
AC_DEFINE_UNQUOTED(OMPI_WANT_LIBLTDL, $OMPI_ENABLE_DLOPEN_SUPPORT,
[Whether to include support for libltdl or not])
+AC_DEFINE_UNQUOTED(OPAL_HAVE_LTDL_ADVISE, $OPAL_HAVE_LTDL_ADVISE,
+ [Whether libltdl appears to have the lt_dladvise interface])
##################################
# visibility
Modified: trunk/opal/mca/base/mca_base_component_find.c
=====================================================================
=
========
--- trunk/opal/mca/base/mca_base_component_find.c (original)
+++ trunk/opal/mca/base/mca_base_component_find.c 2007-08-17
00:08:23 EDT (Fri, 17 Aug 2007)
@@ -75,6 +75,10 @@
char name[MCA_BASE_MAX_COMPONENT_NAME_LEN];
};
typedef struct ltfn_data_holder_t ltfn_data_holder_t;
+
+#if OPAL_HAVE_LTDL_ADVISE
+extern lt_dladvise opal_mca_dladvise;
+#endif
#endif /* OMPI_WANT_LIBLTDL */
@@ -387,7 +391,11 @@
/* Now try to load the component */
+#if OPAL_HAVE_LTDL_ADVISE
+ component_handle = lt_dlopenadvise(target_file->filename,
opal_mca_dladvise);
+#else
component_handle = lt_dlopenext(target_file->filename);
+#endif
if (NULL == component_handle) {
err = strdup(lt_dlerror());
if (0 != show_errors) {
Modified: trunk/opal/mca/base/mca_base_component_repository.c
=====================================================================
=
========
--- trunk/opal/mca/base/mca_base_component_repository.c (original)
+++ trunk/opal/mca/base/mca_base_component_repository.c 2007-08-17
00:08:23 EDT (Fri, 17 Aug 2007)
@@ -85,6 +85,10 @@
static repository_item_t *find_component(const char *type, const
char *name);
static int link_items(repository_item_t *src, repository_item_t
*depend);
+#if OPAL_HAVE_LTDL_ADVISE
+lt_dladvise opal_mca_dladvise;
+#endif
+
#endif /* OMPI_WANT_LIBLTDL */
@@ -103,6 +107,20 @@
return OPAL_ERR_OUT_OF_RESOURCE;
}
+#if OPAL_HAVE_LTDL_ADVISE
+ if (lt_dladvise_init(&opal_mca_dladvise)) {
+ return OPAL_ERR_OUT_OF_RESOURCE;
+ }
+
+ if (lt_dladvise_ext(&opal_mca_dladvise)) {
+ return OPAL_ERROR;
+ }
+
+ if (lt_dladvise_global(&opal_mca_dladvise)) {
+ return OPAL_ERROR;
+ }
+#endif
+
OBJ_CONSTRUCT(&repository, opal_list_t);
#endif
initialized = true;
@@ -255,6 +273,12 @@
}
} while (opal_list_get_size(&repository) > 0);
+#if OPAL_HAVE_LTDL_ADVISE
+ if (lt_dladvise_destroy(&opal_mca_dladvise)) {
+ return OPAL_ERR_OUT_OF_RESOURCE;
+ }
+#endif
+
/* Close down libltdl */
lt_dlexit();
_______________________________________________
svn mailing list
s...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/svn