Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] how to cross-compile tshark and tools

From: George Nychis <gnychis@xxxxxxxxx>
Date: Wed, 13 Apr 2011 10:32:53 -0400
Hi all,

I am trying to cross-compile tshark for an arm system, but I am hitting an issue I am not sure how to overcome.

I have added my gcc cross-compiler to my path, and configured my system as:
./configure -host=arm-eabi --disable-wireshark --with-pcap=no

I succeed in building several of the components, but whenever it comes down to building the "epan" related components I hit the error that:
make[3]: Entering directory `/home/gnychis/Documents/wireshark/epan/dfilter'
../../tools/lemon/lemon t=./../../tools/lemon/lempar.c ./grammar.lemon || \
                (rm -f grammar.c grammar.h ; false)
/bin/bash: ../../tools/lemon/lemon: cannot execute binary file

Well, this is expected since lemon was built using my cross-compiler.

But, I am not sure what to do at this point.  I cannot use lemon since it is not built for the host, but I could build lemon specifically for the host... but would that create issues for when the target is on arm?

I'd greatly appreciate any feedback.

Thanks!
George