Wireshark-users: [Wireshark-users] Build problems with Sun's compiler on Solaris 10
From: "Dr. David Kirkby" <david.kirkby@xxxxxxxxxx>
Date: Wed, 06 Feb 2008 23:25:30 +0000
I've trying to build wireshark-0.99.7 on a Sun Blade 2000 workstation running Solaris 10 update 4 using Sun's studio 11 compiler suite.

Here are some notes. #6 is a show-stopper, as it is stopping me building wireshark - the others are minor points I believe which need fixing, but are quite easy to fix.

1) Unlike the case with trying to build with gcc (see my post of half an hour ago on wireshark-users), the Sun compiler seems to pick up gtk properly.

checking for pkg-config... /usr/bin/pkg-config
checking for GTK+ - version >= 2.0.0... yes (version 2.4.9)
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for GLIB - version >= 2.0.0... yes (version 2.4.1)
checking whether GLib supports loadable modules... yes

This is good of course, but I was not so fortunate with gcc. (Looking at the reply to that post Jeff Morriss has suggested a fix, which I have not yet tried).


2) I just installed libpcap from the file libpcap-0.9.8.tar.gz, but the wireshark configure script complains that the pcap library is more recent than the pcap header.

checking whether pcap_breakloop is present and usable... broken
configure: WARNING: Your pcap library is more recent than your pcap header.
configure: WARNING: Wireshark won't be able to use functions not declared
configure: WARNING: in that header. You should install a newer version of
configure: WARNING: the header file.
checking whether pcap_findalldevs is present and usable... yes
checking for pcap_datalink_val_to_name... yes

I've no idea why this should be so.

3) If I ignore that warning about the pcap then the rest of the program configures OK

The Wireshark package has been configured with the following options.
                  Build wireshark : yes
                     Build tshark : yes
                   Build capinfos : yes
                    Build editcap : yes
                    Build dumpcap : yes
                   Build mergecap : yes
                  Build text2pcap : yes
                    Build idl2wrs : yes
                    Build randpkt : yes
                     Build dftest : yes

                   Install setuid : no
                      Use plugins : yes
                 Build lua plugin : no
                 Build rtp_player : no
              Use GTK+ v2 library : yes
                      Use threads : no
           Build profile binaries : no
                 Use pcap library : yes
                 Use zlib library : yes
                 Use pcre library : no
             Use kerberos library : no
             Use GNU ADNS library : no
              Use SMI MIB library : no
           Use GNU crypto library : no
           Use SSL crypto library : no
         Use IPv6 name resolution : no
               Use gnutls library : yes
               Use libcap library : no



4) There is an an error compiling
plugins/ethercat/packet-ethercat-frame.c
and
plugins/ethercat/packet-ethercat-frame.h

but I found this bug had been reported before
http://www.mail-archive.com/wireshark-bugs@xxxxxxxxxxxxx/msg06382.html
and the patch here
http://www.mail-archive.com/wireshark-bugs@xxxxxxxxxxxxx/msg06391.html

solved that one.

5) There are a large number of errors when trying to compile plugins/ethercat/packet-ecatmb.h but these are quite easy to solve. Basically, every structure is declared like this

struct
 {
 <some code>
 };

but the sun compiler complains unless a name for the structure is given. i.e.

struct
 {
 <some code>
 }ANY_NAME_YOU_WANT;

Hence one can fix this by adding anything for a name. This needs to be done on lines 110, 137, 151, 180, 355, 395, 401, 454 and 459 of plugins/ethercat/packet-ecatmb.h (Looking at the patch referenced above, that was one of the issues the patch solves, but it needs to be done in another file too).

6) NOW THIS IS THE SERIOUS PROBLEM - it stops me building wireshark and I have not yet found a solution.

./configure CC=/opt/SUNWspro/bin/cc CXX=/opt/SUNWspro/bin/CC
This configures OK - see above for what is configured.

gmake

After quite a bit of time compiling OK, the compilation process aborts with:

source='packet-ecatmb.c' object='packet-ecatmb.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
/bin/bash ../../libtool --tag=CC --mode=compile /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I/usr/local/include -I/usr/local/include '-DPLUGIN_DIR="/usr/local/lib/wireshark/plugins/0.99.7"' -D_U_="" -g -I/usr/local/include -mt -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/openwin/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -c -o packet-ecatmb.lo packet-ecatmb.c /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I/usr/local/include -I/usr/local/include -DPLUGIN_DIR=\"/usr/local/lib/wireshark/plugins/0.99.7\" -D_U_= -g -I/usr/local/include -mt -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/openwin/include -I/usr/sfw/include -I/usr/sfw/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -c packet-ecatmb.c -KPIC -DPIC -o .libs/packet-ecatmb.o
"packet-ecatmb.c", line 291: improper member use: Control
"packet-ecatmb.c", line 292: improper member use: Element
"packet-ecatmb.c", line 323: improper member use: Type
"packet-ecatmb.c", line 325: improper member use: Type
"packet-ecatmb.c", line 329: improper member use: Type
"packet-ecatmb.c", line 334: improper member use: Type
"packet-ecatmb.c", line 337: improper member use: Type
"packet-ecatmb.c", line 340: improper member use: Type
"packet-ecatmb.c", line 343: improper member use: Type
"packet-ecatmb.c", line 346: improper member use: Type
"packet-ecatmb.c", line 349: improper member use: Type
"packet-ecatmb.c", line 352: improper member use: Type
"packet-ecatmb.c", line 355: improper member use: Type
"packet-ecatmb.c", line 362: improper member use: Fragment
"packet-ecatmb.c", line 367: improper member use: Fragment
"packet-ecatmb.c", line 368: improper member use: OffsetBuffer
"packet-ecatmb.c", line 370: improper member use: OffsetBuffer
"packet-ecatmb.c", line 375: improper member use: FrameNo
"packet-ecatmb.c", line 380: improper member use: LastFragment
"packet-ecatmb.c", line 388: improper member use: Number
"packet-ecatmb.c", line 393: improper member use: Type
"packet-ecatmb.c", line 396: improper member use: Type
"packet-ecatmb.c", line 399: improper member use: Type
"packet-ecatmb.c", line 402: improper member use: Type
"packet-ecatmb.c", line 405: improper member use: Type
"packet-ecatmb.c", line 408: improper member use: Type
"packet-ecatmb.c", line 411: improper member use: Type
"packet-ecatmb.c", line 414: improper member use: Type
"packet-ecatmb.c", line 417: improper member use: Type
"packet-ecatmb.c", line 452: improper member use: OpCode
"packet-ecatmb.c", line 454: improper member use: OpCode
"packet-ecatmb.c", line 511: improper member use: PacketNo
"packet-ecatmb.c", line 514: improper member use: PacketNo
"packet-ecatmb.c", line 520: improper member use: Entire
"packet-ecatmb.c", line 521: improper member use: Done
"packet-ecatmb.c", line 521: improper member use: Entire
"packet-ecatmb.c", line 523: improper member use: Done
"packet-ecatmb.c", line 523: improper member use: Entire
"packet-ecatmb.c", line 546: improper member use: Error
"packet-ecatmb.c", line 548: improper member use: InComplete
"packet-ecatmb.c", line 552: improper member use: DataState
"packet-ecatmb.c", line 554: improper member use: Name
"packet-ecatmb.c", line 556: improper member use: Attribute
"packet-ecatmb.c", line 558: improper member use: Unit
"packet-ecatmb.c", line 560: improper member use: Min
"packet-ecatmb.c", line 562: improper member use: Max
"packet-ecatmb.c", line 564: improper member use: Value
"packet-ecatmb.c", line 566: improper member use: OpCode
"packet-ecatmb.c", line 629: improper member use: Number
"packet-ecatmb.c", line 633: improper member use: Type
"packet-ecatmb.c", line 639: improper member use: Type
"packet-ecatmb.c", line 836: improper member use: OpCode
"packet-ecatmb.c", line 990: improper member use: Error
"packet-ecatmb.c", line 992: improper member use: InComplete
"packet-ecatmb.c", line 994: improper member use: OpCode
"packet-ecatmb.c", line 1058: improper member use: Type
"packet-ecatmb.c", line 1059: improper member use: Fragment
"packet-ecatmb.c", line 1073: improper member use: Type
"packet-ecatmb.c", line 1077: improper member use: Type
"packet-ecatmb.c", line 1080: improper member use: Fragment
"packet-ecatmb.c", line 1084: improper member use: OffsetBuffer
"packet-ecatmb.c", line 1088: improper member use: FrameNo
"packet-ecatmb.c", line 1092: improper member use: LastFragment
"packet-ecatmb.c", line 1096: improper member use: TimeStampRequested
"packet-ecatmb.c", line 1098: improper member use: TimeStampRequested
"packet-ecatmb.c", line 1102: improper member use: TimeStampAppended
"packet-ecatmb.c", line 1104: improper member use: TimeStampAppended
"packet-ecatmb.c", line 1111: improper member use: Fragment
"packet-ecatmb.c", line 1117: improper member use: TimeStampAppended
"packet-ecatmb.c", line 1180: improper member use: MacFilterCount
"packet-ecatmb.c", line 1186: improper member use: MacFilterMaskCount
"packet-ecatmb.c", line 1351: improper member use: Counter
"packet-ecatmb.c", line 1358: improper member use: Type
cc: acomp failed for packet-ecatmb.c
gmake: *** [packet-ecatmb.lo] Error 1



Any suggestions?