+2025-05-10 Bruno Haible <bruno@clisp.org>
+
+ file-has-acl: Simplify logic for FILE_HAS_ACL_LIB.
+ * m4/acl.m4 (gl_FUNC_ACL_ARG): Don't set gl_need_lib_has_acl.
+ (gl_FUNC_ACL): Don't set FILE_HAS_ACL_LIB.
+ (gl_FILE_HAS_ACL): Require gl_FUNC_ACL. Don't set gl_need_lib_has_acl.
+
2025-05-09 Paul Eggert <eggert@cs.ucla.edu>
acl-tests: link with $(FILE_HAS_ACL_LIB)
# acl.m4
-# serial 35
+# serial 36
dnl Copyright (C) 2002, 2004-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_ACL_ARG],
[
- gl_need_lib_has_acl=
AC_ARG_ENABLE([acl],
AS_HELP_STRING([[--disable-acl]], [do not support ACLs]),
, [enable_acl=auto])
[], [with_libsmack=maybe])
])
+# Prerequisites of module acl-permissions.
AC_DEFUN_ONCE([gl_FUNC_ACL],
[
AC_REQUIRE([gl_FUNC_ACL_ARG])
AC_MSG_WARN([AC_PACKAGE_NAME will be built without ACL support.])
fi
fi
- if test -n "$gl_need_lib_has_acl"; then
- FILE_HAS_ACL_LIB=$LIB_ACL
- fi
AC_SUBST([LIB_ACL])
AC_DEFINE_UNQUOTED([USE_ACL], [$use_acl],
[Define to nonzero if you want access control list support.])
AC_DEFUN([gl_FILE_HAS_ACL],
[
AC_REQUIRE([gl_FUNC_ACL_ARG])
+ AC_REQUIRE([gl_FUNC_ACL])
# On GNU/Linux, testing if a file has an acl can be done with the
# listxattr and getxattr syscalls, which don't require linking
# against additional libraries. Assume this works if linux/attr.h
AS_CASE([$enable_acl,$gl_file_has_acl_uses_selinux,$gl_file_has_acl_uses_smack],
[no,* | *,yes,* | *,yes], [],
[*],
- [dnl Set gl_need_lib_has_acl to a nonempty value, so that any
- dnl later gl_FUNC_ACL call will set FILE_HAS_ACL_LIB=$LIB_ACL.
- gl_need_lib_has_acl=1
- FILE_HAS_ACL_LIB=$LIB_ACL])
+ [FILE_HAS_ACL_LIB=$LIB_ACL])
AC_SUBST([FILE_HAS_ACL_LIB])
])