[Snort-devel] --disable-debug enables debug

Bob Perkins rnpnj at ...398...
Tue Jun 25 08:30:16 EDT 2002


According to the following extract from the autoconf manual
(http://www.gnu.org/manual/autoconf/html_mono/autoconf.html)
autoconf and configure are working correctly.  The parameters are for
1) what to do if either enable or disable is used and 2) what to do if
neither one is used.

Bob

===================================================================
AC_ARG_ENABLE (feature, help-string, [action-if-given], [action-if-not-given])      Macro
If the user gave configure the option --enable-feature or --disable-feature, run shell commands
action-if-given. If neither option was given, run shell commands action-if-not-given. The name
feature indicates an optional user-level facility. It should consist only of alphanumeric
characters and dashes.

The option's argument is available to the shell commands action-if-given in the shell variable
enableval, which is actually just the value of the shell variable enable_feature, with any -
characters changed into _. You may use that variable instead, if you wish. The help-string
argument is like that of AC_ARG_WITH (see External Software).

You should format your help-string with the macro AC_HELP_STRING (see Pretty Help Strings).
===================================================================

--- Fyodor <fygrave at ...1...> wrote:
> > 
> > In configure.in, the parameters for debug are:
> > ================================
> > AC_ARG_ENABLE(debug,
> > [  --enable-debug       enable debugging options (bugreports and developers only)],
> >                 [ if test -n "$GCC"; then
> >                     CFLAGS="$CFLAGS -DDEBUG -ggdb"
> >                   else
> >                     CLFLAGS="$CFLAGS -DDEBUG"
> >                   fi
> >                 ],)
> > ================================
> > 
> > This generates the following lines in configure:
> > ================================
> > # Check whether --enable-debug or --disable-debug was given.
> > if test "${enable_debug+set}" = set; then
> >   enableval="$enable_debug"
> >    if test -n "$GCC"; then
> >                     CFLAGS="$CFLAGS -DDEBUG -ggdb"
> >                   else
> >                     CLFLAGS="$CFLAGS -DDEBUG"
> >                   fi
> > 
> > fi
> > ================================
> > The problem comes from the fact that ${enable_debug+set} is
> > equal to "set" whenever any form of enable-debug or disable-debug
> > is used as an argument.  Adding a line to configure.in to check the
> > actual value of $enable-debug solves the problem:
> > 
> 
> this looks more like configure bug, cuz semantics of AC_ARG_ENABLE() is
> 
> AC_ARG_ENABLE(option, help messages, what to do if enable, what to do if disable);
> 
> and the 'disable' part is obviously empty there.
> 
> -- 
> http://www.notlsd.net
> PGP fingerprint = 56DD 1511 DDDA 56D7 99C7  B288 5CE5 A713 0969 A4D1

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com




More information about the Snort-devel mailing list