From: Alexandre Oliva Date: Thu, 11 Mar 1999 00:58:19 +0000 (+0000) Subject: * libltdl/configure.in (libltdl_cv_need_uscore): do not assume X-Git-Tag: release-1-2f~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=477712665e8e866399b1f4742df75638c52cc846;p=thirdparty%2Flibtool.git * libltdl/configure.in (libltdl_cv_need_uscore): do not assume dlfcn.h and LTDL_LAZY exist; use LTDL_GLOBAL and LTDL_LAZY_OR_NOW. This test is likely to fail if self-dlopening does not work, especially because we do not link the program with -export-dynamic. Let's just hope that platforms whose symbol names start with underscores will also accept underscores for dlopen. We should probably use libtool to compile and link this test, so that we can use -export-dynamic. --- diff --git a/ChangeLog b/ChangeLog index ac5bc5005..f660492e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 1999-03-10 Alexandre Oliva + * libltdl/configure.in (libltdl_cv_need_uscore): do not assume + dlfcn.h and LTDL_LAZY exist; use LTDL_GLOBAL and LTDL_LAZY_OR_NOW. + This test is likely to fail if self-dlopening does not work, + especially because we do not link the program with + -export-dynamic. Let's just hope that platforms whose symbol + names start with underscores will also accept underscores for + dlopen. We should probably use libtool to compile and link this + test, so that we can use -export-dynamic. + * mdemo/Makefile.am (@LIBLTDL@): depend on ../libltdl/config.h * configure.in: fix AC_OUTPUT_COMMANDS for ltconfig and ltmain.sh diff --git a/libltdl/configure.in b/libltdl/configure.in index 5af3f1d38..8eaaede81 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -143,14 +143,50 @@ if test x"$USE_SYMBOL_UNDERSCORE" = xyes; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], libltdl_cv_need_uscore, [dnl AC_TRY_RUN([ +#if HAVE_DLFCN_H #include +#endif + #include + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,RTLD_LAZY); +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 && !ptr2) exit(0); } exit(1); } + if(ptr1 && !ptr2) exit(0); } exit(1); } ], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes, - libltdl_cv_need_uscore=no + libltdl_cv_need_uscore=cross )]) fi fi