Revert "Make Lua taps work in out-of-source-tree builds."
authorEvan Huus <eapache@gmail.com>
Sat, 2 Aug 2014 02:11:29 +0000 (02:11 +0000)
committerEvan Huus <eapache@gmail.com>
Sat, 2 Aug 2014 02:14:17 +0000 (02:14 +0000)
Breaks on windows...

This reverts commit 6b11cd97f2153bb015ade6efd05929999de85457.

Change-Id: I1caf5500da993d7988e09fc0758950469f8252cf
Reviewed-on: https://code.wireshark.org/review/3346
Reviewed-by: Evan Huus <eapache@gmail.com>
epan/wslua/CMakeLists.txt
epan/wslua/Makefile.am
epan/wslua/make-taps.pl

index c374f2c99aa92bf499f165787d9ee4742fc80e24..6bb30756d731e805582f84ac785eac7e86cae119 100644 (file)
@@ -71,7 +71,6 @@ 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
index e57f280078e557861393cc355417bd214bb88970..85203ced2d5cbce6ed5626b1dac82741f70f37ed 100644 (file)
@@ -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 $(srcdir)/taps taps_wslua.c taps.txt $(srcdir)
+       $(PERL) $(srcdir)/make-taps.pl taps taps_wslua.c taps.txt
 
 taps.txt: taps_wslua.c
 
index bd709aa0064939ac8bcb7e0c4e85fabe5b8e78ae..0c7327fdcb7b58dae45e32beea816d7c16a95c50 100755 (executable)
@@ -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,7 +148,6 @@ 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 */
@@ -166,7 +165,6 @@ 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;
@@ -182,7 +180,7 @@ TBLHDR
        {"$tname", $functs{$tname} },
 TBLELEM
        }
-
+       
 print CFILE  <<"TBLFTR";
        {"frame",NULL},
        {NULL,NULL}
@@ -213,7 +211,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;
 }