1 # xattr.m4 - check for Extended Attributes (Linux)
4 # Copyright (C) 2003-2022 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # Originally written by Andreas Gruenbacher.
11 AC_DEFUN([gl_FUNC_XATTR],
13 AC_ARG_ENABLE([xattr],
14 AS_HELP_STRING([--disable-xattr],
15 [do not support extended attributes]),
16 [use_xattr=$enableval], [use_xattr=yes])
21 if test "$use_xattr" = "yes"; then
22 AC_CHECK_HEADERS([attr/error_context.h attr/libattr.h])
24 if test $ac_cv_header_attr_libattr_h = yes \
25 && test $ac_cv_header_attr_error_context_h = yes; then
26 xattr_saved_LIBS=$LIBS
27 AC_SEARCH_LIBS([attr_copy_file], [attr],
28 [test "$ac_cv_search_attr_copy_file" = "none required" ||
29 LIB_XATTR=$ac_cv_search_attr_copy_file])
30 AC_CHECK_FUNCS([attr_copy_file])
31 LIBS=$xattr_saved_LIBS
32 if test $ac_cv_func_attr_copy_file = yes; then
36 if test $use_xattr = no; then
37 AC_MSG_WARN([libattr development library was not found or not usable.])
38 AC_MSG_WARN([AC_PACKAGE_NAME will be built without xattr support.])
41 AC_DEFINE_UNQUOTED([USE_XATTR], [`test $use_xattr != yes; echo $?`],
42 [Define if you want extended attribute support.])