[libav-devel] [PATCH] configure: Silence error messages when probing compiler.

Luca Barbato lu_zero at gentoo.org
Mon Aug 3 13:36:01 CEST 2015


On 03/08/15 13:31, Luca Barbato wrote:
> On 03/08/15 12:44, Shiz wrote:
>> On Xcode's clang on OS X, $cc --version will output a 'Configured with:'
>> line to stderr, which clobbers the configure script output. As this line
>> serves no further purpose, it should be silenced.
>>
>> The same applies to apple-gcc 4.2.1, which complains that it can not
>> understand the kernel version it is running on.
>> ---
>>  configure | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 482be43..2c3e77a 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2939,8 +2939,8 @@ probe_cc(){
>>  
>>      if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
>>          _type=llvm_gcc
>> -        gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
>> -        _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
>> +        gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
>> +        _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
>>          _depflags='-MMD -MF $(@:.o=.d) -MT $@'
>>          _cflags_speed='-O3'
>>          _cflags_size='-Os'
>> @@ -3003,7 +3003,7 @@ probe_cc(){
>>          _flags_filter=tms470_flags
>>      elif $_cc -v 2>&1 | grep -q clang; then
>>          _type=clang
>> -        _ident=$($_cc --version | head -n1)
>> +        _ident=$($_cc --version 2>/dev/null | head -n1)
>>          _depflags='-MMD -MF $(@:.o=.d) -MT $@'
>>          _cflags_speed='-O3'
>>          _cflags_size='-Os'
>>
> 
> Might be better have those checks pipe to the log instead, but I core
> idea is quite good.

I noticed some checks correctly do 2> $logfile while other do 2>
/dev/null, I guess that part can be made consistent later.

Martin and Janne, do you have a different opinion?

lu



More information about the libav-devel mailing list