From 18850c5c889bd48e0caeddf719bcf05c2029b95f Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 10 Dec 2021 01:35:03 -0500 Subject: [build] check getxattr before attr_get and -lattr check getxattr before attr_get and -lattr; do not link with -lattr if getxattr is available from glibc (modern glibc systems do not require libattr-devel build dependency) --- configure.ac | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 698e4191..edc4883c 100644 --- a/configure.ac +++ b/configure.ac @@ -489,16 +489,6 @@ AC_MSG_RESULT([$WITH_ATTR]) if test "$WITH_ATTR" != no; then have_xattr=no - # libattr (linux only?) - AC_CHECK_LIB([attr], [attr_get], [ - AC_CHECK_HEADERS([attr/attributes.h], [ - ATTR_LIB=-lattr - AC_DEFINE([HAVE_XATTR], [1], [libattr]) - AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1]) - have_xattr=yes - ]) - ]) - AC_SUBST([ATTR_LIB]) # Linux getxattr AC_CHECK_FUNC([getxattr], [ @@ -518,6 +508,19 @@ if test "$WITH_ATTR" != no; then ]) ]) + # libattr (linux only?) + if test "$have_xattr" = no; then + AC_CHECK_LIB([attr], [attr_get], [ + AC_CHECK_HEADERS([attr/attributes.h], [ + ATTR_LIB=-lattr + AC_DEFINE([HAVE_XATTR], [1], [libattr]) + AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1]) + have_xattr=yes + ]) + ]) + fi + AC_SUBST([ATTR_LIB]) + if test "$have_xattr" = no; then AC_MSG_ERROR([no backend found implementing extended attributes]) fi -- cgit v1.2.1