Update plugin to the current plugin design.
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 18 Dec 2006 16:24:42 +0000 (16:24 +0000)
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 18 Dec 2006 16:24:42 +0000 (16:24 +0000)
Add Windows version info resource.

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

plugins/stats_tree/Makefile.am
plugins/stats_tree/Makefile.common [new file with mode: 0644]
plugins/stats_tree/Makefile.nmake
plugins/stats_tree/moduleinfo.nmake [new file with mode: 0644]
plugins/stats_tree/plugin.rc.in [new file with mode: 0644]

index 13d98b05a227e130f107658eea12046cea045861..ee663f4600bd33508b8be91098c2331dc60ac5a0 100644 (file)
@@ -1,5 +1,5 @@
 # Makefile.am
-# Automake file for stats_tree Ethereal plugin
+# Automake file for stats_tree Wireshark plugin
 #
 # $Id$
 #
 
 INCLUDES = -I$(top_srcdir)
 
+include Makefile.common
+
 plugindir = @plugindir@
 
 plugin_LTLIBRARIES = stats_tree.la
-stats_tree_la_SOURCES = stats_tree_plugin.c pinfo_stats_tree.c pinfo_stats_tree.h
+stats_tree_la_SOURCES = $(TAP_SRC) $(TAP_INCLUDES)
 stats_tree_la_LDFLAGS = -module -avoid-version
 stats_tree_la_LIBADD = @PLUGIN_LIBS@
 
@@ -45,4 +47,7 @@ MAINTAINERCLEANFILES = \
        plugin.c
 
 EXTRA_DIST = \
-       Makefile.nmake
+       Makefile.common \
+       Makefile.nmake  \
+       moduleinfo.nmake        \
+       plugin.rc.in
diff --git a/plugins/stats_tree/Makefile.common b/plugins/stats_tree/Makefile.common
new file mode 100644 (file)
index 0000000..dd6843f
--- /dev/null
@@ -0,0 +1,36 @@
+# Makefile.common for stats tree plugin
+#     Contains the stuff from Makefile.am and Makefile.nmake that is
+#     a) common to both files and
+#     b) portable between both files
+#
+# $Id: Makefile.common 18197 2006-05-21 05:12:17Z sahlberg $
+#
+# 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+# the name of the plugin
+PLUGIN_NAME = stats_tree
+
+# the tap sources 
+TAP_SRC = \
+       stats_tree_plugin.c     \
+       pinfo_stats_tree.c
+
+TAP_INCLUDES = \
+       pinfo_stats_tree.h
+
index bfc578e4a0d8a6f8106545427c5c236b5d07a53f..d608f4745790fbdb9465432a4c986fd214e73f65 100644 (file)
@@ -3,9 +3,9 @@
 #
 
 include ..\..\config.nmake
-include <win32.mak>
+include moduleinfo.nmake
 
-############### no need to modify below this line #########
+include Makefile.common
 
 CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
        /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
@@ -19,16 +19,32 @@ LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
 LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
 CFLAGS=/DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
 
-OBJECTS=stats_tree_plugin.obj pinfo_stats_tree.obj
+TAP_OBJECTS = $(TAP_SRC:.c=.obj)
 
-stats_tree.dll stats_tree.exp stats_tree.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
-       link -dll /out:stats_tree.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
-       $(GLIB_LIBS)
+OBJECTS=$(TAP_OBJECTS)
+
+RESOURCE=$(PLUGIN_NAME).res
+
+all: $(PLUGIN_NAME).dll
+
+$(PLUGIN_NAME).rc : moduleinfo.nmake
+       sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \
+       -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \
+       -e s/@RC_VERSION@/$(RC_VERSION)/ \
+       -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \
+       -e s/@PACKAGE@/$(PACKAGE)/ \
+       -e s/@VERSION@/$(VERSION)/ \
+       < plugin.rc.in > $@
+
+$(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE)
+       link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
+       $(GLIB_LIBS) $(RESOURCE)
 
 !ENDIF
 
 clean:
-       rm -f $(OBJECTS) stats_tree.dll stats_tree.exp stats_tree.lib *.pdb
+       rm -f $(OBJECTS) $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp \
+           $(RESOURCE) $(PLUGIN_NAME).rc $(PLUGIN_NAME).lib *.pdb
 
 distclean: clean
 
diff --git a/plugins/stats_tree/moduleinfo.nmake b/plugins/stats_tree/moduleinfo.nmake
new file mode 100644 (file)
index 0000000..1fc53ad
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# $Id: moduleinfo.nmake 20036 2006-12-04 23:12:04Z jake $
+#
+
+# The name
+PACKAGE=stats_tree
+
+# The version
+MODULE_VERSION_MAJOR=0
+MODULE_VERSION_MINOR=0
+MODULE_VERSION_MICRO=1
+MODULE_VERSION_EXTRA=0
+
+#
+# The RC_VERSION should be comma-separated, not dot-separated, 
+# as per Graham Bloice's message in
+#
+#      http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html
+#
+# "The RC_VERSION variable in config.nmake should be comma separated. 
+# This allows the resources to be built correctly and the version
+# number to be correctly displayed in the explorer properties dialog
+# for the executables, and XP's tooltip, rather than 0.0.0.0."
+#
+
+MODULE_VERSION=$(MODULE_VERSION_MAJOR).$(MODULE_VERSION_MINOR).$(MODULE_VERSION_MICRO).$(MODULE_VERSION_EXTRA)
+RC_MODULE_VERSION=$(MODULE_VERSION_MAJOR),$(MODULE_VERSION_MINOR),$(MODULE_VERSION_MICRO),$(MODULE_VERSION_EXTRA)
+
diff --git a/plugins/stats_tree/plugin.rc.in b/plugins/stats_tree/plugin.rc.in
new file mode 100644 (file)
index 0000000..e394a4f
--- /dev/null
@@ -0,0 +1,33 @@
+#include "winver.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @RC_MODULE_VERSION@
+ PRODUCTVERSION @RC_VERSION@,0
+ FILEFLAGSMASK 0x0L
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_PRERELEASE+VS_FF_SPECIALBUILD+VS_FF_DEBUG
+#else
+ FILEFLAGS VS_FF_PRERELEASE+VS_FF_SPECIALBUILD
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName", "The Wireshark developer community, http://www.wireshark.org/\0"
+            VALUE "FileDescription", "@PACKAGE@ dissector\0"
+            VALUE "FileVersion", "@MODULE_VERSION@\0"
+            VALUE "InternalName", "@PACKAGE@ @MODULE_VERSION@\0"
+            VALUE "LegalCopyright", "Copyright © 1998 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
+            VALUE "OriginalFilename", "@PLUGIN_NAME@.dll\0"
+            VALUE "ProductName", "Wireshark\0"
+            VALUE "ProductVersion", "@VERSION@\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END