Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] shared libethereal - take 5

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: Tue, 9 Mar 2004 00:49:51 +0100
Attached is the hopefully last iteration of the shared libethereal patch.
It builds a libethereal that includes the dfilter and ftypes stuff.
Guy, can you please test on MacOS X whether the shared libs stuff works?
Others: I'm currently waiting for Guys tests on MacOS X. If they work out,
I'll commit the patches. In case you want to test on your favourite
platform, do so now :-)

 Ciao
   Jï¿œrg
-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/Makefile.am,v
retrieving revision 1.718
diff -p -u -r1.718 Makefile.am
--- Makefile.am	4 Mar 2004 08:26:20 -0000	1.718
+++ Makefile.am	8 Mar 2004 23:27:45 -0000
@@ -189,11 +189,9 @@ ethereal_optional_objects = @SNPRINTF_O@
 # Additional libs that I know how to build. These will be
 # linked into the ethereal executable.
 ethereal_additional_libs = \
-	wiretap/libwiretap.a	\
+	wiretap/libwiretap.la	\
 	gtk/libui.a		\
-	epan/libethereal.a	\
-	epan/ftypes/libftypes.a \
-	epan/dfilter/libdfilter.a
+	epan/libethereal.la
 
 # This is the automake dependency variable for the executable
 ethereal_DEPENDENCIES = \
@@ -220,16 +218,14 @@ ethereal_LDADD = \
 	$(ethereal_additional_libs)	\
 	@SNMP_LIBS@ @SSL_LIBS@ 		\
 	$(plugin_ldadd)			\
-	@PCRE_LIBS@ \
+	@PCRE_LIBS@			\
 	@PCAP_LIBS@ @GTK_LIBS@ @ADNS_LIBS@
 
 # Additional libs that I know how to build. These will be
 # linked into the tethereal executable.
 tethereal_additional_libs =		\
-	wiretap/libwiretap.a		\
-	epan/libethereal.a		\
-	epan/ftypes/libftypes.a		\
-	epan/dfilter/libdfilter.a
+	wiretap/libwiretap.la		\
+	epan/libethereal.la
 
 # This is the automake dependency variable for the executable
 tethereal_DEPENDENCIES = \
@@ -243,7 +239,7 @@ tethereal_LDADD = \
 	$(tethereal_additional_libs)	\
 	@SNMP_LIBS@ @SSL_LIBS@		\
 	$(plugin_ldadd)			\
-	@PCRE_LIBS@ \
+	@PCRE_LIBS@			\
 	@GLIB_LIBS@ -lm			\
 	@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
 
@@ -263,24 +259,25 @@ text2pcap_DEPENDENCIES = text2pcap.h
 text2pcap_LDADD = $(text2pcap_optional_objects) \
 	@GLIB_LIBS@ -lm
 
-mergecap_DEPENDENCIES = wiretap/libwiretap.a
+mergecap_DEPENDENCIES = wiretap/libwiretap.la
 
 # This is the automake dependency variable for the executable
-editcap_DEPENDENCIES = wiretap/libwiretap.a
+editcap_DEPENDENCIES = wiretap/libwiretap.la
 
 # This automake variable adds to the link-line for the executable
-editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
-mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
+editcap_LDADD = wiretap/libwiretap.la @GLIB_LIBS@
+mergecap_LDADD = wiretap/libwiretap.la @GLIB_LIBS@
 
 # Common headers
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap
 
-.PHONY:	cvsversion.h
-
 #
 # Build the version string
 #
-cvsversion.h:
+# FORCE is the portable version of .PHONY
+FORCE:
+
+cvsversion.h: FORCE
 	$(PERL) $(srcdir)/make-version.pl
 
 #
@@ -318,7 +315,7 @@ ps.c: print.ps rdps
 rdps: rdps.c
 	$(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
 
-randpkt_additional_libs = wiretap/libwiretap.a
+randpkt_additional_libs = wiretap/libwiretap.la
 
 randpkt_DEPENDENCIES = \
 	$(randpkt_additional_libs)
@@ -329,10 +326,8 @@ randpkt_LDADD = \
 	@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
 
 dftest_additional_libs =		\
-	wiretap/libwiretap.a		\
-	epan/libethereal.a		\
-	epan/ftypes/libftypes.a		\
-	epan/dfilter/libdfilter.a
+	wiretap/libwiretap.la		\
+	epan/libethereal.la
 
 dftest_DEPENDENCIES = \
 	$(ethereal_optional_objects)	\
@@ -388,6 +383,7 @@ EXTRA_DIST = \
 	cleanbld.bat		\
 	config.h.win32		\
 	config.nmake		\
+	cvsversion.h		\
 	debian/README.debian	\
 	debian/changelog	\
 	debian/control		\
Index: Makefile.common
===================================================================
RCS file: /usr/local/cvsroot/ethereal/Makefile.common,v
retrieving revision 1.28
diff -p -u -r1.28 Makefile.common
--- Makefile.common	5 Mar 2004 10:29:35 -0000	1.28
+++ Makefile.common	8 Mar 2004 23:27:45 -0000
@@ -240,7 +240,7 @@ DISSECTOR_SUPPORT_INCLUDES =	\
 	xmlstub.h
 
 # "BUILT_SOURCES" are built before any "make all" or "make check" targets.
-BUILT_SOURCES =		\
+BUILT_SOURCES =	
 	cvsversion.h
 
 # sources common for ethereal and tethereal
Index: epan/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/epan/Makefile.am,v
retrieving revision 1.38
diff -p -u -r1.38 Makefile.am
--- epan/Makefile.am	6 Mar 2004 03:25:10 -0000	1.38
+++ epan/Makefile.am	8 Mar 2004 23:27:47 -0000
@@ -29,13 +29,14 @@ SUBDIRS = ftypes dfilter
 
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
-noinst_LIBRARIES = libethereal.a
+lib_LTLIBRARIES = libethereal.la
+libethereal_la_LDFLAGS = -version-info 0:1:0
 
 include Makefile.common
 
 INCLUDES = -I$(srcdir)/..
 
-libethereal_a_SOURCES = \
+libethereal_la_SOURCES = \
 	addr_and_mask.c		\
 	addr_and_mask.h		\
 	atalk-utils.c		\
@@ -93,7 +94,7 @@ libethereal_a_SOURCES = \
 	$(DISSECTOR_SRC)        \
 	$(DISSECTOR_SUPPORT_SRC)
 
-EXTRA_libethereal_a_SOURCES =	\
+EXTRA_libethereal_la_SOURCES =	\
         inet_aton.c		\
 	inet_pton.c		\
 	inet_ntop.c		\
@@ -103,7 +104,9 @@ EXTRA_libethereal_a_SOURCES =	\
 EXTRA_DIST = \
 	config.h.win32		\
 	Makefile.nmake		\
-	tvbtest.c
+	tvbtest.c		\
+	x11-declarations.h	\
+	x11-register-info.h
 
 CLEANFILES = \
 	libethereal.a	\
@@ -116,8 +119,8 @@ MAINTAINERCLEANFILES =	\
 #
 # Add the object files for missing routines, if any.
 #
-libethereal_a_LIBADD = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@
-libethereal_a_DEPENDENCIES = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@
+libethereal_la_LIBADD = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ dfilter/libdfilter.la ftypes/libftypes.la
+libethereal_la_DEPENDENCIES = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ dfilter/libdfilter.la ftypes/libftypes.la
 
 ../packet-ncp2222.c : $(srcdir)/../ncp2222.py
 	$(PYTHON) $(srcdir)/../ncp2222.py -o $@
Index: epan/configure.in
===================================================================
RCS file: /usr/local/cvsroot/ethereal/epan/configure.in,v
retrieving revision 1.65
diff -p -u -r1.65 configure.in
--- epan/configure.in	4 Mar 2004 08:53:02 -0000	1.65
+++ epan/configure.in	8 Mar 2004 23:27:48 -0000
@@ -179,10 +179,10 @@ else
 fi
 
 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
-  INET_ATON_O="inet_aton.o")
+  INET_ATON_O="inet_aton.lo")
 if test "$ac_cv_func_inet_aton" = no ; then
   INET_ATON_C="inet_aton.c"
-  INET_ATON_O="inet_aton.o"
+  INET_ATON_O="inet_aton.lo"
   AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
 fi
 AC_SUBST(INET_ATON_C)
@@ -211,7 +211,7 @@ have_inet_pton=no])],
 have_inet_pton=no)
 if test "$have_inet_pton" = no; then
   INET_PTON_C="inet_pton.c"
-  INET_PTON_O="inet_pton.o"
+  INET_PTON_O="inet_pton.lo"
 else
   INET_PTON_C=""
   INET_PTON_O=""
@@ -244,7 +244,7 @@ extern const char *inet_ntop(int, const 
       AC_MSG_RESULT(no)])])
   INET_NTOP_O=""], [
   INET_NTOP_C="inet_ntop.c"
-  INET_NTOP_O="inet_ntop.o"
+  INET_NTOP_O="inet_ntop.lo"
   AC_DEFINE(NEED_INET_V6DEFS_H, 1,
   [Define if inet/v6defs.h needs to be included])])
 AC_SUBST(INET_NTOP_C)
Index: epan/dfilter/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/epan/dfilter/Makefile.am,v
retrieving revision 1.9
diff -p -u -r1.9 Makefile.am
--- epan/dfilter/Makefile.am	5 Mar 2001 22:53:39 -0000	1.9
+++ epan/dfilter/Makefile.am	8 Mar 2004 23:27:48 -0000
@@ -21,11 +21,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-# We produce an archive library. In the future, when libethereal is a
-# shared library, this will be linked into libethereal. While libethereal
-# is an archive library, any executable linking against libethereal will
-# also need to link against libftypes.
-noinst_LIBRARIES = libdfilter.a
+noinst_LTLIBRARIES = libdfilter.la
 
 CLEANFILES = \
 	libdfilter.a		\
@@ -33,7 +29,7 @@ CLEANFILES = \
 
 INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/.. -I$(srcdir)/$(LEMON)
 
-libdfilter_a_SOURCES = \
+libdfilter_la_SOURCES = \
 	dfilter.c		\
 	dfilter.h		\
 	dfilter-int.h		\
Index: epan/ftypes/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/epan/ftypes/Makefile.am,v
retrieving revision 1.5
diff -p -u -r1.5 Makefile.am
--- epan/ftypes/Makefile.am	9 Dec 2003 23:02:39 -0000	1.5
+++ epan/ftypes/Makefile.am	8 Mar 2004 23:27:48 -0000
@@ -21,11 +21,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-# We produce an archive library. In the future, when libethereal is a
-# shared library, this will be linked into libethereal. While libethereal
-# is an archive library, any executable linking against libethereal will
-# also need to link against libftypes.
-noinst_LIBRARIES = libftypes.a
+noinst_LTLIBRARIES = libftypes.la
 
 CLEANFILES = \
 	libftypes.a	\
@@ -33,7 +29,7 @@ CLEANFILES = \
 
 INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/..
 
-libftypes_a_SOURCES =	\
+libftypes_la_SOURCES =	\
 	ftypes.c	\
 	ftypes.h	\
 	ftypes-int.h	\
Index: wiretap/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/wiretap/Makefile.am,v
retrieving revision 1.50
diff -p -u -r1.50 Makefile.am
--- wiretap/Makefile.am	6 Mar 2004 21:46:27 -0000	1.50
+++ wiretap/Makefile.am	8 Mar 2004 23:27:50 -0000
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Wiretap
 #
-# $Id: Makefile.am,v 1.50 2004/03/06 21:46:27 guy Exp $
+# $Id: Makefile.am,v 1.49 2004/02/11 20:05:15 guy Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@xxxxxxxxxxxx>
@@ -23,19 +23,18 @@
 
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
-noinst_LIBRARIES = libwiretap.a
-
-#EXTRA_LIBRARIES = libwiretap.a
+lib_LTLIBRARIES = libwiretap.la
+libwiretap_la_LDFLAGS = -version-info 0:1:0
 
 CLEANFILES = \
 	libwiretap.a		\
 	*~
 
-MAINTAINERCLEANFILES =	\
+MAINTAINERCLEANFILES = \
 	ascend-grammar.c \
 	ascend-grammar.h
 
-libwiretap_a_SOURCES = \
+libwiretap_la_SOURCES = \
 	airopeek9.c		\
 	airopeek9.h		\
 	ascend-grammar.y	\