+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:
# -------------
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