Ethereal-dev: Re: [Ethereal-dev] H.225 problem, and running under gdb

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Noah Misch <noah@xxxxxxxxxxxxxx>
Date: Sun, 20 Jun 2004 10:37:05 -0700
On Sun, Jun 20, 2004 at 11:42:22AM +0100, Graeme Hewson wrote:
> Joerg Mayer wrote:
> 
> >See my earlier answer to this problem: in bash, do CFLAGS="-O0" ./configure
> >and you should be fine.
> 
> Thanks, but I've just tried this and I get:
> 
> 
> CFLAGS = -DINET6 -D_U_="__attribute__((unused))" -Wall -W -O0 
> -I/usr/local/include -pthread -I/usr/include/gtk-2.0 
> -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
> -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -g -O2 -Dlinux -I. 
> -I/usr/local/include
> 
> IOW, -O0 followed by -O2.  Also, CPPFLAGS has -O2.

Interesting.  You're building ethereal with Net-SNMP, which causes the build
process to add `net-snmp-config --cflags` to both CFLAGS and CPPFLAGS, and that
string contains -O2.  This is a misfeature of Net-SNMP.

If you're not presently using SNMP decoding functionality in ethereal, the
easiest solution is to ``./configure --without-net-snmp --without-ucd-snmp
CFLAGS="-g"'' (or ``CFLAGS="-g" ./configure ...'').  Note that you do need to
explicitly include -g if you override the default value of CFLAGS.

If you do need to use Net-SNMP while debugging this and would like to avoid
editing each Makefile manually, you can change these lines in configure.in

        CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`"
        CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags`"

to something like

        CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags | sed 's/-O2//`"
        CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags | sed 's/-O2//`"

Meanwhile, I will bring this issue to the attention of the Net-SNMP developers.

Thanks.