From: Thomas Tanner Date: Sun, 11 Apr 1999 21:12:46 +0000 (+0000) Subject: * libltdl/configure.in: check for shl_load in libdld X-Git-Tag: release-1-3~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a312ae408054a412b4e30b7709b25feb9ae8d8d;p=thirdparty%2Flibtool.git * libltdl/configure.in: check for shl_load in libdld * libltdl/ltdl.c (shl_close, shl_sym): use (shl_t *) instead of shl_t * ltconfig.in (check for gcc): removed a bogus line, check for shl_load in libdld * ltmain.in: added a warning to the header of the .la file to warn users against deleting the file. --- diff --git a/ChangeLog b/ChangeLog index a04fcd41d..97a75929d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1999-04-11 Thomas Tanner + + * libltdl/configure.in: check for shl_load in libdld + * libltdl/ltdl.c (shl_close, shl_sym): use (shl_t *) instead of shl_t + * ltconfig.in (check for gcc): removed a bogus line, + check for shl_load in libdld + * ltmain.in: added a warning to the header of the .la file + to warn users against deleting the file. + 1999-04-10 Alexandre Oliva * libtool.m4 (AC_PROG_LD, AC_PROG_NM): When looking for programs, diff --git a/libltdl/configure.in b/libltdl/configure.in index c07c9d3ef..465a1f7aa 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -89,15 +89,20 @@ fi test_dlerror=no LIBADD_DL= AC_CHECK_FUNCS(dlopen, [AC_DEFINE(HAVE_LIBDL, 1, - [Define if you have the libdl library or equivalent. ]) test_dlerror=yes], + [Define if you have the libdl library or equivalent. ]) dnl + test_dlerror=yes], [AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1, - [Define if you have the libdl library. ]) dnl + [Define if you have the libdl library. ]) dnl LIBADD_DL="-ldl" test_dlerror=yes], [AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1, - [Define if you have the GNU dld library. ]) dnl + [Define if you have the GNU dld library. ]) dnl LIBADD_DL="-ldld"], [AC_CHECK_FUNCS(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1, - [Define if you have the shl_load function. ])])] + [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. ]) dnl + LIBADD_DL="-ldld"])] + )] )] )] ) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index f0a344a08..00e94450e 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -392,7 +392,7 @@ static int shl_close (handle) lt_dlhandle handle; { - if (shl_unload((shl_t) (handle->handle)) != 0) { + if (shl_unload((shl_t*) (handle->handle)) != 0) { last_error = cannot_close_error; return 1; } @@ -406,12 +406,12 @@ shl_sym (handle, symbol) { lt_ptr_t address; - if (shl_findsym((shl_t) (handle->handle), symbol, TYPE_UNDEFINED, - &address) != 0 || !(handle->handle) || !address) { - last_error = symbol_error; - return 0; - } - return address; + if (handle->handle && shl_findsym((shl_t*) (handle->handle), + symbol, TYPE_UNDEFINED, &address) == 0) + if (address) + return address; + last_error = symbol_error; + return 0; } static diff --git a/ltconfig.in b/ltconfig.in index a42699e87..bab0b8dba 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -503,7 +503,6 @@ if test "$with_gcc" != yes || test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do - IFS="$save_ifs" test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" @@ -2181,6 +2180,47 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "$progname:@LINENO@: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +fi + + fi diff --git a/ltmain.in b/ltmain.in index c258081e9..33bf5fcbe 100644 --- a/ltmain.in +++ b/ltmain.in @@ -2936,8 +2936,11 @@ fi\ fi $rm $output $echo > $output "\ -# $output - a libtool library file +# $outputname.la - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. # The name that we can dlopen(3). dlname='$dlname'