]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (AC_LIBTOOL_DLOPEN): do not depend on the existence
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Mon, 8 Mar 1999 20:15:48 +0000 (20:15 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 8 Mar 1999 20:15:48 +0000 (20:15 +0000)
of dlfcn.h nor on the definition of RTLD_LAZY

ChangeLog
libtool.m4

index 1d9c444a56ff83d0d93d709b07424be67850b6c7..1c72f8736c61755e7a4f6af8bd75e43d1bb40d8e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 70e6e681ea25028a8a039f211cba9820a06b7c23..04697c48d057bd80073f8617c3642e4cfac041e6 100644 (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.