about summary refs log tree commit diff
path: root/aczsh.m4
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-09-04 10:52:02 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-09-04 10:52:02 +0000
commit372e84dc5b65b8297de146eac1182340aea6943c (patch)
treebca2b7268774ca33ee4d982ebfcb227b4c7b16e6 /aczsh.m4
parent3669415d56de9688471fdac93c10edb14967cd2f (diff)
downloadzsh-372e84dc5b65b8297de146eac1182340aea6943c.tar.gz
zsh-372e84dc5b65b8297de146eac1182340aea6943c.tar.xz
zsh-372e84dc5b65b8297de146eac1182340aea6943c.zip
3.1.9-dev-6 zsh-3.1.9-dev-6
Diffstat (limited to 'aczsh.m4')
-rw-r--r--aczsh.m430
1 files changed, 30 insertions, 0 deletions
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
+])
+