staticcross-compilingwiresharkwireshark-dissector

How to static compile tshark?


I compiled tshark with cmake. I running command cmake -DBUILD_wireshark=off; make CFLAGS="-static", then i found BUILD_wiresharktshark in build/run, but it's dynamic link, and dependency more xxx.so.

What should i do? Thanks;

I only need the filter. May be there is a best way?


Solution

  • Solved! I use confiugre:

    ./configure --enable-static=yes --enable-wireshark=no --disable-gtktest --enable-shared=no --with-zlib=no -with-gnutls=no --with-krb5=no --with-adns=no --with-geoip=no --with-plugins=no --enable-editcap=no --enable-capinfos=no --enable-mergecap=no --enable-text2pcap=no --enable-idl2wrs=no --enable-dftest=no --enable-randpkt=no --enable-rawshark=no --enable-dumpcap=no --enable-androiddump=no --with-gcrypt=no --with-libsmi=no --without-portaudio --without-lua --disable-glibtestst --with-gtk2=no --with-gtk3=no

    But, a lots of librarys not provide static version on my OS(Fedora 32).

    Next, i build a lots of static librarys: c-ares, eudev-1.5, libgcrypt-1.8.7, glib, libnl-3.2.25, libusb.

    Then, successed :-).

    Oh, --enable-dumpcap=no is optional, because i needn't capture network packets.