]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltdl.m4 (AC_LTDL_DLLIB): call dlopen with arguments so the test
authorAssar Westerlund <assar@sics.se>
Thu, 13 Sep 2001 20:06:35 +0000 (20:06 +0000)
committerGary V. Vaughan <gary@gnu.org>
Thu, 13 Sep 2001 20:06:35 +0000 (20:06 +0000)
does not fail due to a prototype in dlfcn.h

ChangeLog
ltdl.m4

index e05e00996ebb1d6adaf495c9a6dec77da87d985f..bf9fc3dc8a08a55ee8e3e9d846d0aed288dd250d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+001-09-13  Assar Westerlund  <assar@sics.se>
+
+       * ltdl.m4 (AC_LTDL_DLLIB): call dlopen with arguments so the test
+       does not fail due to a prototype in dlfcn.h
+
 2001-09-11  Gary V. Vaughan  <gary@gnu.org>
 
        * libltdl/Makefile.am (OBJECTS):  In addition to making $(OBJECTS)
diff --git a/ltdl.m4 b/ltdl.m4
index 615c4bc3f02a531f89141535995b4ff827f3a968..d1db42a84107c581cd21d87cfe3088f7c6a5f2c9 100644 (file)
--- a/ltdl.m4
+++ b/ltdl.m4
@@ -196,13 +196,26 @@ 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_SUBST(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_TRY_LINK([#if HAVE_DLFCN_H
+#  include <dlfcn.h>
+#endif
+    ],
+    [dlopen(0, 0);],
+    [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,
@@ -213,7 +226,6 @@ AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
 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)
 
 if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
  LIBS_SAVE="$LIBS"