Ethereal-dev: [Ethereal-dev] Please test: shared libs

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, 7 Feb 2004 00:13:55 +0100
Hi List,

the patch below turns libwiretap and libethereal into shared libs.
I'd like to see some testing on more than my system before I submit it.

Planned next steps:
1) commit this
2) compile and link the dissection stuff into libethereal (this can
   hopefully be achieved by Makefile changes only)
3) Move dissection stuff to somewhere inside the epan directory

Things I'd like to get feedback on too:
Should I make dfilter into a shared lib too?
Should wiretap remain a static lib?

 Ciao
       Joerg

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/Makefile.am,v
retrieving revision 1.706
diff -p -u -r1.706 Makefile.am
--- Makefile.am	1 Feb 2004 10:07:20 -0000	1.706
+++ Makefile.am	6 Feb 2004 22:50:23 -0000
@@ -231,10 +231,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/libethereal.la	\
 	epan/dfilter/libdfilter.a
 
 # This is the automake dependency variable for the executable
@@ -268,9 +267,8 @@ ethereal_LDADD = \
 # 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		\
+	wiretap/libwiretap.la		\
+	epan/libethereal.la		\
 	epan/dfilter/libdfilter.a
 
 # This is the automake dependency variable for the executable
@@ -305,14 +303,14 @@ 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
@@ -402,14 +400,13 @@ rdps: rdps.c
 randpkt.o: randpkt.c
 	$(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
 
-randpkt: randpkt.o wiretap/libwiretap.a
-	$(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
+randpkt: randpkt.o wiretap/libwiretap.la
+	$(LINK) -o randpkt randpkt.o wiretap/libwiretap.la `glib-config --libs` -lz
 
 
 dftest_additional_libs =		\
-	wiretap/libwiretap.a		\
-	epan/libethereal.a		\
-	epan/ftypes/libftypes.a		\
+	wiretap/libwiretap.la		\
+	epan/libethereal.la		\
 	epan/dfilter/libdfilter.a
 
 dftest_DEPENDENCIES = \
Index: epan/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/epan/Makefile.am,v
retrieving revision 1.32
diff -p -u -r1.32 Makefile.am
--- epan/Makefile.am	6 Dec 2003 06:22:10 -0000	1.32
+++ epan/Makefile.am	6 Feb 2004 22:50:27 -0000
@@ -29,11 +29,18 @@ SUBDIRS = ftypes dfilter
 
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
-noinst_LIBRARIES = libethereal.a
-
 INCLUDES = -I$(srcdir)/..
 
-libethereal_a_SOURCES = \
+lib_LTLIBRARIES = libethereal.la
+
+#
+# Add the object files for missing routines, if any.
+#
+libethereal_la_LIBADD = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ ftypes/libftypes.a
+libethereal_la_DEPENDENCIES = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@
+libethereal_la_LDFLAGS = -version-info 0:1:0
+
+libethereal_la_SOURCES = \
 	atalk-utils.c		\
 	atalk-utils.h		\
 	bitswap.c		\
@@ -47,7 +54,7 @@ libethereal_a_SOURCES = \
 	column-utils.h		\
 	epan.c			\
 	epan.h			\
-	epan_dissect.h	\
+	epan_dissect.h		\
 	except.c		\
 	except.h		\
 	exceptions.h		\
@@ -87,7 +94,7 @@ libethereal_a_SOURCES = \
 	value_string.c		\
 	value_string.h		
 
-EXTRA_libethereal_a_SOURCES =	\
+EXTRA_libethereal_la_SOURCES =	\
         inet_aton.c		\
 	inet_pton.c		\
 	inet_ntop.c		\
@@ -100,15 +107,8 @@ EXTRA_DIST = \
 	tvbtest.c
 
 CLEANFILES = \
-	libethereal.a	\
 	*~
 
-#
-# 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@
-
 
 tvbtest: tvbtest.o tvbuff.o except.o strutil.o
 	$(LINK) -o tvbtest tvbtest.o tvbuff.o except.o strutil.o `glib-config --libs`
Index: wiretap/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ethereal/wiretap/Makefile.am,v
retrieving revision 1.48
diff -p -u -r1.48 Makefile.am
--- wiretap/Makefile.am	2 Dec 2003 19:37:04 -0000	1.48
+++ wiretap/Makefile.am	6 Feb 2004 22:50:32 -0000
@@ -23,15 +23,13 @@
 
 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		\
 	*~
 
-libwiretap_a_SOURCES = \
+libwiretap_la_SOURCES = \
 	airopeek9.c		\
 	airopeek9.h		\
 	ascend-grammar.y	\