From 959b9cc711663e6c5938639f18b67d4b2f80d7e4 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Fri, 13 Jan 2023 09:37:40 +0100
Subject: [PATCH] qcopy-acl: Make last patch more robust.

* m4/acl.m4 (gl_FUNC_ACL): Define through AC_DEFUN_ONCE.
* modules/qcopy-acl (configure.ac): Require gl_FUNC_ACL.
---
 ChangeLog         | 4 ++++
 m4/acl.m4         | 4 ++--
 modules/qcopy-acl | 1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 11334b1afa..973596ac75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-01-13  Bruno Haible  <bruno@clisp.org>
 
+	qcopy-acl: Make last patch more robust.
+	* m4/acl.m4 (gl_FUNC_ACL): Define through AC_DEFUN_ONCE.
+	* modules/qcopy-acl (configure.ac): Require gl_FUNC_ACL.
+
 	qcopy-acl: Adjust link dependencies.
 	* modules/qcopy-acl (Depends-on): Add condition.
 	(configure.ac): Set QCOPY_ACL_LIB.
diff --git a/m4/acl.m4 b/m4/acl.m4
index e612f1ae34..dc9853a156 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
 # acl.m4 - check for access control list (ACL) primitives
-# serial 26
+# serial 27
 
 # Copyright (C) 2002, 2004-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_ACL_ARG],
 ])
 
 
-AC_DEFUN([gl_FUNC_ACL],
+AC_DEFUN_ONCE([gl_FUNC_ACL],
 [
   AC_REQUIRE([gl_FUNC_ACL_ARG])
   AC_CHECK_FUNCS_ONCE([fchmod])
diff --git a/modules/qcopy-acl b/modules/qcopy-acl
index 8dd147927d..b89d8ecab6 100644
--- a/modules/qcopy-acl
+++ b/modules/qcopy-acl
@@ -10,6 +10,7 @@ acl-permissions [test "$use_xattr" != yes]
 
 configure.ac:
 gl_FUNC_XATTR
+AC_REQUIRE([gl_FUNC_ACL])
 if test "$use_xattr" = yes; then
   QCOPY_ACL_LIB="$LIB_XATTR"
 else
-- 
2.39.5