+dnl --------------------- check for ACL support
+neta_cv_nfsv4acl="no"
+AC_MSG_CHECKING([if NFSv4 ACL Support should be enabled])
+AC_ARG_ENABLE(nfsv4acls,
+ [ --enable-nfsv4acls enable NFSv4 ACL Support],[
+ if test x"$enableval" = x"yes"; then
+ AC_MSG_RESULT([yes])
+ neta_cv_nfsv4acl="yes"
+ else
+ AC_MSG_RESULT([no])
+ fi],[
+ AC_MSG_RESULT([no])
+ ]
+)
+if test x$neta_cv_nfsv4acl = xyes; then
+ AC_CHECK_HEADER([ldap.h],,[
+ AC_MSG_ERROR([ACL Support need the LDAP client headers not found.])
+ neta_cv_nfsv4acl=no
+ ]
+ )
+ AC_CHECK_LIB(ldap,ldap_init,neta_cv_nfsv4acl=yes,neta_cv_nfsv4acl=no)
+fi
+if test x$neta_cv_nfsv4acl = xyes; then
+ AC_CHECK_HEADER([sys/acl.h],[
+ AC_DEFINE([HAVE_NFSv4_ACLS], 1, [Enable ACL code])
+ AC_MSG_NOTICE([Enabling ACL support])
+ ],
+ neta_cv_nfsv4acl=no
+ )
+fi
+if test x$neta_cv_nfsv4acl = xyes; then
+ LIBATALK_ACLS="acl/libacl.la"
+else
+ LIBATALK_ACLS=""
+fi
+AC_SUBST(LIBATALK_ACLS)
+
+dnl --------------------- check for Extended Attributes support
+neta_cv_eas="ad"
+neta_cv_eas_sys_found=no
+neta_cv_eas_sys_not_found=no
+
+AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
+
+case "$this_os" in
+
+ *osf*)
+ AC_SEARCH_LIBS(getproplist, [proplist])
+ AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
+ [neta_cv_eas_sys_found=yes],
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([sizeof_proplist_entry],,
+ [neta_cv_eas_sys_not_found=yes])
+ ;;
+
+ *solaris*)
+ AC_CHECK_FUNCS([attropen],
+ [neta_cv_eas_sys_found=yes],
+ [neta_cv_eas_sys_not_found=yes])
+ ;;
+
+ *)
+ AC_SEARCH_LIBS(getxattr, [attr])
+
+ if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+ AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
+ [neta_cv_eas_sys_found=yes],
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
+ [neta_cv_eas_sys_not_found=yes])
+ fi
+
+ if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+ AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
+ [neta_cv_eas_sys_found=yes],
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
+ [neta_cv_eas_sys_not_found=yes])
+ fi
+
+ if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+ AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
+ [neta_cv_eas_sys_not_found=yes])
+ fi
+ ;;
+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
+
+if test "x$neta_cv_eas_sys_found" = "xyes" ; then
+ if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
+ neta_cv_eas="$neta_cv_eas | sys"
+ fi
+fi
+
+dnl --------------------- Check if realpath() takes NULL
+AC_CACHE_CHECK([if the realpath function allows a NULL argument],
+ neta_cv_REALPATH_TAKES_NULL, [
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <limits.h>
+ #include <signal.h>
+
+ void exit_on_core(int ignored) {
+ exit(1);
+ }
+
+ main() {
+ char *newpath;
+ signal(SIGSEGV, exit_on_core);
+ newpath = realpath("/tmp", NULL);
+ exit((newpath != NULL) ? 0 : 1);
+ }],
+ neta_cv_REALPATH_TAKES_NULL=yes,
+ neta_cv_REALPATH_TAKES_NULL=no,
+ neta_cv_REALPATH_TAKES_NULL=cross
+ )
+ ]
+)
+
+if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
+ AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])
+fi
+
+dnl --------------------- Netatalk Webmin
+NETATALK_WEBMIN
+