qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1.0] configure: pass suffix to 'sed -i' command


From: Pavel Borzenkov
Subject: Re: [Qemu-devel] [PATCH 1.0] configure: pass suffix to 'sed -i' command
Date: Thu, 10 Nov 2011 22:59:26 +0400

On Nov 10, 2011, at 10:18 PM, Peter Maydell wrote:

> On 10 November 2011 18:03, Pavel Borzenkov <address@hidden> 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.

I was trying to do minimal changes to the code.
Do you know sed implementations that do not support '-i'?

-- 
Pavel

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]