On Wed, 27 Jan 2010, Ralf Wildenhues wrote:
* Vincent Torri wrote on Tue, Jan 26, 2010 at 09:14:46AM CET:
On Tue, 26 Jan 2010, Ralf Wildenhues wrote:
If we assume that $2 is a literal `yes' or `no', i.e., the value can
be decided at autoconf time (rather than at configure time) it seems
it should be possible to expand to enabled or disabled depending on
the value of $2.
Well, in that case Vincent should use $2 in the argument to
AS_HELP_STRING, not $wanted_value. Sorry for not reading close enough.
ok. I will change the value of $2 to be "enabled" or "disabled",
instead of "yes" or "no".
There is no need for that.
You can choose different strings at m4 time (i.e., at autoconf run time)
if that's your point. You just can't use shell code for this, because
it is run way later, at configure run time.
Use something like
m4_if([$2],
[yes], [enabled],
[no], [disabled],
[unknown default])
in the argument to AS_HELP_STRING.
It seems that the way I use that advice is not good :
AC_ARG_ENABLE(ecore-$1,
[AC_HELP_STRING(
[--enable-ecore-$1],
[enable the ecore_]m4_defn([DOWN])[ module@<:@default=]m4_if([$2],
[yes], [enabled], [no], [disabled], [unknown default])[@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_module="yes"
else
want_module="no"
fi
])
The confgure help gives, for example:
--enable-ecore-txt enable the ecore_txt module[default=]
Vincent Torri
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf