]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/configure.in (libltdl_cv_need_uscore): do not assume
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Thu, 11 Mar 1999 00:58:19 +0000 (00:58 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Thu, 11 Mar 1999 00:58:19 +0000 (00:58 +0000)
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.

ChangeLog
libltdl/configure.in

index ac5bc5005d427404ac690829f82fab98f0798898..f660492e4a635a4e94dcb2e522bff1f74fc0f74a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 1999-03-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * 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
index 5af3f1d38b00242d5eb8f9e67caef8077c0fe996..8eaaede816b3533c620ac213d2f5593700321ebd 100644 (file)
@@ -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 <dlfcn.h>
+#endif
+
 #include <stdio.h>
+
+#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