1
1

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.

This commit was SVN r15903.
Этот коммит содержится в:
Brian Barrett 2007-08-17 04:08:23 +00:00
родитель 3b98b5f0a1
Коммит 2d4918b09d
3 изменённых файлов: 48 добавлений и 2 удалений

Просмотреть файл

@ -995,10 +995,15 @@ CFLAGS="$CFLAGS_save"
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 "$OMPI_ENABLE_DLOPEN_SUPPORT" = "1" ; then
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 @@ else
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_SUBST(LIBLTDL_SUBDIR)
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

Просмотреть файл

@ -75,6 +75,10 @@ struct ltfn_data_holder_t {
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 @@ static int open_component(component_file_item_t *target_file,
/* 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) {

Просмотреть файл

@ -85,6 +85,10 @@ static opal_list_t repository;
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 @@ int mca_base_component_repository_init(void)
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 @@ void mca_base_component_repository_finalize(void)
}
} 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();