diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2009-03-08 20:20:47 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2009-03-08 20:20:47 +0000 |
commit | 6594c0375b91c3aa1bd991c30ae50197a6d889d4 (patch) | |
tree | 02d80eee3e6b6b962aba6fab9377584234a6f490 /configure.ac | |
parent | d968acfacd3db570a4275f8abfc5804024230bd3 (diff) | |
download | zsh-6594c0375b91c3aa1bd991c30ae50197a6d889d4.tar.gz zsh-6594c0375b91c3aa1bd991c30ae50197a6d889d4.tar.xz zsh-6594c0375b91c3aa1bd991c30ae50197a6d889d4.zip |
26697: test for Linux- and Mac-style xattr functions
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 136086545..296172224 100644 --- a/configure.ac +++ b/configure.ac @@ -1251,6 +1251,49 @@ if test x$dynamic = xyes; then shl_load shl_unload shl_findsym) fi +AH_TEMPLATE([XATTR_EXTRA_ARGS], +Define if getxattr() etc. require additional MacOS-style arguments) +if test x$ac_cv_func_getxattr = xyes && test x$ac_cv_header_sys_xattr_h = xyes +then + AC_CACHE_CHECK(if getxattr etc. are Linux-like, + zsh_cv_getxattr_linux, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#include <sys/xattr.h>]], + [[ + (void)listxattr("", 0, 0); + (void)getxattr("", "", 0, 0); + (void)setxattr("", "", "", 0, 0); + (void)removexattr("", ""); + ]])], + [zsh_cv_getxattr_linux=yes], + [zsh_cv_getxattr_linux=no])]) + + if test x$zsh_cv_getxattr_linux != xyes; then + AC_CACHE_CHECK(if getxattr etc. are MAC-like, + zsh_cv_getxattr_mac, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#include <sys/xattr.h>]], + [[(void)listxattr("", 0, 0, 0); + (void)getxattr("", "", 0, 0, 0, 0); + (void)setxattr("", "", "", 0, 0, 0); + (void)removexattr("", "", 0);]])], + [zsh_cv_getxattr_mac=yes], + [zsh_cv_getxattr_mac=no])]) + + if test x$zsh_cv_getxattr_mac = xyes; then + AC_DEFINE(XATTR_EXTRA_ARGS) + fi + fi +fi + +AC_CACHE_CHECK(if getxattr etc. are usable, +zsh_cv_use_xattr, +[if test x$zsh_cv_getxattr_linux = xyes || test x$zsh_cv_getxattr_mac = xyes +then +zsh_cv_use_xattr=yes +else +zsh_cv_use_xattr=no +fi]) dnl ------------- dnl CHECK SIGNALS |