1 dnl $Heimdal: find-func-no-libs2.m4 14166 2004-08-26 12:35:42Z joda $
5 dnl Look for function in any of the specified libraries
8 dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
9 AC_DEFUN([AC_FIND_FUNC_NO_LIBS2], [
11 AC_MSG_CHECKING([for $1])
12 AC_CACHE_VAL(ac_cv_funclib_$1,
14 if eval "test \"\$ac_cv_func_$1\" != yes" ; then
22 *) ac_lib="-l$ac_lib" ;;
24 LIBS="$6 $ac_lib $5 $ac_save_LIBS"
25 AC_LINK_IFELSE([AC_LANG_PROGRAM([[$3]],[[$1($4)]])],[eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break])
27 eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
32 eval "ac_res=\$ac_cv_funclib_$1"
36 dnl AC_CHECK_LIBS($2, foo)
39 eval "ac_tr_func=HAVE_[]upcase($1)"
40 eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')"
45 eval "ac_cv_func_$1=yes"
47 AC_DEFINE_UNQUOTED($ac_tr_func)
51 eval "ac_cv_func_$1=no"
56 eval "ac_cv_func_$1=yes"
57 eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes"
58 AC_DEFINE_UNQUOTED($ac_tr_func)
59 AC_DEFINE_UNQUOTED($ac_tr_lib)
60 AC_MSG_RESULT([yes, in $ac_res])