From 372e84dc5b65b8297de146eac1182340aea6943c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 4 Sep 2000 10:52:02 +0000 Subject: 3.1.9-dev-6 --- aczsh.m4 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'aczsh.m4') diff --git a/aczsh.m4 b/aczsh.m4 index e835dcede..7952b9837 100644 --- a/aczsh.m4 +++ b/aczsh.m4 @@ -646,3 +646,33 @@ AC_DEFUN(zsh_COMPILE_FLAGS, then LIBS="$4" else LIBS="$enable_libs" fi)]) + +# zsh_SEARCH_LIBS(FUNCTION, SEARCH-LIBS, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# This is derived from autoconf 2.49a AC_SEARCH_LIBS +# with the following differences: +# - no extra libs argument +# - SEARCH-LIBS are taken literally - use -lfoo not foo. That +# makes it possible to pass several libs, e.g. "-lsocket -lnsl" +# -------------------------------------------------------- +# Search for a library defining FUNC, if it's not already available. +AC_DEFUN([zsh_SEARCH_LIBS], +[AC_CACHE_CHECK([for library containing $1], [zsh_cv_search_$1], +[zsh_func_search_save_LIBS="$LIBS" +zsh_cv_search_$1=no +AC_TRY_LINK_FUNC([$1], [zsh_cv_search_$1="none required"]) +test "$zsh_cv_search_$1" = no && for zsh_lib in $2; do +LIBS="$zsh_lib $zsh_func_search_save_LIBS" +AC_TRY_LINK_FUNC([$1], +[zsh_cv_search_$1="$zsh_lib" +break]) +done +LIBS="$zsh_func_search_save_LIBS"]) +if test "$zsh_cv_search_$1" = no; then + ifelse([$4], , :, [$4]) +else + test "$zsh_cv_search_$1" = "none required" || LIBS="$zsh_cv_search_$1 $LIBS" + ifelse([$3], , , [$3]) +fi +]) + -- cgit 1.4.1