handle both -llib and lib in the second argument

also yes -> "" as a library, to ease callers that send in results from
this macro (this might be a little bit unclean)


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10584 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-08-29 00:07:57 +00:00
parent c77bd77f26
commit 63f0fd9afc

View File

@@ -13,11 +13,12 @@ AC_CACHE_VAL(ac_cv_funclib_$1,
if eval "test \"\$ac_cv_func_$1\" != yes" ; then
ac_save_LIBS="$LIBS"
for ac_lib in $2; do
if test -n "$ac_lib"; then
ac_lib="-l$ac_lib"
else
ac_lib=""
fi
case "$ac_lib" in
"") ;;
yes) ac_lib="" ;;
-l*) ;;
*) ac_lib="-l$ac_lib" ;;
esac
LIBS="$6 $ac_lib $5 $ac_save_LIBS"
AC_TRY_LINK([$3],[$1($4)],eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break)
done