summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--m4/xattr.m432
2 files changed, 22 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index 61e6a31c9..e8f1dd7a3 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,10 @@ GNU coreutils NEWS -*- outline -*-
own <wchar.h> header. Now, gnulib works around the bug in those older
glibc <wchar.h> headers.
+ Building would fail with a link error (cp/copy.o) when XATTR headers
+ were installed without the corresponding library. Now, configure
+ detects that and disables xattr support, as one would expect.
+
* Noteworthy changes in release 8.3 (2010-01-07) [stable]
diff --git a/m4/xattr.m4 b/m4/xattr.m4
index 377676a99..bf7e8725f 100644
--- a/m4/xattr.m4
+++ b/m4/xattr.m4
@@ -15,25 +15,29 @@ AC_DEFUN([gl_FUNC_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
- use_xattr=1
- else
- use_xattr=0
- AC_MSG_WARN([libattr development library was not found or not usable.])
- AC_MSG_WARN([AC_PACKAGE_NAME will be built without xattr support.])
+ && 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
AC_DEFINE_UNQUOTED([USE_XATTR], [$use_xattr],
[Define if you want extended attribute support.])
- LIB_XATTR=
- 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
- AC_SUBST([LIB_XATTR])
+ 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
])