3 dnl A replacement for autoconf's macro by the same name. This version
4 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
5 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
6 dnl run only if one of the listed libraries ends up being used (and not in
7 dnl the `none required' case.
8 dnl I hope it's only temporary while we wait for that version to be fixed.
9 undefine([AC_SEARCH_LIBS])
11 dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND
12 dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
13 dnl Search for a library defining FUNC, if it's not already available.
15 AC_DEFUN(AC_SEARCH_LIBS,
18 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
20 ac_func_search_save_LIBS="$LIBS"
22 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"])
23 if test "$ac_cv_search_$1" = "no"; then
25 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
26 AC_TRY_LINK_FUNC([$1],
27 [ac_cv_search_$1="-l$ac_lib"
31 LIBS="$ac_func_search_save_LIBS"
34 if test "$ac_cv_search_$1" = "no"; then :
37 if test "$ac_cv_search_$1" = "none required"; then :
40 LIBS="$ac_cv_search_$1 $LIBS"