[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_ARGS_ENABLE default behaviour not working
From: |
jling |
Subject: |
Re: AC_ARGS_ENABLE default behaviour not working |
Date: |
Sun, 18 Jan 2004 23:18:30 -0800 |
Thank you Eric for pointing out my error and for showing me better form.
John Ling
----- Original Message -----
From: Eric Sunshine <address@hidden>
Date: Sunday, January 18, 2004 8:44 pm
Subject: Re: AC_ARGS_ENABLE default behaviour not working
> On Sun, 18 Jan 2004 19:03:23 -0800, address@hidden wrote:
> > I can only get program1 to be generated if I specifically run:
> > configure --enable-toolbox. But if I just do a: configure
> > I don't get the program built. Isn't the default behaviour, to
> build> in this case, based on what I have below? In my configure.ac:
> > AC_ARG_ENABLE(toolbox,
> > [ --enable-toolbox Build Atlas toolbox applications],
> > [case "${enableval}" in
> > yes) toolbox=true ;;
> > no) toolbox=false ;;
> > *) AC_MSG_ERROR(bad value ${enableval} for --
> > enable-toolbox) ;;
> > esac],
> > [toolbox=true])
> > AM_CONDITIONAL(TOOLBOX, test "$enable_toolbox" = yes)
>
> There are a couple problems. First, the name of the shell
> variable is
> "enable_toolbox", not "toolbox". Second, your AM_CONDITIONAL() is
> checking
> for a value of "yes", however you are setting the variable to true
> or false.
> "yes" is not the same as true or false. Note also that
> AC_ARG_ENABLE(),
> automatically sets enable_toolbox, so setting the variable again
> in the
> 'case' statement is redundant. Here is an improved version (with
> proper m4
> quoting):
>
> AC_ARG_ENABLE([toolbox],
> [AC_HELP_STRING([--enable-toolbox], [build Atlas toolbox
> applications])], [case $enableval in
> yes|no) ;;
> *) AC_MSG_ERROR([bad value $enableval for --enable-
> toolbox]) ;;
> esac],
> [enable_toolbox=yes])
> AM_CONDITIONAL([TOOLBOX], [test $enable_toolbox = yes])
>
> -- ES
>