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
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.