From: Gary V. Vaughan Date: Sat, 30 Jun 2001 00:40:38 +0000 (+0000) Subject: * ltdl.m4 (AC_LTDL_DLLIB) [sco3.2*]: When searching for a dlopen X-Git-Tag: release-1-4b~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdec1c113794cb439d212a07571d98e3a575ab31;p=thirdparty%2Flibtool.git * 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." --- diff --git a/ChangeLog b/ChangeLog index 4dbfb88c2..e8f65c986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-06-30 Gary V. Vaughan + + * 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." + 2001-06-29 Tim Van Holder General cleanup of autoconf-2.50 upgrade: diff --git a/ltdl.m4 b/ltdl.m4 index ad39d85de..2c4b0e1b9 100644 --- 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 +#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