summaryrefslogtreecommitdiff
path: root/m4/acl.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-06-06 18:37:45 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-06-06 18:38:30 -0700
commit325bf192ae281046834884b12705d6c522871b24 (patch)
tree4faf44a87bd0fde9ea9134e7cb928b629d8558e1 /m4/acl.m4
parent6fec047e9470731d588e52f516c1c704a7a55411 (diff)
downloademacs-325bf192ae281046834884b12705d6c522871b24.tar.gz
emacs-325bf192ae281046834884b12705d6c522871b24.tar.bz2
emacs-325bf192ae281046834884b12705d6c522871b24.zip
Merge from gnulib
This incorporates: 2015-06-06 acl-permissions: pacify -Wsuggest-attribute=const 2015-06-05 stdio: Don't redefine gets when using C++ 2015-06-05 acl-permissions: port to AIX, C89 HP-UX 2015-06-02 file-has-acl: fix build on Mac OS X 10 2015-06-01 gnulib-tool: concatenate lib_SOURCES to a single line 2015-06-01 pthread_sigmask: discount system version if a simple macro 2015-05-31 readlinkat: avoid OS X 10.10 trailing slash bug * doc/misc/texinfo.tex, lib/acl-internal.h, lib/get-permissions.c: * lib/readlinkat.c, lib/set-permissions.c, lib/stdio.in.h: * m4/acl.m4, m4/pthread_sigmask.m4, m4/readlinkat.m4: Copy from gnulib. * lib/gnulib.mk: Regenerate.
Diffstat (limited to 'm4/acl.m4')
-rw-r--r--m4/acl.m424
1 files changed, 19 insertions, 5 deletions
diff --git a/m4/acl.m4 b/m4/acl.m4
index 5da6a43ab6a..75fc9ce4c03 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
# acl.m4 - check for access control list (ACL) primitives
-# serial 20
+# serial 21
# Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -181,12 +181,26 @@ AC_DEFUN([gl_FILE_HAS_ACL],
[
AC_REQUIRE([gl_FUNC_ACL_ARG])
if test "$enable_acl" != no; then
- AC_CHECK_HEADERS([linux/xattr.h])
- AC_CHECK_HEADERS([sys/xattr.h],
- [AC_CHECK_FUNCS([getxattr])])
+ AC_CACHE_CHECK([for getxattr with XATTR_NAME_POSIX_ACL macros],
+ [gl_cv_getxattr_with_posix_acls],
+ [gl_cv_getxattr_with_posix_acls=no
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/xattr.h>
+ #include <linux/xattr.h>
+ ]],
+ [[ssize_t a = getxattr (".", XATTR_NAME_POSIX_ACL_ACCESS, 0, 0);
+ ssize_t b = getxattr (".", XATTR_NAME_POSIX_ACL_DEFAULT, 0, 0);
+ return a < 0 || b < 0;
+ ]])],
+ [gl_cv_getxattr_with_posix_acls=yes])])
fi
- if test "$ac_cv_header_sys_xattr_h,$ac_cv_func_getxattr" = yes,yes; then
+ if test "$gl_cv_getxattr_with_posix_acls" = yes; then
LIB_HAS_ACL=
+ AC_DEFINE([GETXATTR_WITH_POSIX_ACLS], 1,
+ [Define to 1 if getxattr works with XATTR_NAME_POSIX_ACL_ACCESS
+ and XATTR_NAME_POSIX_ACL_DEFAULT.])
else
dnl Set gl_need_lib_has_acl to a nonempty value, so that any
dnl later gl_FUNC_ACL call will set LIB_HAS_ACL=$LIB_ACL.