autoconf
[Top][All Lists]
Advanced

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

Re: AS_HELP_STRING in an m4 macro: different decription wrt arguments


From: Ralf Wildenhues
Subject: Re: AS_HELP_STRING in an m4 macro: different decription wrt arguments
Date: Tue, 26 Jan 2010 06:09:17 +0100
User-agent: Mutt/1.5.20 (2009-10-28)

Hello Vincent,

* Vincent Torri wrote on Tue, Jan 26, 2010 at 01:00:22AM CET:
> i would like to use AS_HELP_STRING in an m4 macro such that the
> description of the help is different according to the value of one
> parameter. The macro is the following:
> 
> dnl use: ECORE_CHECK_MODULE(Foo, default-enabled[, dependancy[, 
> ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
> AC_DEFUN([ECORE_CHECK_MODULE],
> [
> m4_pushdef([UP], m4_toupper([$1]))dnl
> m4_pushdef([DOWN], m4_tolower([$1]))dnl
> 
> want_module=$2
> 
> if test "x${want_module}" = "xyes" ; then
>    wanted_value="enabled"
> else
>    wanted_value="disabled"
> fi
> 
> AC_ARG_ENABLE([ecore-]m4_defn([DOWN]),
>    [AS_HELP_STRING(
>        [--enable-ecore-[]m4_defn([DOWN])],
>        [enable the ecore_]m4_defn([DOWN])[ module. 
> @<:@default=$wanted_value@:>@])],
>    [want_module="$enableval"],
>    [want_module="no"])
> 
> AC_MSG_CHECKING([whether ecore_]m4_defn([DOWN])[ module is to be built])
> 
> AS_IF([test "x$have_ecore_[]m4_defn([DOWN])" = "xyes"], [$4], [$5])
> 
> m4_popdef([UP])
> m4_popdef([DOWN])
> ])
> 
> 
> What is displayed by --help is:
> 
>   --enable-ecore-job      enable the ecore_job module. [default=$wanted_value]
> 
> I've searched a lot, tried a lot of things, nothing worked and i
> have no more idea.

I assume you want $wanted_value to expand to either enabled or disabled?
Well, that cannot work: in the generated configure script, the --help
text comes before the code that actually deals with the command line
arguments.

Also, if your default value would depend on the configure command line,
then it wouldn't be the "default" value, right?

Cheers,
Ralf




reply via email to

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