tcpdump mailing list archives

Re: Problem build tcpdump pcap_parse is undefined


From: Guy Harris <guy () alum mit edu>
Date: Sat, 30 Jun 2012 15:05:36 -0700


On Jun 3, 2012, at 12:33 PM, Giovanni wrote:

I tried to build libpcap with 

./configure --without-flex --without-bison
the problem is always the same.

Have you tried building with just

        ./configure

(so that it uses Flex and Bison) and if you build with

        ./configure --without-flex --without-bison

(so that it uses "lex" and "yacc", which are, on your system, probably Flex and Bison run as "lex" and "yacc" and thus 
running in compatibility mode)?

/tmp/libpcap> nm -po libpcap.a | egrep parse
libpcap.a:gencode.o:         U pcap_parse
libpcap.a:gencode.o:00009a00 T finish_parse
libpcap.a:grammar.o:00000070 T yyparse
libpcap.a:grammar.o:         U finish_parse

So that's what you get when you build with

        ./configure --without-flex --without-bison

If so, the problem *might* be that, because you told the configure script to use lex and yacc rather than flex and 
bison, it's saying "we don't have flex, so we won't pass in a -P flag to lex or a -p flag to yacc", but "yacc" is 
probably just a wrapper for "bison -y" on your system.

If -y just changes what file names Bison produces as output and does *NOT* cause it to leave YYBISON undefined, then, 
as no -p flag is being passed to Bison, it won't put in the #defines to cause the parser to be called pcap_parse() 
rather than yyparse(), but, as YYBISON is defined, the pcap_parse() wrapper for yyparse() will *NOT* be compiled, and 
so there won't be a pcap_parse() produced.

Try *NOT* using --without-flex --without-bison in the configure script; you have Flex and Bison (and *don't* have Real 
Lex or Real Yacc), so I don't see a need to use those options.  I suspect that will work.  (Building with 
--without-flex --without-bison doesn't work on OS X, which also comes with Flex and Bison; building without those two 
options *does* work.)-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: