On 10 November 2011 18:03, Pavel Borzenkov <pavel.borzen...@gmail.com> wrote: > diff --git a/configure b/configure > index 401d9a6..b83640e 100755 > --- a/configure > +++ b/configure > @@ -1968,7 +1968,7 @@ EOF > if compile_prog "" "" ; then > attr=yes > # Older distros have <attr/xattr.h>, and need -lattr: > - elif sed -i s,sys/xattr,attr/xattr, $TMPC && compile_prog "" "-lattr" ; > then > + elif sed -i.bak s,sys/xattr,attr/xattr, $TMPC && compile_prog "" "-lattr" > ; then > attr=yes > LIBS="-lattr $LIBS" > libattr=yes
sed -i isn't POSIX; it would be nicer not to use it at all really. Random idea: how about having the test prog read #include <stdio.h> #include <sys/types.h> #ifdef CONFIG_LIBATTR #include <attr/xattr.h> #else #include <sys/xattr.h> #endif int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } and doing if compile_prog "" "" ; then attr=yes # Older distros have <attr/xattr.h>, and need -lattr: elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then attr=yes LIBS="-lattr $LIBS" libattr=yes [etc] ? (sadly you can't just include qemu-xattr.h in the test program because the include path isn't set for test programs...) -- PMM