[Top][All Lists]

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

Re: Empty else part in AS_IF

From: Eric Blake
Subject: Re: Empty else part in AS_IF
Date: Thu, 10 Oct 2013 16:45:33 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 10/10/2013 04:41 PM, Russ Allbery wrote:
> Eric Blake <address@hidden> writes:
>> Another solution is to ensure that AM_CONDITIONAL is always defined
>> (where its definition is a no-op if using an old automake that did not
>> already define it):
>> m4_define_default([AM_CONDITIONAL])
>> AS_IF([test x"$var" != xfalse],
>>       [$test=1],
>>       [AM_CONDITIONAL([TEST], [false])])
> This would reintroduce the same problem, though, wouldn't it?
> AM_CONDITIONAL would expand to nothing, and then the else branch of AS_IF
> would be empty.  Or does this give AS_IF enough information to figure that
> out because it avoids using the lower-level m4_* function?

If that's the case, then write AM_CONDITIONAL so that it always produces
a shell statement:

m4_define_default([AM_CONDITIONAL], [:])

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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