* libtool.m4 (AC_LIBTOOL_DLOPEN): do not depend on the existence

of dlfcn.h nor on the definition of RTLD_LAZY
This commit is contained in:
Alexandre Oliva 1999-03-08 20:15:48 +00:00 committed by Alexandre Oliva
parent f3b997d2ad
commit 8bc4fc86d9
2 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,8 @@
1999-03-08 Alexandre Oliva <oliva@dcc.unicamp.br>
* libtool.m4 (AC_LIBTOOL_DLOPEN): do not depend on the existence
of dlfcn.h nor on the definition of RTLD_LAZY
* tests/build-relink.test: hellT was renamed to lt-hell
* libltdl/Makefile.am (@TOINST@/libltdl.la): do not hide the

17
libtool.m4 vendored
View File

@ -136,17 +136,24 @@ AC_CHECK_FUNC(dlopen, [lt_cv_dlopen="dlopen"],
case "$lt_cv_dlopen" in
dlopen)
LT_SAVE_LIBS="$LIBS"
LT_SAVE_CPPFLAGS="$CPPFLAGS"
LIBS="$lt_cv_dlopen_libs $LIBS"
AC_CHECK_HEADER(dlfcn.h, [CPPFLAGS="-DHAVE_DLFCN_H $CPPFLAGS"])
AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self,
[LT_SAVE_LIBS="$LIBS"; LIBS="$lt_cv_dlopen_libs $LIBS"
AC_TRY_RUN([
[AC_TRY_RUN([
#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#include <stdio.h>
fnord() { int i=42;}
main() { void *self, *ptr1, *ptr2; self=dlopen(0,RTLD_LAZY);
main() { void *self, *ptr1, *ptr2; self=dlopen(0,0);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
if(ptr1 || ptr2) exit(0); } exit(1); }
], lt_cv_dlopen_self=no, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=cross)
LIBS="$LT_SAVE_LIBS"])
], lt_cv_dlopen_self=no, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=cross)])
LIBS="$LT_SAVE_LIBS"
CPPFLAGS="$LT_SAVE_CPPFLAGS"
;;
# We should probably test other for NULL support in other dlopening
# mechanisms too.