[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More systematic naming of LIB variables
From: |
Bruno Haible |
Subject: |
More systematic naming of LIB variables |
Date: |
Thu, 05 Jan 2023 11:14:57 +0100 |
In <https://lists.gnu.org/archive/html/bug-gnulib/2023-01/msg00025.html> I
wrote:
Our convention for these variables is generally
- $(LIBFOO) or $(LIB_FOO) for the library -lfoo (or empty if nonexistent
or not needed),
- $(MODULE_LIB) for the libraries needed by a given module. For example,
we have
$(GETADDRINFO_LIB)
$(GETHOSTNAME_LIB)
$(GETLOADAVG_LIBS)
$(INET_NTOP_LIB)
$(PTY_LIB)
$(YIELD_LIB)
The variable of the 'file-has-acl' module should follow the same naming
convention. This patch does it.
2023-01-05 Bruno Haible <bruno@clisp.org>
More systematic naming of LIB variables.
* m4/acl.m4 (gl_FUNC_ACL, gl_FILE_HAS_ACL): Set FILE_HAS_ACL_LIB to the
same value as LIB_HAS_ACL.
* modules/file-has-acl (Link): Use FILE_HAS_ACL_LIB instead of
LIB_HAS_ACL.
* modules/file-has-acl-tests (Makefile.am): Likewise.
diff --git a/m4/acl.m4 b/m4/acl.m4
index 98362858ce..6c2db7d320 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
# acl.m4 - check for access control list (ACL) primitives
-# serial 24
+# serial 25
# Copyright (C) 2002, 2004-2023 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -139,7 +139,10 @@ int type = ACL_TYPE_EXTENDED;]])],
AC_MSG_WARN([AC_PACKAGE_NAME will be built without ACL support.])
fi
fi
- test -n "$gl_need_lib_has_acl" && LIB_HAS_ACL=$LIB_ACL
+ if test -n "$gl_need_lib_has_acl"; then
+ FILE_HAS_ACL_LIB=$LIB_ACL
+ LIB_HAS_ACL="$FILE_HAS_ACL_LIB"
+ fi
AC_SUBST([LIB_ACL])
AC_DEFINE_UNQUOTED([USE_ACL], [$use_acl],
[Define to nonzero if you want access control list support.])
@@ -197,15 +200,18 @@ AC_DEFUN([gl_FILE_HAS_ACL],
[gl_cv_getxattr_with_posix_acls=yes])])
fi
if test "$gl_cv_getxattr_with_posix_acls" = yes; then
- LIB_HAS_ACL=
+ FILE_HAS_ACL_LIB=
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.
+ dnl later gl_FUNC_ACL call will set FILE_HAS_ACL_LIB=$LIB_ACL.
gl_need_lib_has_acl=1
- LIB_HAS_ACL=$LIB_ACL
+ FILE_HAS_ACL_LIB=$LIB_ACL
fi
+ AC_SUBST([FILE_HAS_ACL_LIB])
+ dnl For backward compatibility (e.g. coreutils still uses LIB_HAS_ACL).
+ LIB_HAS_ACL="$FILE_HAS_ACL_LIB"
AC_SUBST([LIB_HAS_ACL])
])
diff --git a/modules/file-has-acl b/modules/file-has-acl
index c5f7b27364..fa2ea4ca22 100644
--- a/modules/file-has-acl
+++ b/modules/file-has-acl
@@ -22,7 +22,7 @@ Include:
"acl.h"
Link:
-$(LIB_HAS_ACL)
+$(FILE_HAS_ACL_LIB)
License:
GPL
diff --git a/modules/file-has-acl-tests b/modules/file-has-acl-tests
index ff069ec52d..843d55b515 100644
--- a/modules/file-has-acl-tests
+++ b/modules/file-has-acl-tests
@@ -17,4 +17,4 @@ TESTS += \
test-file-has-acl.sh test-file-has-acl-1.sh test-file-has-acl-2.sh
TESTS_ENVIRONMENT += USE_ACL=$(USE_ACL)
check_PROGRAMS += test-file-has-acl
-test_file_has_acl_LDADD = $(LDADD) $(LIB_HAS_ACL)
+test_file_has_acl_LDADD = $(LDADD) $(FILE_HAS_ACL_LIB)
- More systematic naming of LIB variables,
Bruno Haible <=