]> git.ipfire.org Git - thirdparty/rsync.git/commit
configure.ac: check for xattr support both in libc and in -lattr
authorEli Schwartz <eschwartz@gentoo.org>
Tue, 22 Apr 2025 20:17:55 +0000 (16:17 -0400)
committerAndrew Tridgell <andrew@tridgell.net>
Sat, 23 Aug 2025 07:14:06 +0000 (17:14 +1000)
commit0973d0e380fbdc6c51f99bf840081958b279ffd4
treed7337a53439ba0f6c2e26e6acc9f6bdcdd95e156
parente405cfc0735d5e68393869bbaa8aa39381758890
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:
https://github.com/RsyncProject/rsync/pull/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 <eschwartz@gentoo.org>
configure.ac