summaryrefslogtreecommitdiff
path: root/lib/replace/libreplace.m4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-01 13:29:38 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-06-02 02:13:49 +0200
commitc290cdb9349220ba70b54143e1432da0230e2cee (patch)
tree4ebf0aa557376557eaec362eaa14f587c53ea1ec /lib/replace/libreplace.m4
parent664af060ac9ea83b565fbb817bb63d67d83843ef (diff)
downloadsamba-c290cdb9349220ba70b54143e1432da0230e2cee.tar.gz
samba-c290cdb9349220ba70b54143e1432da0230e2cee.tar.bz2
samba-c290cdb9349220ba70b54143e1432da0230e2cee.zip
lib/replace: xattr wrappers in lib/replace rather than source3/lib/system.c
This also moves all the still-used configure tests etc. The unused OSF API is also removed at this time. Andrew Bartlett
Diffstat (limited to 'lib/replace/libreplace.m4')
-rw-r--r--lib/replace/libreplace.m447
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
index 7335c98a59..8176a000b3 100644
--- a/lib/replace/libreplace.m4
+++ b/lib/replace/libreplace.m4
@@ -144,6 +144,53 @@ AC_CHECK_FUNCS(clock_gettime,libreplace_cv_have_clock_gettime=yes,[
libreplace_cv_have_clock_gettime=yes
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, Define to 1 if there is support for clock_gettime)])
])
+
+AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
+AC_CHECK_HEADERS(sys/ea.h sys/proplist.h)
+
+############################################
+# Check for EA implementations
+case "$host_os" in
+ *freebsd4* | *dragonfly* )
+ AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
+ ;;
+ *)
+ AC_SEARCH_LIBS(getxattr, [attr])
+ AC_CHECK_FUNCS(attr_get attr_getf attr_list attr_listf attropen attr_remove)
+ AC_CHECK_FUNCS(attr_removef attr_set attr_setf extattr_delete_fd extattr_delete_file)
+ AC_CHECK_FUNCS(extattr_get_fd extattr_get_file extattr_list_fd extattr_list_file)
+ AC_CHECK_FUNCS(extattr_set_fd extattr_set_file fgetea fgetxattr flistea flistxattr)
+ AC_CHECK_FUNCS(fremoveea fremovexattr fsetea fsetxattr getea getxattr listea)
+ AC_CHECK_FUNCS(listxattr removeea removexattr setea setxattr)
+
+ ;;
+esac
+
+
+########################################################
+# Do xattr functions take additional options like on Darwin?
+if test x"$ac_cv_func_getxattr" = x"yes" ; then
+ AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
+ old_LIBS=$LIBS
+ LIBS="$LIBS $ACL_LIBS"
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #if HAVE_ATTR_XATTR_H
+ #include <attr/xattr.h>
+ #elif HAVE_SYS_XATTR_H
+ #include <sys/xattr.h>
+ #endif
+ ],[
+ getxattr(0, 0, 0, 0, 0, 0);
+ ],
+ [smb_attr_cv_xattr_add_opt=yes],
+ [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
+ ])
+ if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
+ AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
+ fi
+fi
+
AC_CHECK_FUNCS(get_current_dir_name)
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
AC_HAVE_DECL(setresgid, [#include <unistd.h>])