]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
file-has-acl: Simplify logic for FILE_HAS_ACL_LIB.
authorBruno Haible <bruno@clisp.org>
Sat, 10 May 2025 11:36:12 +0000 (13:36 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 10 May 2025 11:36:12 +0000 (13:36 +0200)
* 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.

ChangeLog
m4/acl.m4

index bb1f55cce0791b8abb3ee3e77b0d15bb34cab868..b3598ecb37af4996085ba934abe340785e7904d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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)
index 7e4b0e354d9505858d230a9212d4c09b66a72a0e..50066da214460a5204b7b42c8d85f333437cc4ce 100644 (file)
--- 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])
 ])