Ethereal-dev: Re: [Ethereal-dev] check for NEED_GETOPT_H missing from configure.in?

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Thu, 24 Oct 2002 17:31:50 -0700
On Thu, Oct 24, 2002 at 05:11:05PM +1000, Tim Potter wrote:
> On Tue, Oct 15, 2002 at 03:43:16PM +1000, Tim Potter wrote:
> 
> > OK silly question time: I'm having trouble building ethereal:
> > 
> > gcc -DHAVE_CONFIG_H -I. -I. -I..   -I.. -I../wiretap
> > -I/usr/local/include  -DINET6 -D_U_="__attribute__((unused))" -Wall -W
> > -g -O2 -I.. -I../wiretap -I/usr/local/include -I/usr/include/gtk-1.2
> > -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -c
> > main.c
> > main.c: In function `main':
> > main.c:1450: warning: implicit declaration of function `getopt'
> > main.c:1696: `optind' undeclared (first use in this function)
> > main.c:1696: (Each undeclared identifier is reported only once
> > main.c:1696: for each function it appears in.)
> > make[2]: *** [main.o] Error 1
> > 
> > I've tracked it down to the fact that the NEED_CONFIG_H define is not
> > being written to config.h.in by autoheader.  Now I think this is because
> > there is no check and corresponding AC_DEFINE for it in configure.in.
> > 
> > Has anyone else been seeing this recently or is my flu medication
> > affecting my brain somehow?
> 
> So no one else is seeing this problem?  I'm seeing it on Debian unstable
> and Redhat 7.3.

I'm not seeing it, on whatever random version of RH we had on a machine
here, and haven't seen it on the Debian 2.2 on one of my home machines.

I'd say the problem has nothing to do with NEED_GETOPT_H being defined;
it has to do with gtk/main.c and gtk2/main.c not including <unistd.h>,
as the Single UNIX Specification says you should include <unistd.h> if
you're using "getopt()".  I've checked in a change to make them both do
so.