diff options
author | Gerald Combs <gerald@wireshark.org> | 2009-04-17 03:53:19 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2009-04-17 03:53:19 +0000 |
commit | b6dda791d29ec30b878860a462146e30013402f8 (patch) | |
tree | 3549cd58bbfd6b2110cbf9a675f92b79f833f455 /doc | |
parent | 7b3b6ed3f94dd69f369124512f0357019f23cf73 (diff) | |
download | wireshark-b6dda791d29ec30b878860a462146e30013402f8.tar.gz |
When building the wireshark-filter documentation on Windows, try to
figure out if we can run TShark. If we can't, just insert the dfref URL
in the documentation.
svn path=/trunk/; revision=28071
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile.nmake | 8 | ||||
-rwxr-xr-x | doc/dfilter2pod.pl | 50 |
2 files changed, 37 insertions, 21 deletions
diff --git a/doc/Makefile.nmake b/doc/Makefile.nmake index 18239aa9f8..4509930c69 100644 --- a/doc/Makefile.nmake +++ b/doc/Makefile.nmake @@ -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) \ diff --git a/doc/dfilter2pod.pl b/doc/dfilter2pod.pl index da2ac73a9e..143e8c6838 100755 --- a/doc/dfilter2pod.pl +++ b/doc/dfilter2pod.pl @@ -11,6 +11,8 @@ # # $Id$ +use Getopt::Std; + %ftenum_names = ( 'FT_NONE', 'No value', 'FT_PROTOCOL', 'Protocol', @@ -39,31 +41,39 @@ '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; } |