summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-01-13 19:32:47 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2023-01-13 20:03:54 -0800
commit99120491730c5839a5ba15ded187d481af1e71a7 (patch)
tree8473e9b735fdc25d01fa5dc65ae2884250b23d89 /m4
parentdce42f556177e4e0f15daccb3c2f27a47f2beebb (diff)
downloademacs-99120491730c5839a5ba15ded187d481af1e71a7.tar.gz
Update from Gnulib by running admin/merge-gnulib
This adds a new file m4/xattr.m4 from Gnulib, for NFS v4 attribute copying. Also, do these changes by hand: * configure.ac: Mention $LIB_XATTR" in ACL summary. * src/Makefile.in (QCOPY_ACL_LIB): New macro. (LIBES): Use it.
Diffstat (limited to 'm4')
-rw-r--r--m4/acl.m44
-rw-r--r--m4/assert_h.m44
-rw-r--r--m4/gettime.m431
-rw-r--r--m4/gnulib-common.m42
-rw-r--r--m4/gnulib-comp.m49
-rw-r--r--m4/utimens.m46
-rw-r--r--m4/xattr.m443
7 files changed, 80 insertions, 19 deletions
diff --git a/m4/acl.m4 b/m4/acl.m4
index e612f1ae34b..dc9853a156d 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/m4/assert_h.m4 b/m4/assert_h.m4
index 6275f633a69..3801452ef0d 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -18,7 +18,7 @@ AC_DEFUN([gl_ASSERT_H],
[AC_LANG_PROGRAM(
[[#if defined __clang__ && __STDC_VERSION__ < 202311
#pragma clang diagnostic error "-Wc2x-extensions"
- #pragma clang diagnostic error "-Wc++17-extensions"
+ #pragma clang diagnostic error "-Wc++1z-extensions"
#endif
#ifdef INCLUDE_ASSERT_H
#include <assert.h>
@@ -60,7 +60,7 @@ AC_DEFUN([gl_ASSERT_H],
/* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments.
We need it also to be invocable with a single argument. */
#if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus
- #undef static_assert
+ #undef/**/static_assert
#define static_assert _Static_assert
#endif
#endif])
diff --git a/m4/gettime.m4 b/m4/gettime.m4
index 06f32fe26c2..7e353fcd00e 100644
--- a/m4/gettime.m4
+++ b/m4/gettime.m4
@@ -1,4 +1,4 @@
-# gettime.m4 serial 12
+# gettime.m4 serial 13
dnl Copyright (C) 2002, 2004-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -26,17 +26,24 @@ AC_DEFUN([gl_CHECK_FUNC_TIMESPEC_GET],
dnl We can't use AC_CHECK_FUNC here, because timespec_get() is defined as a
dnl static inline function in <time.h> on MSVC 14.
- AC_CACHE_CHECK([for timespec_get], [gl_cv_func_timespec_get],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <time.h>
- struct timespec ts;
- ]],
- [[return timespec_get (&ts, 0);]])
- ],
- [gl_cv_func_timespec_get=yes],
- [gl_cv_func_timespec_get=no])
- ])
+ dnl But at the same time, we need to notice a missing declaration, like
+ dnl gl_CHECK_FUNCS_ANDROID does.
+ AC_CHECK_DECL([timespec_get], , , [[#include <time.h>]])
+ if test $ac_cv_have_decl_timespec_get = yes; then
+ AC_CACHE_CHECK([for timespec_get], [gl_cv_func_timespec_get],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>
+ struct timespec ts;
+ ]],
+ [[return timespec_get (&ts, 0);]])
+ ],
+ [gl_cv_func_timespec_get=yes],
+ [gl_cv_func_timespec_get=no])
+ ])
+ else
+ gl_cv_func_timespec_get=no
+ fi
])
AC_DEFUN([gl_GETTIME_RES],
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 26239caa2b1..2db3376b01e 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -71,7 +71,7 @@ AC_DEFUN([gl_COMMON_BODY], [
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
- : 3 < __clang_major__ + (5 <= __clang_minor__))))
+ : 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index ae5001c44b5..10c74fa2392 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -456,6 +456,14 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_PTHREAD_SIGMASK
])
gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
+ gl_FUNC_XATTR
+ AC_REQUIRE([gl_FUNC_ACL])
+ if test "$use_xattr" = yes; then
+ QCOPY_ACL_LIB="$LIB_XATTR"
+ else
+ QCOPY_ACL_LIB="$LIB_ACL"
+ fi
+ AC_SUBST([QCOPY_ACL_LIB])
gl_FUNC_READLINK
gl_CONDITIONAL([GL_COND_OBJ_READLINK],
[test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1])
@@ -1543,5 +1551,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/warnings.m4
m4/wchar_t.m4
m4/wint_t.m4
+ m4/xattr.m4
m4/zzgnulib.m4
])
diff --git a/m4/utimens.m4 b/m4/utimens.m4
index ae35ef789b8..c5d9b69e6f5 100644
--- a/m4/utimens.m4
+++ b/m4/utimens.m4
@@ -3,7 +3,7 @@ dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-dnl serial 11
+dnl serial 12
AC_DEFUN([gl_UTIMENS],
[
@@ -11,7 +11,9 @@ AC_DEFUN([gl_UTIMENS],
AC_REQUIRE([gl_FUNC_UTIMES])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_FUNCS_ONCE([futimes futimesat futimens utimensat lutimes])
+ AC_CHECK_FUNCS_ONCE([futimens utimensat lutimes])
+ gl_CHECK_FUNCS_ANDROID([futimes], [[#include <sys/time.h>]])
+ gl_CHECK_FUNCS_ANDROID([futimesat], [[#include <sys/time.h>]])
if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not
diff --git a/m4/xattr.m4 b/m4/xattr.m4
new file mode 100644
index 00000000000..6141515652a
--- /dev/null
+++ b/m4/xattr.m4
@@ -0,0 +1,43 @@
+# xattr.m4 - check for Extended Attributes (Linux)
+# serial 5
+
+# Copyright (C) 2003-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_XATTR],
+[
+ AC_ARG_ENABLE([xattr],
+ AS_HELP_STRING([--disable-xattr],
+ [do not support extended attributes]),
+ [use_xattr=$enableval], [use_xattr=yes])
+
+ LIB_XATTR=
+ AC_SUBST([LIB_XATTR])
+
+ if test "$use_xattr" = yes; then
+ AC_CHECK_HEADERS([attr/error_context.h attr/libattr.h])
+ use_xattr=no
+ if test "$ac_cv_header_attr_libattr_h" = yes \
+ && test "$ac_cv_header_attr_error_context_h" = yes; then
+ xattr_saved_LIBS=$LIBS
+ AC_SEARCH_LIBS([attr_copy_file], [attr],
+ [test "$ac_cv_search_attr_copy_file" = "none required" ||
+ LIB_XATTR="$ac_cv_search_attr_copy_file"])
+ AC_CHECK_FUNCS([attr_copy_file])
+ LIBS=$xattr_saved_LIBS
+ if test "$ac_cv_func_attr_copy_file" = yes; then
+ use_xattr=yes
+ fi
+ fi
+ if test $use_xattr = no; then
+ AC_MSG_WARN([libattr development library was not found or not usable.])
+ AC_MSG_WARN([AC_PACKAGE_NAME will be built without xattr support.])
+ fi
+ fi
+ if test "$use_xattr" = yes; then
+ AC_DEFINE([USE_XATTR], [1],
+ [Define to 1 to use the Linux extended attributes library.])
+ fi
+])