qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1.0] configure: Do not use 'sed -i'
@ 2011-11-10 20:26 Pavel Borzenkov
  2011-11-10 22:51 ` Peter Maydell
  2011-11-11 19:46 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Borzenkov @ 2011-11-10 20:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

'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.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
---
 configure |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 401d9a6..d6103c0 100755
--- a/configure
+++ b/configure
@@ -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
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1.0] configure: Do not use 'sed -i'
  2011-11-10 20:26 [Qemu-devel] [PATCH 1.0] configure: Do not use 'sed -i' Pavel Borzenkov
@ 2011-11-10 22:51 ` Peter Maydell
  2011-11-11 19:46 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2011-11-10 22:51 UTC (permalink / raw)
  To: Pavel Borzenkov; +Cc: qemu-devel

On 10 November 2011 20:26, Pavel Borzenkov <pavel.borzenkov@gmail.com> wrote:
> '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.
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

(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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1.0] configure: Do not use 'sed -i'
  2011-11-10 20:26 [Qemu-devel] [PATCH 1.0] configure: Do not use 'sed -i' Pavel Borzenkov
  2011-11-10 22:51 ` Peter Maydell
@ 2011-11-11 19:46 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2011-11-11 19:46 UTC (permalink / raw)
  To: Pavel Borzenkov; +Cc: Peter Maydell, qemu-devel

On 11/10/2011 02:26 PM, Pavel Borzenkov wrote:
> '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.
>
> Cc: Peter Maydell<peter.maydell@linaro.org>
> Signed-off-by: Pavel Borzenkov<pavel.borzenkov@gmail.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   configure |    6 +++++-
>   1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index 401d9a6..d6103c0 100755
> --- a/configure
> +++ b/configure
> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-11 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10 20:26 [Qemu-devel] [PATCH 1.0] configure: Do not use 'sed -i' Pavel Borzenkov
2011-11-10 22:51 ` Peter Maydell
2011-11-11 19:46 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).