]> arthur.barton.de Git - netatalk.git/blobdiff - configure.in
xattr, use them
[netatalk.git] / configure.in
index a0dff97e2e57827b9958aa367f2710ea8222b62d..5e114e24da0b9e10912958c784b05ac0554ae376 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.221 2009-10-22 08:36:30 franklahm Exp $
+dnl $Id: configure.in,v 1.224 2009-11-13 13:03:29 didg Exp $
 dnl configure.in for netatalk
 
 AC_INIT(etc/afpd/main.c)
@@ -708,15 +708,14 @@ fi
        AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
 
        netatalk_cv_linux_sendfile=no
-dnl    disable this for now, code doesn't use sendfile anyway
-dnl        AC_ARG_ENABLE(sendfile,
-dnl        [  --enable-sendfile       use sendfile syscall default (no) ],[
-dnl            if test "$enableval" = "yes"; then
-dnl                    netatalk_cv_linux_sendfile=yes
-dnl            fi
-dnl            AC_MSG_RESULT([enabling sendfile syscall])
-dnl        ]
-dnl       )
+        AC_ARG_ENABLE(sendfile,
+           [  --enable-sendfile       use sendfile syscall default (no) ],[
+               if test "$enableval" = "yes"; then
+                       netatalk_cv_linux_sendfile=yes
+               fi
+               AC_MSG_RESULT([enabling sendfile syscall])
+           ]
+       )
 
        if test x"$netatalk_cv_linux_sendfile" = "xyes"; then 
            AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
@@ -1044,15 +1043,74 @@ AC_SUBST(LIBATALK_ACLS)
 
 dnl --------------------- check for Extended Attributes support
 neta_cv_eas="adouble"
-if test "x$this_os" = "xsolaris"; then
-       AC_CHECK_LIB(c,attropen, [
-            neta_cv_eas="$neta_cv_eas Solaris"
-            AC_MSG_NOTICE([Enabling Solaris Extended Attributes support])
-            AC_DEFINE([HAVE_SOLARIS_EAS], 1, [Enable Extended Attributes])
-        ]
-    )
+neta_cv_eas="$neta_cv_eas Solaris"
+neta_cv_solaris_eas="yes"
+
+AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
+AC_CHECK_HEADERS(sys/ea.h)
+
+case "$this_os" in
+  *osf*)
+       AC_SEARCH_LIBS(getproplist, [proplist])
+       AC_CHECK_FUNCS(getproplist fgetproplist setproplist fsetproplist)
+       AC_CHECK_FUNCS(delproplist fdelproplist add_proplist_entry get_proplist_entry)
+       AC_CHECK_FUNCS(sizeof_proplist_entry)
+  ;;
+  *)
+       AC_SEARCH_LIBS(getxattr, [attr])
+       AC_CHECK_FUNCS(getxattr lgetxattr fgetxattr listxattr llistxattr)
+       AC_CHECK_FUNCS(getea fgetea lgetea listea flistea llistea)
+       AC_CHECK_FUNCS(removeea fremoveea lremoveea setea fsetea lsetea)
+       AC_CHECK_FUNCS(flistxattr removexattr lremovexattr fremovexattr)
+       AC_CHECK_FUNCS(setxattr lsetxattr fsetxattr)
+       AC_CHECK_FUNCS(attr_get attr_list attr_set attr_remove)
+       AC_CHECK_FUNCS(attr_getf attr_listf attr_setf attr_removef)
+  ;;
+esac
+
+# Check if attropen() is present if this is Solaris
+case "$this_os" in
+  *solaris*)
+       AC_CHECK_FUNCS(attropen)
+  ;;
+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
 
+# Check if we have extattr
+case "$this_os" in
+  *freebsd4* | *dragonfly* )
+    AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
+    ;;
+  *)
+    AC_CHECK_FUNCS(extattr_delete_fd extattr_delete_file extattr_delete_link)
+    AC_CHECK_FUNCS(extattr_get_fd extattr_get_file extattr_get_link)
+    AC_CHECK_FUNCS(extattr_list_fd extattr_list_file extattr_list_link)
+    AC_CHECK_FUNCS(extattr_set_fd extattr_set_file extattr_set_link)
+    ;;
+esac
+
 dnl --------------------- Netatalk Webmin
 NETATALK_WEBMIN
 
@@ -1068,7 +1126,7 @@ AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
 AM_CONDITIONAL(USE_NFSv4_ACLS, test x$neta_cv_nfsv4acl = xyes)
-AM_CONDITIONAL(USE_EXT_ATTRS, test x$neta_cv_extattrs = xyes)
+AM_CONDITIONAL(USE_SOLARIS_EAS, test x$neta_cv_solaris_eas = xyes)
 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)