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

Wireshark-dev: Re: [Wireshark-dev] complie fail on WinXP 32bit

From: Andreas Heise <aheise.lists@xxxxxxxxxxxxxx>
Date: Sun, 22 Mar 2009 18:38:48 +0100

Hi Bill,
 
thanks for your reply, if I called directly from cygwin bash it's OK...
 
aheise@83888ab05d01485 /cygdrive/c/wireshark
$ bash -o igncr
aheise@83888ab05d01485 /cygdrive/c/wireshark
$ grep '^register_tap_listener_[a-z_0-9A-Z]* *(' \tap-rtp.c 2>/dev/null | \

> grep -v ';' | \
> sed -e 's/(.*//'

register_tap_listener_rtp_streams
aheise@83888ab05d01485 /cygdrive/c/wireshark
$
 
any other idea? Seems to be a problem of variables $... ?!
 
regards,
Andreas

2009/3/22 Bill Meier <wmeier@xxxxxxxxxxx>
Andreas Heise wrote:
Hi list,
 I followed the developers guide to build wireshark from trunk rev 27814 on WinXP.
 complie is running long time, so the basics should setup correctly, but then it
fails during make of *tshark-tap-register.c*
 environment:
 WinXP SP3 32bit
Microsoft Visual C++ 2008 Express Edition
Python 2.6
Cygwin 3.2.48(21)
Wireshark sources svn trunk 27814
 any hint would be great ;-)
 many thanks,
Andreas
 #################
#################
 content of tshark-tap-register.c:
 /* Do not modify this file.  */
/* It is created automatically by the Makefile.  */
#include "register.h"
void register_all_tap_listeners(void) {
 { extern void File STDIN: (void);
   File STDIN: ();}
 { extern void unmatched (void);
   unmatched ();}


tshark-tap-register.c should look like this:

...
 { extern void register_tap_listener_rtp_sttreams (void);
   register_tap_listener_rtp_streams ();}
...

The key statement from make-tapreg-dotc (a bash shell script which generates tshark-tap-register.c) is as follows:

grep '^register_tap_listener_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | \
        grep -v ';' | \
        sed -e 's/(.*//'

This statement finds and extracts the function name from statements like the following in the source code.

  register_tap_listener_rtp_streams(void)


The contents you show for tshark-tap-register.c suggests that the above code is generating an error message containing the words 'STDIN' and 'unmatched'.

So: although I don't know what's wrong, I would start with the basics.

Is it possible that your PATH is such that non-cygwin versions of grep or sed are being used ?

One way to debug this would be to do essentially try executing the above manually and see what happens.

bash -o igncr
grep '^register_tap_listener_[a-z_0-9A-Z]* *(' \
 tap-rtp.c 2>/dev/null | \
 grep -v ';' | \
 sed -e 's/(.*//'



Please let us know what you find so we can update the developer's guide if needed.

Thanks