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)
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf