When building the wireshark-filter documentation on Windows, try to
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 17 Apr 2009 03:53:19 +0000 (03:53 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 17 Apr 2009 03:53:19 +0000 (03:53 +0000)
figure out if we can run TShark. If we can't, just insert the dfref URL
in the documentation.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28071 f5534014-38df-0310-8fa8-9805f1628bb7

doc/Makefile.nmake
doc/dfilter2pod.pl

index 18239aa9f8d3ea611490e36752116efa4ff103b6..4509930c69cf1b14706660148530ce44bbe90b62 100644 (file)
@@ -83,11 +83,17 @@ wireshark-filter.html: wireshark-filter.pod ../config.h ws.css
        --noindex                                 \
        wireshark-filter.pod > wireshark-filter.html
 
-wireshark-filter.pod: wireshark-filter.pod.template  ../tshark.exe
+tabchar=       
+# We can't generate a filter list if we can't run TShark.
+wireshark-filter.pod: wireshark-filter.pod.template  dfilter2pod.pl ../tshark.exe
+!if "$(PROCESSOR_ARCHITECTURE)" == "x86" && "$(WIRESHARK_TARGET_PLATFORM)" != "win32"
+       $(PERL) dfilter2pod.pl -e wireshark-filter.pod.template > wireshark-filter.pod
+!else
        cd ..
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-all
        $(INSTALL_DIR)\tshark.exe -G | $(PERL) doc\dfilter2pod.pl doc\wireshark-filter.pod.template > doc\wireshark-filter.pod
        cd doc
+!endif
 
 capinfos.1: capinfos.pod ../config.h
        $(POD2MAN)                      \
index da2ac73a9ec854d648f9e2c85824aa01c2f95714..143e8c68386b714a116133c0bf864bd618b00a3f 100755 (executable)
@@ -11,6 +11,8 @@
 #
 # $Id$
 
+use Getopt::Std;
+
 %ftenum_names = (
        'FT_NONE',              'No value',
        'FT_PROTOCOL',          'Protocol',
        'FT_FRAMENUM',          'Frame number',
 );
 
-# Read all the data into memory
-while (<STDIN>) {
-       next unless (/^([PF])/);
-
-       $record_type = $1;
-       # Strip the line from its line-end sequence
-       # chomp($_) won't work on Win32/CygWin as it leaves the '\r' character.
-       $_ =~ s/[\r\n]//g;
+getopts('e');
 
-       # Store protocol information
-       if ($record_type eq 'P') {
-               ($junk, $name, $abbrev) = split(/\t+/, $_);
-               $proto_abbrev{$name} = $abbrev;
-       }
-       # Store header field information
-       else {
-               ($junk, $name, $abbrev, $type, $parent, $blurb) =
-                       split(/\t+/, $_);
-               push(@{$field_abbrev{$parent}}, $abbrev);
-               $field_info{$abbrev} = [ $name, $type, $blurb ];
+if ($opt_e) {
+       $proto_abbrev{'Unable to generate filter documentation'} =
+               'Please refer to http://www.wireshark.org/docs/dfref/';
+       printf STDERR "Creating empty filter list.\n";
+} else {
+       # Read all the data into memory
+       while (<STDIN>) {
+               next unless (/^([PF])/);
+       
+               $record_type = $1;
+               # Strip the line from its line-end sequence
+               # chomp($_) won't work on Win32/CygWin as it leaves the '\r' character.
+               $_ =~ s/[\r\n]//g;
+       
+               # Store protocol information
+               if ($record_type eq 'P') {
+                       ($junk, $name, $abbrev) = split(/\t+/, $_);
+                       $proto_abbrev{$name} = $abbrev;
+               }
+               # Store header field information
+               else {
+                       ($junk, $name, $abbrev, $type, $parent, $blurb) =
+                               split(/\t+/, $_);
+                       push(@{$field_abbrev{$parent}}, $abbrev);
+                       $field_info{$abbrev} = [ $name, $type, $blurb ];
+               }
        }
 }
 
 # if there was no input on stdin, bail out
-if ($record_type ne 'P' and $record_type ne 'F') {
+if ($record_type ne 'P' and $record_type ne 'F' and !defined($opt_e)) {
        exit;
 }