From 8c83b517883d20c2ad4f8af469545205c478666e Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 20 Jan 1999 09:06:46 +0000 Subject: [PATCH] * libltdl/configure.in (libltdl_cv_preloaded_symbols, HAVE_PRELOADED_SYMBOLS): test whether we support -dl*open * libltdl/ltdl.c (!HAVE_PRELOADED_SYMBOLS, lt_preloaded_symbols): define it to an empty list if libtool won't generate it, so as to avoid link errors. This will cause silent dlopening failures, but maybe this is better than failing to link the program... --- ChangeLog | 7 +++++++ libltdl/configure.in | 12 ++++++++++++ libltdl/ltdl.c | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index dc080b4c8..74ef488da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 1999-01-20 Alexandre Oliva + * libltdl/configure.in (libltdl_cv_preloaded_symbols, + HAVE_PRELOADED_SYMBOLS): test whether we support -dl*open + * libltdl/ltdl.c (!HAVE_PRELOADED_SYMBOLS, lt_preloaded_symbols): + define it to an empty list if libtool won't generate it, so as to + avoid link errors. This will cause silent dlopening failures, but + maybe this is better than failing to link the program... + * libltdl/ltdl.h (LTDL_PRELOADED_SYMBOLS): remove it; better to declare lt_preloaded_symbols * doc/libtool.texi (LTDL_PRELOADED_SYMBOLS): ditto diff --git a/libltdl/configure.in b/libltdl/configure.in index b792492dc..377198bbd 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -58,6 +58,18 @@ AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h) AC_CHECK_HEADERS(string.h strings.h, break) AC_CHECK_FUNCS(strdup strchr strrchr index rindex) +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], + libltdl_cv_preloaded_symbols, [dnl + if grep '^global_symbol_pipe=..*$' ./libtool >/dev/null; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi +]) +if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then + AC_DEFINE(HAVE_PRELOADED_SYMBOLS) +fi + test_dlerror=no LIBADD_DL= AC_CHECK_FUNCS(dlopen, [AC_DEFINE(HAVE_LIBDL) test_dlerror=yes], diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 5d0429397..19fac064a 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -715,6 +715,11 @@ lt_dlpreload_default (preloaded) return 0; } +#ifndef HAVE_PRELOADED_SYMBOLS +/* If libtool won't define it, we'd better do */ +const lt_dlsymlist lt_preloaded_symbols[1] = { { 0, 0 } }; +#endif + int lt_dlexit () { -- 2.47.2