Ethereal-dev: [Ethereal-dev] Patches for libethereal and for linking plugins with libethereal

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Lars Roland <lars.roland@xxxxxxx>
Date: Mon, 05 Jul 2004 18:31:48 +0200
Hello all,

following patches are attached:

libethereal.def.diff:
Fix for build of ethereal with libethereal.dll. Current CVS version cannot be linked.

plugins.diff + config.h.win32.diff:
Link plugins unconditionally with libethereal import library if possible. The old plugin api table will be used if libethereal.dll isn't built. These patches are mainly the patches recently sent by Tomas Kukosa. I added just a few things to make a clean build work.

Readme.plugins.diff:
Update docu

Please check in.

Best Regards,
Lars Roland



Index: config.h.win32
===================================================================
RCS file: /cvsroot/ethereal/config.h.win32,v
retrieving revision 1.47
diff -u -r1.47 config.h.win32
--- config.h.win32	20 Jun 2004 09:31:48 -0000	1.47
+++ config.h.win32	5 Jul 2004 15:16:20 -0000
@@ -30,8 +30,12 @@
 /* Define if lex declares yytext as a char * by default, not a char[].  */
 #define YYTEXT_POINTER 1
 
+@HAVE_LIBETHEREALDLL@
+
 #define HAVE_PLUGINS		1
-#define PLUGINS_NEED_ADDRESS_TABLE 1
+#ifndef HAVE_LIBETHEREALDLL
+#  define PLUGINS_NEED_ADDRESS_TABLE 1
+#endif
 
 /* #undef HAVE_SA_LEN */
 
@@ -44,7 +48,6 @@
 @HAVE_LIBPCAP@
 @HAVE_PCAP_FINDALLDEVS@
 @WPCAP_CONSTIFIED@
-@HAVE_LIBETHEREALDLL@
 
 /* define macro for importing variables from an dll 
  * it depends on HAVE_LIBETHEREAL and _NEED_VAR_IMPORT_
Index: epan/libethereal.def
===================================================================
RCS file: /cvsroot/ethereal/epan/libethereal.def,v
retrieving revision 1.7
diff -u -r1.7 libethereal.def
--- epan/libethereal.def	30 Jun 2004 08:21:57 -0000	1.7
+++ epan/libethereal.def	5 Jul 2004 15:16:21 -0000
@@ -214,10 +214,10 @@
 ftype_can_ne
 ftype_can_slice
 ftype_pretty_name
-fvalue_free_list                DATA
 fvalue_from_unparsed
 fvalue_get
 fvalue_get_integer
+fvalue_t_free_list              DATA
 GatekeeperRejectReason_vals     DATA
 get_args_as_string
 get_basename
@@ -436,7 +436,6 @@
 rpc_init_prog
 rpc_procs                       DATA
 rpc_proc_name
-rpc_prog_hf
 rpc_progs                       DATA
 rpc_prog_hf
 rpc_prog_name
Index: plugins/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/Makefile.nmake,v
retrieving revision 1.34
diff -u -r1.34 Makefile.nmake
--- plugins/Makefile.nmake	30 Mar 2004 18:45:04 -0000	1.34
+++ plugins/Makefile.nmake	5 Jul 2004 15:16:22 -0000
@@ -9,7 +9,11 @@
 CFLAGS=/DHAVE_CONFIG_H /I.. /I../wiretap /I. $(GLIB_CFLAGS) \
 	/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
 
+!IFDEF ENABLE_LIBETHEREAL
+OBJECTS=
+!ELSE
 OBJECTS=plugin_api.obj 
+!ENDIF
 
 all: $(OBJECTS) acn artnet asn1 ciscosm docsis enttec giop gryphon irda lwres megaco mgcp pcli rdm rlm rtnet rudp v5ua
 
Index: plugins/acn/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/acn/Makefile.nmake,v
retrieving revision 1.2
diff -u -r1.2 Makefile.nmake
--- plugins/acn/Makefile.nmake	6 Nov 2003 09:05:10 -0000	1.2
+++ plugins/acn/Makefile.nmake	5 Jul 2004 15:16:23 -0000
@@ -9,10 +9,16 @@
 CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
 	/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
 
-OBJECTS=packet-acn.obj 
+OBJECTS=packet-acn.obj
 
-acn.dll acn.exp acn.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:acn.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+acn.dll acn.exp acn.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:acn.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/artnet/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/artnet/Makefile.nmake,v
retrieving revision 1.5
diff -u -r1.5 Makefile.nmake
--- plugins/artnet/Makefile.nmake	6 Nov 2003 09:05:10 -0000	1.5
+++ plugins/artnet/Makefile.nmake	5 Jul 2004 15:16:23 -0000
@@ -9,10 +9,16 @@
 CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
 	/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
 
-OBJECTS=packet-artnet.obj 
+OBJECTS=packet-artnet.obj
 
-artnet.dll artnet.exp artnet.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:artnet.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+artnet.dll artnet.exp artnet.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:artnet.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/asn1/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/asn1/Makefile.nmake,v
retrieving revision 1.6
diff -u -r1.6 Makefile.nmake
--- plugins/asn1/Makefile.nmake	18 Feb 2004 20:45:53 -0000	1.6
+++ plugins/asn1/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -15,10 +15,16 @@
 CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GTK1_CFLAGS) \
 	/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
 
-OBJECTS=packet-asn1.obj 
+OBJECTS=packet-asn1.obj
 
-asn1.dll asn1.exp asn1.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:asn1.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+asn1.dll asn1.exp asn1.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:asn1.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 !IFDEF GTK1_DIR
 	$(GTK1_LIBS)
 !ELSE
Index: plugins/ciscosm/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/ciscosm/Makefile.nmake,v
retrieving revision 1.1
diff -u -r1.1 Makefile.nmake
--- plugins/ciscosm/Makefile.nmake	25 Mar 2004 11:21:06 -0000	1.1
+++ plugins/ciscosm/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-sm.obj 
 
-ciscosm.dll ciscosm.exp ciscosm.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:ciscosm.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+ciscosm.dll ciscosm.exp ciscosm.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:ciscosm.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/docsis/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/docsis/Makefile.nmake,v
retrieving revision 1.8
diff -u -r1.8 Makefile.nmake
--- plugins/docsis/Makefile.nmake	17 Mar 2004 06:55:02 -0000	1.8
+++ plugins/docsis/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -9,6 +9,11 @@
 CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
 	/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
 
+CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
+
+.c.obj::
+	$(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
+
 OBJECTS=packet-intrngreq.obj packet-type29ucd.obj \
 	packet-docsis.obj packet-bpkmattr.obj \
 	packet-dsarsp.obj packet-macmgmt.obj \
@@ -23,8 +28,14 @@
 	packet-dsareq.obj packet-dsdrsp.obj \
 	packet-rngreq.obj packet-vendor.obj
 
-docsis.dll docsis.exp docsis.lib : $(OBJECTS) ..\plugin_api.obj 
-	link -dll /out:docsis.dll $(OBJECTS) ..\plugin_api.obj  \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+docsis.dll docsis.exp docsis.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:docsis.dll $(OBJECTS) $(LINK_PLUGIN_WITH)  \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/enttec/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/enttec/Makefile.nmake,v
retrieving revision 1.1
diff -u -r1.1 Makefile.nmake
--- plugins/enttec/Makefile.nmake	17 Nov 2003 20:57:13 -0000	1.1
+++ plugins/enttec/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-enttec.obj 
 
-enttec.dll enttec.exp enttec.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:enttec.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+enttec.dll enttec.exp enttec.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:enttec.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/giop/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/giop/Makefile.nmake,v
retrieving revision 1.9
diff -u -r1.9 Makefile.nmake
--- plugins/giop/Makefile.nmake	10 Oct 2003 21:31:50 -0000	1.9
+++ plugins/giop/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -11,14 +11,20 @@
 
 OBJECTS=packet-cosnaming.obj  packet-coseventcomm.obj
 
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
 all : cosnaming.dll coseventcomm.dll
 
-cosnaming.dll cosnaming.exp cosnaming.lib : packet-cosnaming.obj ..\plugin_api.obj
-	link -dll /out:cosnaming.dll packet-cosnaming.obj ..\plugin_api.obj \
+cosnaming.dll cosnaming.exp cosnaming.lib : packet-cosnaming.obj $(LINK_PLUGIN_WITH)
+	link -dll /out:cosnaming.dll packet-cosnaming.obj $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
-coseventcomm.dll coseventcomm.exp coseventcomm.lib : packet-coseventcomm.obj ..\plugin_api.obj
-	link -dll /out:coseventcomm.dll packet-coseventcomm.obj ..\plugin_api.obj \
+coseventcomm.dll coseventcomm.exp coseventcomm.lib : packet-coseventcomm.obj $(LINK_PLUGIN_WITH)
+	link -dll /out:coseventcomm.dll packet-coseventcomm.obj $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/gryphon/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/gryphon/Makefile.nmake,v
retrieving revision 1.13
diff -u -r1.13 Makefile.nmake
--- plugins/gryphon/Makefile.nmake	6 Nov 2003 09:05:12 -0000	1.13
+++ plugins/gryphon/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-gryphon.obj 
 
-gryphon.dll gryphon.exp gryphon.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:gryphon.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+gryphon.dll gryphon.exp gryphon.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:gryphon.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/irda/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/irda/Makefile.nmake,v
retrieving revision 1.2
diff -u -r1.2 Makefile.nmake
--- plugins/irda/Makefile.nmake	30 Jun 2004 07:34:52 -0000	1.2
+++ plugins/irda/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-irda.obj packet-ircomm.obj packet-sir.obj
 
-irda.dll irda.exp irda.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:irda.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+irda.dll irda.exp irda.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:irda.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/lwres/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/lwres/Makefile.nmake,v
retrieving revision 1.4
diff -u -r1.4 Makefile.nmake
--- plugins/lwres/Makefile.nmake	6 Nov 2003 09:05:12 -0000	1.4
+++ plugins/lwres/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-lwres.obj 
 
-lwres.dll lwres.exp lwres.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:lwres.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+lwres.dll lwres.exp lwres.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:lwres.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/megaco/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/megaco/Makefile.nmake,v
retrieving revision 1.5
diff -u -r1.5 Makefile.nmake
--- plugins/megaco/Makefile.nmake	6 Nov 2003 09:05:13 -0000	1.5
+++ plugins/megaco/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-megaco.obj 
 
-megaco.dll megaco.exp megaco.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:megaco.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+megaco.dll megaco.exp megaco.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:megaco.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/mgcp/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/mgcp/Makefile.nmake,v
retrieving revision 1.10
diff -u -r1.10 Makefile.nmake
--- plugins/mgcp/Makefile.nmake	9 May 2004 10:03:41 -0000	1.10
+++ plugins/mgcp/Makefile.nmake	5 Jul 2004 15:16:24 -0000
@@ -4,23 +4,14 @@
 
 include ..\..\config.nmake
 
-# If you want this plugin to use libethereal.lib instead 
-# of the standard plugin api, you have to comment out the next line
-#USE_LIBETHEREAL_LIB=YES
-
 ############### no need to modify below this line #########
 
 CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
 	/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
 
 !IFDEF ENABLE_LIBETHEREAL
-!IFDEF USE_LIBETHEREAL_LIB
 LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
-CFLAGS=/DHAVE_WIN32_LIBETHEREAL_LIB $(CFLAGS)
-!ENDIF
-!ENDIF
-
-!IFNDEF LINK_PLUGIN_WITH
+!ELSE
 LINK_PLUGIN_WITH=..\plugin_api.obj
 !ENDIF
 
Index: plugins/mgcp/packet-mgcp.c
===================================================================
RCS file: /cvsroot/ethereal/plugins/mgcp/packet-mgcp.c,v
retrieving revision 1.47
diff -u -r1.47 packet-mgcp.c
--- plugins/mgcp/packet-mgcp.c	31 May 2004 19:31:14 -0000	1.47
+++ plugins/mgcp/packet-mgcp.c	5 Jul 2004 15:16:25 -0000
@@ -36,9 +36,7 @@
 #include "config.h"
 #endif
 
-#ifndef HAVE_WIN32_LIBETHEREAL_LIB
 #include "plugins/plugin_api.h"
-#endif
 
 #include "moduleinfo.h"
 
@@ -56,9 +54,7 @@
 #include "packet-mgcp.h"
 #include "../../tap.h"
 
-#ifndef HAVE_WIN32_LIBETHEREAL_LIB
 #include "plugins/plugin_api_defs.h"
-#endif
 
 #ifndef ENABLE_STATIC
 G_MODULE_EXPORT const gchar version[] = VERSION;
@@ -1725,8 +1721,6 @@
   proto_reg_handoff_mgcp();
 }
 
-#ifndef HAVE_WIN32_LIBETHEREAL_LIB
-
 G_MODULE_EXPORT void
 plugin_init(plugin_address_table_t *pat
 #ifndef PLUGINS_NEED_ADDRESS_TABLE
@@ -1736,10 +1730,6 @@
   /* initialise the table of pointers needed in Win32 DLLs */
   plugin_address_table_init(pat);
   
-#else /* HAVE_WIN32_LIBETHEREAL_LIB */
-G_MODULE_EXPORT void plugin_init(void *dummy _U_)
-{
-#endif
   /* register the new protocol, protocol fields, and subtrees */
   if (proto_mgcp == -1) { /* execute protocol initialization only once */
     proto_register_mgcp();
Index: plugins/pcli/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/pcli/Makefile.nmake,v
retrieving revision 1.5
diff -u -r1.5 Makefile.nmake
--- plugins/pcli/Makefile.nmake	6 Nov 2003 09:05:14 -0000	1.5
+++ plugins/pcli/Makefile.nmake	5 Jul 2004 15:16:25 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-pcli.obj 
 
-pcli.dll pcli.exp pcli.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:pcli.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+pcli.dll pcli.exp pcli.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:pcli.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/rdm/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/rdm/Makefile.nmake,v
retrieving revision 1.2
diff -u -r1.2 Makefile.nmake
--- plugins/rdm/Makefile.nmake	18 Nov 2003 19:18:45 -0000	1.2
+++ plugins/rdm/Makefile.nmake	5 Jul 2004 15:16:25 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-rdm.obj 
 
-rdm.dll rdm.exp rdm.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:rdm.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+rdm.dll rdm.exp rdm.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:rdm.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/rlm/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/rlm/Makefile.nmake,v
retrieving revision 1.1
diff -u -r1.1 Makefile.nmake
--- plugins/rlm/Makefile.nmake	25 Mar 2004 11:21:07 -0000	1.1
+++ plugins/rlm/Makefile.nmake	5 Jul 2004 15:16:25 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-rlm.obj 
 
-rlm.dll rlm.exp rlm.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:rlm.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+rlm.dll rlm.exp rlm.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:rlm.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/rtnet/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/rtnet/Makefile.nmake,v
retrieving revision 1.6
diff -u -r1.6 Makefile.nmake
--- plugins/rtnet/Makefile.nmake	6 Nov 2003 09:05:14 -0000	1.6
+++ plugins/rtnet/Makefile.nmake	5 Jul 2004 15:16:25 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-rtnet.obj 
 
-rtnet.dll rtnet.exp rtnet.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:rtnet.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+rtnet.dll rtnet.exp rtnet.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:rtnet.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/rudp/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/rudp/Makefile.nmake,v
retrieving revision 1.1
diff -u -r1.1 Makefile.nmake
--- plugins/rudp/Makefile.nmake	25 Mar 2004 11:21:07 -0000	1.1
+++ plugins/rudp/Makefile.nmake	5 Jul 2004 15:16:25 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-rudp.obj 
 
-rudp.dll rudp.exp rudp.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:rudp.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+rudp.dll rudp.exp rudp.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:rudp.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: plugins/v5ua/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/plugins/v5ua/Makefile.nmake,v
retrieving revision 1.2
diff -u -r1.2 Makefile.nmake
--- plugins/v5ua/Makefile.nmake	17 Dec 2003 07:02:12 -0000	1.2
+++ plugins/v5ua/Makefile.nmake	5 Jul 2004 15:16:25 -0000
@@ -11,8 +11,14 @@
 
 OBJECTS=packet-v5ua.obj 
 
-v5ua.dll v5ua.exp v5ua.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:v5ua.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+v5ua.dll v5ua.exp v5ua.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:v5ua.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean:
Index: doc/README.plugins
===================================================================
RCS file: /cvsroot/ethereal/doc/README.plugins,v
retrieving revision 1.13
diff -u -r1.13 README.plugins
--- doc/README.plugins	3 Jul 2004 21:50:05 -0000	1.13
+++ doc/README.plugins	5 Jul 2004 15:16:21 -0000
@@ -150,8 +150,14 @@
 
 OBJECTS=packet-xxx.obj 
 
-xxx.dll xxx.exp xxx.lib : $(OBJECTS) ..\plugin_api.obj
-	link -dll /out:xxx.dll $(OBJECTS) ..\plugin_api.obj \
+!IFDEF ENABLE_LIBETHEREAL
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+!ELSE
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
+xxx.dll xxx.exp xxx.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+	link -dll /out:xxx.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
 	$(GLIB_LIBS)
 
 clean: