autoconf
[Top][All Lists]
Advanced

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

Re: m4 and autoconf problem on mac os x


From: Eric Blake
Subject: Re: m4 and autoconf problem on mac os x
Date: Wed, 02 Jun 2010 15:16:09 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Mnenhy/0.8.2 Thunderbird/3.0.4

On 06/02/2010 03:13 PM, Eric Blake wrote:
> On 06/02/2010 02:58 PM, Vincent Torri wrote:
>>
>> Hey,
>>
>> Our configure.ac contains, at the top:
>>
>> ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
>> ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
>> m4_define([v_maj], [0])
>> m4_define([v_min], [9])
>> m4_define([v_mic], [9])
>> m4_define([v_rev], m4_esyscmd([(svnversion . | grep -v exported || echo
>> 0) | awk -F : '{printf("%s", $1);}' | tr 'A-z' ' ' | sed 's/ //g']))
> 
> $1 of the m4 macro v_rev, or $1 of the awk script?
> 
>>
>> Does someone see the problem ?
> 
> My guess is that $1 is being expanded by m4.  Awk understands '$ 1'
> instead of '$1', try that to see if it helps.

Nope, that's not it.  The m4_esyscmd is being evaluated prior to the
definition of v_rev, so the m4 macro v_rev does not contain the sequence $1.

However, I do see another portability pitfall.  tr 'A-z' ' ' is nowhere
near portable.  What are you really trying to do with that sequence?
And why not use sed's y operator instead of using tr | sed, to shave a
process?

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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