diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2014-08-01 16:14:23 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-08-02 01:00:05 +0000 |
commit | 6b11cd97f2153bb015ade6efd05929999de85457 (patch) | |
tree | 361e91fabf668189dba6ecb8b8653e4b9313d76f | |
parent | 69d0788875b81b2cdd0c751f00eb5b20944ffe15 (diff) | |
download | wireshark-6b11cd97f2153bb015ade6efd05929999de85457.tar.gz wireshark-6b11cd97f2153bb015ade6efd05929999de85457.tar.bz2 wireshark-6b11cd97f2153bb015ade6efd05929999de85457.zip |
Make Lua taps work in out-of-source-tree builds.
make-taps.pl needs to know where to find the source files otherwise none of
the tap data gets built correctly.
This makes the wslua test suite run in out-of-source-tree builds too.
Change-Id: I059474d90d59e87bd57dba18530a66a927a014cf
Reviewed-on: https://code.wireshark.org/review/3337
Reviewed-by: Evan Huus <eapache@gmail.com>
-rw-r--r-- | epan/wslua/CMakeLists.txt | 1 | ||||
-rw-r--r-- | epan/wslua/Makefile.am | 8 | ||||
-rwxr-xr-x | epan/wslua/make-taps.pl | 16 |
3 files changed, 14 insertions, 11 deletions
diff --git a/epan/wslua/CMakeLists.txt b/epan/wslua/CMakeLists.txt index 6bb30756d7..c374f2c99a 100644 --- a/epan/wslua/CMakeLists.txt +++ b/epan/wslua/CMakeLists.txt @@ -71,6 +71,7 @@ ADD_CUSTOM_COMMAND( ${CMAKE_CURRENT_SOURCE_DIR}/wslua/taps ${CMAKE_CURRENT_BINARY_DIR}/taps_wslua.c ${CMAKE_CURRENT_BINARY_DIR}/taps.txt + ${CMAKE_CURRENT_SOURCE_DIR}/wslua WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/wslua DEPENDS diff --git a/epan/wslua/Makefile.am b/epan/wslua/Makefile.am index 85203ced2d..e57f280078 100644 --- a/epan/wslua/Makefile.am +++ b/epan/wslua/Makefile.am @@ -3,17 +3,17 @@ # Wireshark - Network traffic analyzer # By Gerald Combs <gerald@wireshark.org> # Copyright 1998 Gerald Combs -# +# # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -108,7 +108,7 @@ taps: $(taps_used) touch taps taps_wslua.c: make-taps.pl taps - $(PERL) $(srcdir)/make-taps.pl taps taps_wslua.c taps.txt + $(PERL) $(srcdir)/make-taps.pl $(srcdir)/taps taps_wslua.c taps.txt $(srcdir) taps.txt: taps_wslua.c diff --git a/epan/wslua/make-taps.pl b/epan/wslua/make-taps.pl index 0c7327fdcb..bd709aa006 100755 --- a/epan/wslua/make-taps.pl +++ b/epan/wslua/make-taps.pl @@ -73,19 +73,19 @@ my %enums = (); sub dotap { my ($tname,$fname,$sname,@enums) = @_; my $buf = ''; - + open FILE, "< $fname"; while(<FILE>) { $buf .= $_; } close FILE; - + $buf =~ s@/\*.*?\*/@@; for my $ename (@enums) { $enums{$ename} = []; my $a = $enums{$ename}; - + my $enumre = "typedef\\s+enum[^{]*{([^}]*)}[\\s\\n]*" . ${ename} . "[\\s\\n]*;"; if ($buf =~ s/$enumre//ms ) { $types{$ename} = "/*$ename*/ lua_pushnumber(L,(lua_Number)v->%s);"; @@ -127,13 +127,13 @@ sub dotap { for my $n (sort keys %elems) { my $fmt = $types{$elems{$n}}; - + if ($fmt) { $code .= "\tlua_pushstring(L,\"$n\"); "; $code .= sprintf($fmt,$n,$n) . " lua_settable(L,-3);\n"; $doc .= "\t$n: $comments{$elems{$n}}\n"; } - + } $code .= "}\n\n"; @@ -148,6 +148,7 @@ sub dotap { open TAPSFILE, "< $ARGV[0]"; open CFILE, "> $ARGV[1]"; open DOCFILE, "> $ARGV[2]"; +my $srcdir=$ARGV[3] . "/"; print CFILE <<"HEADER"; /* This file is autogenerated from ./taps by ./make-taps.pl */ @@ -165,6 +166,7 @@ while (<TAPSFILE>) { s@#.*@@; next if /^\s*$/; my ($tname,$fname,$sname,@enums) = split /\s+/; + $fname=$srcdir . "/" . $fname; my ($c,$doc) = dotap($tname,$fname,$sname,@enums); print CFILE "#include \"$fname\"\n"; print CFILE $c; @@ -180,7 +182,7 @@ TBLHDR {"$tname", $functs{$tname} }, TBLELEM } - + print CFILE <<"TBLFTR"; {"frame",NULL}, {NULL,NULL} @@ -211,7 +213,7 @@ tap_extractor_t wslua_get_tap_extractor(const gchar* name) { for(t = tappables; t->name; t++ ) { if (g_str_equal(t->name,name)) return t->extractor; } - + return NULL; } |