Skip to content

Commit 56652e9

Browse files
eli-schwartztridge
authored andcommitted
configure.ac: check for xattr support both in libc and in -lattr
In 2015, the attr/xattr.h header was fully removed from upstream attr. In 2020, rsync started preferring the standard header, if it exists: #22 But the fix was incomplete. We still looked for the getxattr function in -lattr, and used it if -lattr exists. This was the case even if the system libc was sufficient to provide the needed functions. Result: overlinking to -lattr, if it happened to be installed for any other reason. ``` checking whether to support extended attributes... Using Linux xattrs checking for getxattr in -lattr... yes ``` Instead, use a different autoconf macro that first checks if the function is available for use without any libraries (e.g. it is in libc). Result: ``` checking whether to support extended attributes... Using Linux xattrs checking for library containing getxattr... none required ``` Signed-off-by: Eli Schwartz <[email protected]>
1 parent 1c5ebdc commit 56652e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ else
13921392
AC_DEFINE(HAVE_LINUX_XATTRS, 1, [True if you have Linux xattrs (or equivalent)])
13931393
AC_DEFINE(SUPPORT_XATTRS, 1)
13941394
AC_DEFINE(NO_SYMLINK_USER_XATTRS, 1, [True if symlinks do not support user xattrs])
1395-
AC_CHECK_LIB(attr,getxattr)
1395+
AC_SEARCH_LIBS(getxattr,attr)
13961396
;;
13971397
darwin*)
13981398
AC_MSG_RESULT(Using OS X xattrs)

0 commit comments

Comments
 (0)