Ethereal-dev: [Ethereal-dev] Updated libprot patch

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

From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Sat, 13 Jul 2002 13:26:41 +0200
I've attached an updated version of the libproto patch (merging
conflicts with the docsis stuff). I'd be happy if someone could apply
it or let me know what should be improved. As an alternative, if I
could get cvs write access, I could do it myself.

 Ciao
    Jörg

--
Joerg Mayer                                          <jmayer@xxxxxxxxx>
I found out that "pro" means "instead of" (as in proconsul). Now I know
what proactive means.
Changelog: <jmayer@xxxxxxxxx>
	- Change the Makefile handling of static vs dynamic plugins
	  (obsoleting register.c vs register-static.c).
	- Create a libproto.a

Index: ethereal/Makefile.am
===================================================================
RCS file: /cvsroot/ethereal/Makefile.am,v
retrieving revision 1.447
diff -u -r1.447 Makefile.am
--- Makefile.am	2002/07/12 22:52:33	1.447
+++ Makefile.am	2002/07/13 11:10:05
@@ -65,7 +65,7 @@
 man1_MANS = @ethereal_man@ @editcap_man@ @mergecap_man@ @tethereal_man@ @text2pcap_man@ @idl2eth_man@
 man_MANS = 
 
-EXTRA_PROGRAMS = ethereal ethereal_static tethereal tethereal_static editcap mergecap dftest text2pcap
+EXTRA_PROGRAMS = ethereal tethereal editcap mergecap dftest text2pcap
 EXTRA_SCRIPTS = idl2eth
 
 #
@@ -334,38 +334,54 @@
 	packet-ypxfr.c \
 	packet-zebra.c
 
-if HAVE_PLUGINS
-plugin_src = \
-	plugins/docsis/packet-bpkmattr.c \
-	plugins/docsis/packet-bpkmreq.c \
-	plugins/docsis/packet-bpkmrsp.c \
-	plugins/docsis/packet-docsis.c \
-	plugins/docsis/packet-dsaack.c \
-	plugins/docsis/packet-dsareq.c \
-	plugins/docsis/packet-dsarsp.c \
-	plugins/docsis/packet-dscack.c \
-	plugins/docsis/packet-dscreq.c \
-	plugins/docsis/packet-dscrsp.c \
-	plugins/docsis/packet-dsdreq.c \
-	plugins/docsis/packet-dsdrsp.c \
-	plugins/docsis/packet-macmgmt.c \
-	plugins/docsis/packet-map.c \
-	plugins/docsis/packet-regack.c \
-	plugins/docsis/packet-regreq.c \
-	plugins/docsis/packet-regrsp.c \
-	plugins/docsis/packet-rngreq.c \
-	plugins/docsis/packet-rngrsp.c \
-	plugins/docsis/packet-tlv.c \
-	plugins/docsis/packet-uccreq.c \
-	plugins/docsis/packet-uccrsp.c \
-	plugins/docsis/packet-ucd.c \
-	plugins/giop/packet-cosnaming.c \
-	plugins/giop/packet-coseventcomm.c \
-	plugins/gryphon/packet-gryphon.c \
-	plugins/mgcp/packet-mgcp.c
+DISSECTOR_COMMON_SRC = \
+	aftypes.h      \
+	alignment.h    \
+	afn.c          \
+	afn.h          \
+	asn1.c         \
+	asn1.h         \
+	bridged_pids.h \
+	etypes.h       \
+	follow.c       \
+	follow.h       \
+	format-oid.h   \
+	greproto.h     \
+	in_cksum.c     \
+	in_cksum.h     \
+	ipproto.c      \
+	ipproto.h      \
+	llcsaps.h      \
+	nlpid.h        \
+	oui.h          \
+	ppptypes.h     \
+	ptvcursor.c	\
+	ptvcursor.h	\
+	reassemble.c   \
+	reassemble.h   \
+	register.h     \
+	rpc_defrag.h   \
+	smb.h          \
+	util.c         \
+	util.h         \
+	x11-declarations.h \
+	x11-register-info.h \
+	x264_prt_id.h  \
+	xdlc.c         \
+	xdlc.h         \
+	xmlstub.c      \
+	xmlstub.h
 
+if HAVE_PLUGINS
+plugin_libs = \
+	plugins/docsis/docsis.la \
+	plugins/giop/cosnaming.la \
+	plugins/giop/coseventcomm.la \
+	plugins/gryphon/gryphon.la \
+	plugins/mgcp/mgcp.la
 
-plugin_static_ldadd = \
+if ENABLE_STATIC
+plugin_ldadd = \
 	plugins/docsis/packet-bpkmattr-static.o \
 	plugins/docsis/packet-bpkmreq-static.o \
 	plugins/docsis/packet-bpkmrsp-static.o \
@@ -393,13 +409,36 @@
 	plugins/gryphon/packet-gryphon-static.o \
 	plugins/mgcp/packet-mgcp-static.o
 
-plugin_libs = \
-	plugins/docsis/docsis.la \
-	plugins/giop/cosnaming.la \
-	plugins/giop/coseventcomm.la \
-	plugins/gryphon/gryphon.la \
-	plugins/mgcp/mgcp.la
+plugin_src = \
+	plugins/docsis/packet-bpkmattr.c \
+	plugins/docsis/packet-bpkmreq.c \
+	plugins/docsis/packet-bpkmrsp.c \
+	plugins/docsis/packet-docsis.c \
+	plugins/docsis/packet-dsaack.c \
+	plugins/docsis/packet-dsareq.c \
+	plugins/docsis/packet-dsarsp.c \
+	plugins/docsis/packet-dscack.c \
+	plugins/docsis/packet-dscreq.c \
+	plugins/docsis/packet-dscrsp.c \
+	plugins/docsis/packet-dsdreq.c \
+	plugins/docsis/packet-dsdrsp.c \
+	plugins/docsis/packet-macmgmt.c \
+	plugins/docsis/packet-map.c \
+	plugins/docsis/packet-regack.c \
+	plugins/docsis/packet-regreq.c \
+	plugins/docsis/packet-regrsp.c \
+	plugins/docsis/packet-rngreq.c \
+	plugins/docsis/packet-rngrsp.c \
+	plugins/docsis/packet-tlv.c \
+	plugins/docsis/packet-uccreq.c \
+	plugins/docsis/packet-uccrsp.c \
+	plugins/docsis/packet-ucd.c \
+	plugins/giop/packet-cosnaming.c \
+	plugins/giop/packet-coseventcomm.c \
+	plugins/gryphon/packet-gryphon.c \
+	plugins/mgcp/packet-mgcp.c
 
+else
 plugin_ldadd = \
 	"-dlopen" self	\
 	"-dlopen" plugins/docsis/docsis.la \
@@ -407,11 +446,14 @@
 	"-dlopen" plugins/giop/coseventcomm.la \
 	"-dlopen" plugins/gryphon/gryphon.la \
 	"-dlopen" plugins/mgcp/mgcp.la
-else
+
 plugin_src =
 
-plugin_static_ldadd =
+endif
 
+else
+plugin_src =
+
 plugin_libs =
 
 plugin_ldadd =
@@ -535,13 +577,6 @@
 	packet-ypxfr.h 
 
 ETHEREAL_COMMON_SRC = \
-	aftypes.h      \
-	alignment.h    \
-	afn.c          \
-	afn.h          \
-	asn1.c         \
-	asn1.h         \
-	bridged_pids.h \
 	column.c       \
 	column.h       \
 	color.h        \
@@ -549,21 +584,8 @@
 	conditions.h   \
 	capture_stop_conditions.h   \
 	capture_stop_conditions.c   \
-	etypes.h       \
-	follow.c       \
-	follow.h       \
-	format-oid.h   \
-	greproto.h     \
-	in_cksum.c     \
-	in_cksum.h     \
-	ipproto.c      \
-	ipproto.h      \
-	llcsaps.h      \
-	nlpid.h        \
-	oui.h          \
 	pcap-util.c    \
 	pcap-util.h    \
-	ppptypes.h     \
 	prefs.c        \
 	prefs.h        \
 	prefs-int.h    \
@@ -571,33 +593,15 @@
 	print.h        \
 	ps.c           \
 	ps.h           \
-	ptvcursor.c	\
-	ptvcursor.h	\
-	reassemble.c   \
-	reassemble.h   \
-	register.h     \
 	ringbuffer.c   \
-	ringbuffer.h   \
-	rpc_defrag.h   \
-	smb.h          \
-	util.c         \
-	util.h         \
-	x11-declarations.h \
-	x11-register-info.h \
-	x264_prt_id.h  \
-	xdlc.c         \
-	xdlc.h         \
-	xmlstub.c      \
-	xmlstub.h
+	ringbuffer.h
 
 BUILT_SOURCES = \
 	x11-declarations.h \
 	x11-register-info.h
 
 ethereal_SOURCES = \
-	$(DISSECTOR_SRC) \
 	$(ETHEREAL_COMMON_SRC) \
-	register.c     \
 	capture.c      \
 	capture.h      \
 	file.c         \
@@ -615,27 +619,6 @@
 	summary.h      \
 	ui_util.h
 
-ethereal_static_SOURCES = \
-	$(DISSECTOR_SRC) \
-	$(ETHEREAL_COMMON_SRC) \
-	register-static.c     \
-	capture.c      \
-	capture.h      \
-	file.c         \
-	file.h         \
-	filters.c      \
-	filters.h      \
-	globals.h      \
-	menu.h         \
-	progress_dlg.h \
-	proto_hier_stats.h	\
-	proto_hier_stats.c	\
-	simple_dialog.h \
-	statusbar.h    \
-	summary.c      \
-	summary.h      \
-	ui_util.h	
-
 EXTRA_ethereal_SOURCES = \
 	snprintf.c	\
 	snprintf.h	\
@@ -649,6 +632,13 @@
 	strptime.c	\
 	strptime.h
 
+noinst_LIBRARIES = libproto.a
+
+libproto_a_SOURCES = \
+        $(DISSECTOR_SRC) \
+        $(DISSECTOR_COMMON_SRC) \
+	register.c
+
 # Optional objects that I know how to build. These will be
 # linked into the ethereal executable.
 # They will also be linked into the tethereal executable; if this
@@ -663,6 +653,7 @@
 # Additional libs that I know how to build. These will be
 # linked into the ethereal executable.
 ethereal_additional_libs = \
+	libproto.a		\
 	wiretap/libwiretap.a	\
 	gtk/libui.a		\
 	epan/libethereal.a	\
@@ -675,10 +666,6 @@
 	$(ethereal_additional_libs)	\
 	$(plugin_libs)
 
-ethereal_static_DEPENDENCIES = \
-	$(ethereal_optional_objects)	\
-	$(ethereal_additional_libs)
-
 # This automake variable adds to the link-line for the executable.
 #
 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
@@ -686,6 +673,17 @@
 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
 # applications are X applications).
+
+if ENABLE_STATIC
+ethereal_LDFLAGS = -Wl,-static -all-static
+#ethereal_all_static = -all-static
+else
+ethereal_LDFLAGS = -export-dynamic
+#ethereal_all_static =
+endif
+
+#	$(ethereal_all_static)		\###
+
 ethereal_LDADD = \
 	$(ethereal_optional_objects)	\
 	$(ethereal_additional_libs)	\
@@ -693,32 +691,14 @@
 	$(plugin_ldadd)			\
 	@PCAP_LIBS@ @GTK_LIBS@
 
-ethereal_static_LDADD = \
-	"-all-static" 			\
-	$(plugin_static_ldadd)		\
-	$(ethereal_optional_objects)	\
-	$(ethereal_additional_libs)	\
-	@SNMP_LIBS@ @SSL_LIBS@		\
-	@PCAP_LIBS@ @GTK_LIBS@		
-
-ethereal_LDFLAGS = -export-dynamic
-ethereal_static_LDFLAGS = -Wl,-static
-
 tethereal_SOURCES = \
-	$(DISSECTOR_SRC) \
-	$(ETHEREAL_COMMON_SRC) \
-	register.c     \
-	tethereal.c
-
-tethereal_static_SOURCES = \
-	$(DISSECTOR_SRC) \
 	$(ETHEREAL_COMMON_SRC) \
-	register-static.c     \
 	tethereal.c
 
 # Additional libs that I know how to build. These will be
 # linked into the tethereal executable.
 tethereal_additional_libs =		\
+	libproto.a			\
 	wiretap/libwiretap.a		\
 	epan/libethereal.a		\
 	epan/ftypes/libftypes.a		\
@@ -730,31 +710,22 @@
 	$(tethereal_additional_libs)	\
 	$(plugin_libs)
 
-tethereal_static_DEPENDENCIES = \
-	$(ethereal_optional_objects)	\
-	$(tethereal_additional_libs)	
-
 # This automake variable adds to the link-line for the executable
+
 tethereal_LDADD = wiretap/libwiretap.a	\
+	$(ethereal_all_static)		\
 	$(ethereal_optional_objects)	\
 	$(tethereal_additional_libs)	\
 	@SNMP_LIBS@ @SSL_LIBS@		\
 	$(plugin_ldadd)			\
 	@GLIB_LIBS@ -lm \
 	@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
-
-tethereal_static_LDADD = \
-	"-all-static"		\
-	$(plugin_static_ldadd)	\
-	wiretap/libwiretap.a	\
-	$(ethereal_optional_objects)	\
-	$(tethereal_additional_libs)	\
-	@SNMP_LIBS@ @SSL_LIBS@		\
-	@GLIB_LIBS@ -lm \
-	@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
 
+if ENABLE_STATIC
+tethereal_LDFLAGS = -Wl,-static
+else
 tethereal_LDFLAGS = -export-dynamic
-tethereal_static_LDFLAGS = -Wl,-static
+endif
 
 # Optional objects that I know how to build, and that are needed by
 # text2pcap.
@@ -819,13 +790,9 @@
 # The first argument is the directory in which the source files live.
 # All subsequent arguments are the files to scan.
 #
-register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
+register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
 	@echo Making register.c
-	@$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
-
-register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
-	@echo Making register-static.c
-	@$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
+	@$(srcdir)/make-reg-dotc register.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
 
 ps.c: print.ps rdps
 	./rdps $(srcdir)/print.ps ps.c
@@ -841,12 +808,11 @@
 
 
 dftest_SOURCES = \
-	$(DISSECTOR_SRC) \
 	$(ETHEREAL_COMMON_SRC) \
-	register.c     \
 	dftest.c
 
 dftest_additional_libs =		\
+	libproto.a			\
 	wiretap/libwiretap.a		\
 	epan/libethereal.a		\
 	epan/ftypes/libftypes.a		\
@@ -869,11 +835,11 @@
 dftest_LDFLAGS = -export-dynamic
 
 CLEANFILES =	\
-	idl2eth
+	idl2eth \
+	libproto.a
 
 DISTCLEANFILES =	\
 	register.c	\
-	register-static.c \
 	rdps		\
 	ps.c		\
 	*~
@@ -985,7 +951,6 @@
 install-exec-hook:
 	-chmod +s $(DESTDIR)$(bindir)/ethereal
 	-chmod +s $(DESTDIR)$(bindir)/tethereal
-	-chmod +s $(DESTDIR)$(bindir)/ethereal_static
 else
 install-exec-hook:
 endif
Index: ethereal/configure.in
===================================================================
RCS file: /cvsroot/ethereal/configure.in,v
retrieving revision 1.170
diff -u -r1.170 configure.in
--- configure.in	2002/07/12 22:52:33	1.170
+++ configure.in	2002/07/13 11:10:06
@@ -678,6 +678,7 @@
 AM_PROG_LIBTOOL
 AC_SUBST(LIBTOOL_DEPS)
 
+AM_CONDITIONAL(ENABLE_STATIC, test x$enable_shared = xno)
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_SUBDIRS(epan wiretap)
 AC_OUTPUT(