[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Empty else part in AS_IF
From: |
Julien ÉLIE |
Subject: |
Re: Empty else part in AS_IF |
Date: |
Wed, 09 Oct 2013 21:47:46 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
Hi Eric,
First of all, thanks for your answer.
AS_IF([test x"$var" != xfalse],
[$test=1],
[m4_ifdef([AM_CONDITIONAL],
[AM_CONDITIONAL([TEST], [false])])])
gives the following configure code with autoconf 2.69:
if test x"$var" != xfalse; then :
$test=1
That's unusual shell syntax (it does NOT do a variable assignment; did
you mean 'test=1' instead of trying to execute the program whose name is
the expansion of $test concatenated with '=1'?)
Yes, you're right. I meant to write "test=1" in the provided sample.
We have a far more complex m4 file (used for INN, a news server), and I
just wanted to provide a minimal AS_IF to explain what I was facing.
It is the reason why the error I quoted from configure is at line 23581 :)
./configure: line 23581: syntax error near unexpected token `fi'
./configure: line 23581: `fi'
else
fi
which is not a valid syntax.
Indeed. The problem is that autoconf cannot tell if a non-empty literal
will expand to empty text (m4_ifdef results in no output). You'll have
to workaround it yourself:
AS_IF([test x"$var" != xfalse],
[$test=1],
[: m4_ifdef(...)])
Thanks for the suggestion of [: m4_ifdef(...)]. It looks prettier than
adding [:] in the arguments of m4_ifdef.
Have a nice week,
--
Julien ÉLIE
« S.M.I.G. : Sesterce Minimum d'Intérêt Gaulois. » (Astérix)
- Empty else part in AS_IF, Julien ÉLIE, 2013/10/09
- Re: Empty else part in AS_IF, Eric Blake, 2013/10/09
- Re: Empty else part in AS_IF,
Julien ÉLIE <=
- Re: Empty else part in AS_IF, Thomas Jahns, 2013/10/10
- Re: Empty else part in AS_IF, Eric Blake, 2013/10/10
- Re: Empty else part in AS_IF, Julien ÉLIE, 2013/10/10
- Re: Empty else part in AS_IF, Russ Allbery, 2013/10/10
- Re: Empty else part in AS_IF, Eric Blake, 2013/10/10
- Re: Empty else part in AS_IF, Russ Allbery, 2013/10/10
Re: Empty else part in AS_IF, Russ Allbery, 2013/10/10