]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltdl.m4 (AC_LTDL_DLLIB) [sco3.2*]: When searching for a dlopen
authorGary V. Vaughan <gary@gnu.org>
Sat, 30 Jun 2001 00:40:38 +0000 (00:40 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sat, 30 Jun 2001 00:40:38 +0000 (00:40 +0000)
implementation, and adding `-ldl' has failed, try linking a call
to dlopen, #including dlfcn.h, and without -ldl.  On sco3.2 the
header files redefines the interface symbols to point at the
implementation symbols in libc.
Reported by "Golubev I. N." <gin@mo.msk.ru>

ChangeLog
ltdl.m4

index 4dbfb88c217f827eb6b7060d2dcb8d1c5250e357..e8f65c986ffed23c017a55a17aaf7cfaab58871d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-06-30  Gary V. Vaughan  <gary@gnu.org>
+
+       * ltdl.m4 (AC_LTDL_DLLIB) [sco3.2*]: When searching for a dlopen
+       implementation, and adding `-ldl' has failed, try linking a call
+       to dlopen, #including dlfcn.h, and without -ldl.  On sco3.2 the
+       header files redefines the interface symbols to point at the
+       implementation symbols in libc.
+       Reported by "Golubev I. N." <gin@mo.msk.ru>
+
 2001-06-29  Tim Van Holder  <tim.van.holder@pandora.be>
 
        General cleanup of autoconf-2.50 upgrade:
diff --git a/ltdl.m4 b/ltdl.m4
index ad39d85de4e9bc2e3342ec0fd2bde7d1d7a547eb..2c4b0e1b9979d94d9a9879ea41b2023d24b30d92 100644 (file)
--- a/ltdl.m4
+++ b/ltdl.m4
@@ -190,31 +190,42 @@ fi
 # -------------
 AC_DEFUN(AC_LTDL_DLLIB,
 [LIBADD_DL=
-AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
-   [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"],
-[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
-   [Define if you have the libdl library or equivalent.])],
-[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
-   [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"]
-)])])
-AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
-   [Define if you have the shl_load function.])],
-[AC_CHECK_LIB(dld, shl_load,
-  [AC_DEFINE(HAVE_SHL_LOAD, 1,
-     [Define if you have the shl_load function.])
-   LIBADD_DL="$LIBADD_DL -ldld"])
-])
-AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
-  [Define if you have the GNU dld library.])dnl
-test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
 AC_SUBST(LIBADD_DL)
+AC_LANG_PUSH([C])
+AC_CHECK_LIB(dl, dlopen, 
+    [AC_DEFINE(HAVE_LIBDL, 1,
+      [Define if you have the libdl library or equivalent. ])
+    LIBADD_DL="-ldl"],
+  [AC_TRY_LINK([#if HAVE_DLFCN_H
+#  include <dlfcn.h>
+#endif
+], [dlopen();], 
+      [AC_DEFINE(HAVE_LIBDL, 1,
+        [Define if you have the libdl library or equivalent.])],
+    [AC_CHECK_LIB(svld, dlopen, 
+        [AC_DEFINE(HAVE_LIBDL, 1,
+          [Define if you have the libdl library or equivalent.])
+        LIBADD_DL="-lsvld"])])])
+
+AC_CHECK_FUNC(shl_load,
+    [AC_DEFINE(HAVE_SHL_LOAD, 1, [Define if you have the shl_load function.])],
+  [AC_CHECK_LIB(dld, shl_load,
+      [AC_DEFINE(HAVE_SHL_LOAD, 1, [Define if you have the shl_load function.])
+      LIBADD_DL="$LIBADD_DL -ldld"])])
+
+AC_CHECK_LIB(dld, dld_link,
+    [AC_DEFINE(HAVE_DLD, 1, [Define if you have the GNU dld library.])
+    test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
+
 
-if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
- LIBS_SAVE="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- AC_CHECK_FUNCS(dlerror)
- LIBS="$LIBS_SAVE"
+if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes
+then
+  lt_save_LIBS="$LIBS"
+  LIBS="$LIBS $LIBADD_DL"
+  AC_CHECK_FUNCS(dlerror)
+  LIBS="$lt_save_LIBS"
 fi
+AC_LANG_POP
 ])# AC_LTDL_DLLIB
 
 # AC_LTDL_SYMBOL_USCORE