automake
[Top][All Lists]
Advanced

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

Re: Weird behaviour of AM_CONDITIONAL


From: Eric Blake
Subject: Re: Weird behaviour of AM_CONDITIONAL
Date: Fri, 02 Sep 2011 10:48:11 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.12

On 09/02/2011 08:24 AM, Thibaut Le Guilly wrote:
I am using AM_CONDITIONAL to enable a user to choose between one kind of
library and another one with :

AM_CONDITIONAL([ENABLE_A], [test x$condition=xyes])

> Am I doing something wrong? Do you know how to solve this problem?

Wrong syntax.  You meant:

test "x$condition" = xyes

the quoting around $condition, and the spacing around =, are essential in shell syntax. Otherwise, if $condition has no whitespace to cause IFS word splitting, you end up testing whether the single word x$condition=xyes is non-empty, which it is, so the test is always true.

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



reply via email to

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