Ethereal-dev: Re: [ethereal-dev] Ethereal on Solaris -- lexical scanner problems.

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, 5 Aug 1999 16:15:03 -0700 (PDT)
> I'm attempting to compile Ethereal on my Solaris machine.
> 
> Everything seems to go fine, until it gets to the linking stage.
> 
> At that point, there's apparently a conflict between the two parsers
> generated by lex/flex in libpcap and dfilter-scanner.
> 
> Any suggestions as to how to resolve this?  I am using gcc, on a
> Solaris-2.5.1 machine -- and using the Solaris lexical compiler.

Alas, Solaris's "lex", like Solaris's "yacc", doesn't have a nice
command-line argument to tell it to prefix global symbols with something
such as "ethereal_" or "pcap_"; the "Makefile.in" for "libpcap" will use
those features, if present, for "flex" and "bison", if your system has
them.

Right now, the only workaround I can offer is to get them and use them
to build "libpcap"; that should, at least, give its symbols names
prefixed with "pcap_", which should keep those symbols out of the way of
Ethereal - and of any other programs that use "libpcap" and
"lex"-generated scanners and/or "yacc"-generated parsers.

(Well, another possibility would be to edit "dfilter-scanner.c" and
"dfilter-grammar.c" by hand to rename the symbols.)

Ethereal requires "flex" and either "bison" or Berkeley "yacc"; we
distribute the results of those programs with Ethereal, so you don't
need them to build Ethereal (unless you modify the scanner or grammar),
but we don't use the prefixing features with them, so our scanner and
parser don't have symbols prefixed with, say, "ethereal_".

It might also be nice to, if there isn't "flex" or "bison", have the
build process run a "sed" script or something such as that to generate
the resulting ".c" file, to do the symbol renaming.