Building a Static TShark on RedHat 5.9 (Tikanga)
September 17, 2013
Posted by on
RedHat 5.9 uses many outdated packages. Unfortunately Wireshark versions from at least v1.8.2 (and possibly earlier but at least after v1.6.16) require glib 2.14 or better when RHEL5 only provides glib 2.12 (RPM glib2-2.12.3-4.el5_3.1).
Initially I tried downloading the latest glib from http://www.gtk.org/download/linux.php which took me to glib v2.36. However I quickly discovered that this required Python 2.5 which, as you guessed, was more recent than the Python 2.4 supplied with RedHat.
I downloaded glib v2.26 and extracted it and built it with the following configuration line:
./configure --enable-static --prefix=/tmp/glib
Next I built with the following configure line for Wireshark after downloading v1.10.2 and extracting:
CFLAGS=-fPIC LD_LIBRARY_PATH=/tmp/glib/lib PKG_CONFIG_PATH=/tmp/glib/lib/pkgconfig \
The CFLAGS=-fPIC was necessary to complete a static build. This forum post documented how to specify a custom glib directory when building tshark (by specifying the LD_LIBRARY_PATH and PKG_CONFIG_PATH environment variables).