configure: Do not use 'sed -i'
PATCH 1/1 configure: Do not use 'sed -i'
'sed -i' is not defined in POSIX. It doesn't work on Mac OS X the way it's used in configure (without suffix argument). This patch implements Peter Maydell's idea of xattr.h detection.
--- configure | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
configure +5 -1
@@ -1962,13 +1962,17 @@ if test "$attr" != "no" ; then cat > $TMPC <<EOF #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; } 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 compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then attr=yes LIBS="-lattr $LIBS" libattr=yes
Signature · 1 line
1.7.5.4
Quoted 6 lines · Pavel Borzenkov
'sed -i' is not defined in POSIX. It doesn't work on Mac OS X the way it's used in configure (without suffix argument). This patch implements Peter Maydell's idea of
xattr.hdetection.Cc Peter Maydell <[email protected]>Signed-off-by Pavel Borzenkov <[email protected]>
(tested that we take the sys/xattr.h path, and that if you nobble that test we correctly fall back and detect attr/xattr.h+libattr.)
-- PMM
Anthony Liguori
AppliedQuoted 6 lines · Pavel Borzenkov
'sed -i' is not defined in POSIX. It doesn't work on Mac OS X the way it's used in configure (without suffix argument). This patch implements Peter Maydell's idea of
xattr.hdetection.Cc Peter Maydell<[email protected]>Signed-off-by Pavel Borzenkov<[email protected]>
Applied. Thanks.
Regards,
Anthony Liguori
Quoted 27 lines
--- configure | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)configure +5
-1@@ -1962,13 +1962,17 @@ if test "$attr" != "no" ; then cat> $TMPC<<EOF #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; } 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 compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then attr=yes LIBS="-lattr $LIBS" libattr=yes