From: Bruno Haible Date: Sat, 10 May 2025 11:36:12 +0000 (+0200) Subject: file-has-acl: Simplify logic for FILE_HAS_ACL_LIB. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fc42e5f5711e501f80559539a78aed2b7c842ac;p=thirdparty%2Fgnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index bb1f55cce0..b3598ecb37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-05-10 Bruno Haible + + 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 acl-tests: link with $(FILE_HAS_ACL_LIB) diff --git a/m4/acl.m4 b/m4/acl.m4 index 7e4b0e354d..50066da214 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # 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, @@ -12,7 +12,6 @@ dnl This file is offered as-is, without any warranty. 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]) @@ -22,6 +21,7 @@ AC_DEFUN([gl_FUNC_ACL_ARG], [], [with_libsmack=maybe]) ]) +# Prerequisites of module acl-permissions. AC_DEFUN_ONCE([gl_FUNC_ACL], [ AC_REQUIRE([gl_FUNC_ACL_ARG]) @@ -145,9 +145,6 @@ int type = ACL_TYPE_EXTENDED;]])], 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.]) @@ -187,6 +184,7 @@ AC_DEFUN([gl_ACL_GET_FILE], 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 @@ -224,10 +222,7 @@ AC_DEFUN([gl_FILE_HAS_ACL], 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]) ])