From 8bc4fc86d9310f357dd08cd7a1f1a6f5eee87607 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 8 Mar 1999 20:15:48 +0000 Subject: [PATCH] * libtool.m4 (AC_LIBTOOL_DLOPEN): do not depend on the existence of dlfcn.h nor on the definition of RTLD_LAZY --- ChangeLog | 3 +++ libtool.m4 | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d9c444a5..1c72f8736 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 1999-03-08 Alexandre Oliva + * 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 diff --git a/libtool.m4 b/libtool.m4 index 70e6e681e..04697c48d 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -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 +#endif + #include 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. -- 2.47.3