* 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,
  link shared against static libraries if
  deplibs_check_method == pass_all
This commit is contained in:
Thomas Tanner 1999-04-11 21:10:04 +00:00
parent 4dac81d0d7
commit c836f3090d
5 changed files with 109 additions and 37 deletions

View File

@ -1,3 +1,14 @@
1999-04-11 Thomas Tanner <tanner@gmx.de>
* 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,
link shared against static libraries if
deplibs_check_method == pass_all
1999-04-10 Alexandre Oliva <oliva@dcc.unicamp.br>
* libtool.m4 (AC_PROG_LD, AC_PROG_NM): When looking for programs,

View File

@ -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"])]
)]
)]
)]
)

View File

@ -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

View File

@ -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"
@ -2190,6 +2189,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 <<EOF
#line @LINENO@ "ltconfig"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char shl_load();
int main() {
shl_load()
; return 0; }
EOF
if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&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

View File

@ -1783,16 +1783,27 @@ compiler."
esac
fi
test "$add_name" = yes && deplibs="$deplibs -l$name"
elif test "$build_libtool_libs" = yes && test "$deplibs_check_method" != pass_all; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
echo "*** Warning: This library needs some functionality provided by $libname."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have."
elif test "$build_libtool_libs" = yes; then
if test "$deplibs_check_method" != pass_all; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
echo "*** Warning: This library needs some functionality provided by $libname."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have."
else
# Check for old archives if we don't build new libraries.
if test -n "$pic_flag" && test -z "$old_library"; then
$echo "$modename: cannot find static library for \`$lib'" 1>&2
exit 1
fi
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
deplibs="$deplibs $dir/$old_library"
fi
fi
if test -n "$dependency_libs"; then
@ -2560,15 +2571,6 @@ EOF
fi
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
if test -z "$libdir"; then
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
compile_command="$compile_command $dir/$old_library"
finalize_command="$finalize_command $dir/$old_library"
continue
fi
if test "$build_libtool_libs" = yes && test -n "$library_names"; then
# We need to hardcode the library path
if test -n "$shlibpath_var"; then
@ -2604,13 +2606,24 @@ EOF
esac
fi
if test "$alldeplibs" = yes && \
test "$build_libtool_libs" = yes && \
test -n "$library_names"; then
# Do we only need to link against static libraries?
continue
if test "$alldeplibs" = yes; then
if test "$deplibs_check_method" = pass_all ||
(test "$build_libtool_libs" = yes && \
test -n "$library_names"); then
# Do we only need to link against static libraries?
continue
fi
fi
if test -z "$libdir"; then
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
compile_command="$compile_command $dir/$old_library"
finalize_command="$finalize_command $dir/$old_library"
continue
fi
if test "$build_libtool_libs" = yes && test -n "$library_names"; then
link_against_libtool_libs="$link_against_libtool_libs $lib"
@ -3483,8 +3496,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'