From 05928ae6f2316b86aafc9e901785d6232a7ae528 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Wed, 23 Dec 1998 10:27:14 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 9 +++++++++ libltdl/Makefile.am | 12 ++++++++++-- libltdl/configure.in | 10 ++++++++-- libltdl/ltdl.c | 2 ++ mdemo/Makefile.am | 4 ++-- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5cf034aa..a48605b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1998-12-23 Thomas Tanner + + * libltdl/Makefile.am: build two versions of libltdl: + libltdl (support native dlopen if available, otherwise dlpreopen), + libltdls (like libltdl, but always support for dlpreopen) + * libltdl/ltdl.c: ditto + * libltdl/configure.in: warn if dlopen is not supported + * mdemo/Makefile.am (mdemo.debug): use libltdls + 1998-12-22 Alexandre Oliva * Makefile.am (SUBDIRS): prepend `.' to avoid am-recursive diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index 2e5b56f1..e325a53b 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -5,10 +5,18 @@ # level Makefile. AUTOMAKE_OPTIONS = no-dependencies foreign -lib_LTLIBRARIES = libltdl.la -libltdl_la_SOURCES = ltdl.c +ltdls.lo: ltdl.c + $(LTCOMPILE) -DDEBUG -o $@ -c $< + +lib_LTLIBRARIES = libltdl.la libltdls.la + +libltdl_la_SOURCES = ltdl.c ltdl.h libltdl_la_LDFLAGS = $(LIBADD_DL) +libltdls_la_LIBADD = ltdls.lo +libltdls_la_SOURCES = ltdl.h +libltdls_la_LDFLAGS = $(LIBADD_DL) + include_HEADERS = ltdl.h # rebuild the libtool script if needed diff --git a/libltdl/configure.in b/libltdl/configure.in index 02a47097..62de2034 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -23,16 +23,22 @@ if test x"$libltdl_cv_dlpreopen" = x"yes"; then AC_DEFINE(HAVE_DLPREOPEN) fi +supported=yes LIBADD_DL= AC_CHECK_FUNCS(dlopen, AC_DEFINE(HAVE_LIBDL), [AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL) LIBADD_DL="-ldl"], [AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD) LIBADD_DL="-ldld"], - [AC_CHECK_FUNCS(shl_load, AC_DEFINE(HAVE_SHL_LOAD) )] + [AC_CHECK_FUNCS(shl_load, AC_DEFINE(HAVE_SHL_LOAD), supported=no )] )] )] ) AC_SUBST(LIBADD_DL) +if test "$supported" = no; then + AC_MSG_WARN(Can't find dlopen support: Please make sure that your programs use -dlopen/-dlpreopen.) + AC_DEFINE(DEBUG) +fi + AM_SYS_SYMBOL_UNDERSCORE if test x"$USE_SYMBOL_UNDERSCORE" = xyes; then if test x"$ac_cv_func_dlopen" = xyes || @@ -53,7 +59,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY); fi if test x"$libltdl_cv_need_uscore" = xyes; then - AC_DEFINE(NEED_USCORE) + AC_DEFINE(NEED_USCORE) fi dnl Output the makefile diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index ae023398..b2e4ae41 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -361,6 +361,7 @@ wll = { LT_DLTYPE_TOP, wll_init, wll_exit, #endif +#if DEBUG #if HAVE_DLPREOPEN /* emulate dynamic linking using dld_preloaded_symbols */ @@ -436,6 +437,7 @@ dldpre = { LT_DLTYPE_TOP, dldpre_init, dldpre_exit, #undef LT_DLTYPE_TOP #define LT_DLTYPE_TOP &dldpre +#endif #endif static lt_dlhandle handles; diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index 10c32278..06a31bf3 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -27,7 +27,7 @@ mdemo_DEPENDENCIES = ../libltdl/libltdl.la libfoo1.la libfoo2.la # Create an easier-to-debug version of mdemo. mdemo_debug_SOURCES = main.c -mdemo_debug_LDADD = ../libltdl/libltdl.la +mdemo_debug_LDADD = ../libltdl/libltdls.la mdemo_debug_LDFLAGS = -static -export-dynamic \ -dlopen libfoo1.la -dlopen libfoo2.la -mdemo_debug_DEPENDENCIES = ../libltdl/libltdl.la libfoo1.la libfoo2.la +mdemo_debug_DEPENDENCIES = ../libltdl/libltdls.la libfoo1.la libfoo2.la