File libpcap-0.9.8-shared.patch of Package libpcap
--- Makefile.in +++ Makefile.in @@ -38,6 +38,14 @@ srcdir = @srcdir@ VPATH = @srcdir@ +### +# pcaplib version +VERSION = @PACKAGE_VERSION@ +MAJOR = $(shell echo $(VERSION) | cut -d. -f1) +MINOR = $(shell echo $(VERSION) | cut -d. -f2) +REVISION = $(shell echo $(VERSION) | cut -d. -f3) +export MAJOR MINOR REVISION VERSION + # # You shouldn't need to edit anything below. # @@ -98,7 +106,8 @@ TAGFILES = \ $(SRC) $(HDR) $(TAGHDR) -CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c +LIBNAME = libpcap.so +CLEANFILES = $(OBJ) libpcap.a $(LIBNAME)* $(GENSRC) $(GENHDR) lex.yy.c MAN3PCAP = pcap.3pcap \ pcap_breakloop.3pcap \ @@ -151,22 +160,20 @@ MAN4 = pcap-filter.4 \ pcap-linktype.4 -all: libpcap.a +all: libpcap.a libpcap.so libpcap.a: $(OBJ) @rm -f $@ $(AR) rc $@ $(OBJ) $(LIBS) $(RANLIB) $@ -shared: libpcap.$(DYEXT) - -# -# XXX - this works with GNU ld, but won't necessarily work with native -# ld on, for example, various SVR4-flavored platforms, or Digital UNIX. -# libpcap.so: $(OBJ) @rm -f $@ - $(CC) -shared -o $@.`cat VERSION` $(OBJ) $(DAGLIBS) + $(CC) -shared -Wl,-soname -Wl,$@.$(MAJOR) -o $@.$(VERSION) $(OBJ) + @rm -f $@.$(MAJOR) $@ + @ln -s $@.$(VERSION) $@.$(MAJOR) + @ln -s $@.$(VERSION) $@ + # the following rule succeeds, but the result is untested. libpcap.dylib: $(OBJ) @@ -232,11 +239,14 @@ findalldevstest: findalldevstest.c libpcap.a $(CC) $(CFLAGS) -I. -L. -o findalldevstest findalldevstest.c libpcap.a -install: libpcap.a +install: $(all) [ -d $(DESTDIR)$(libdir) ] || \ (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) - $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a + $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/ $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a + $(INSTALL_PROGRAM) $(LIBNAME).$(VERSION) $(DESTDIR)$(libdir)/ + @ln -sf $(LIBNAME).$(VERSION) $(DESTDIR)$(libdir)/$(LIBNAME).$(MAJOR) + @ln -sf $(LIBNAME).$(VERSION) $(DESTDIR)$(libdir)/$(LIBNAME) [ -d $(DESTDIR)$(includedir) ] || \ (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) [ -d $(DESTDIR)$(includedir)/pcap ] || \ @@ -294,6 +304,7 @@ uninstall: rm -f $(DESTDIR)$(libdir)/libpcap.a + rm -f $(DESTDIR)$(libdir)/$(LIBNAME)* rm -f $(DESTDIR)$(includedir)/pcap/pcap.h rm -f $(DESTDIR)$(includedir)/pcap/bpf.h rm -f $(DESTDIR)$(includedir)/pcap/namedb.h --- configure.in +++ configure.in @@ -8,7 +8,8 @@ AC_REVISION($Revision: 1.150 $) AC_PREREQ(2.50) -AC_INIT(pcap.c) +AC_INIT([libpcap], [0.9.8]) +AC_CONFIG_SRCDIR([pcap.c]) AC_CANONICAL_SYSTEM @@ -83,7 +84,7 @@ AC_CHECK_FUNCS(vsnprintf snprintf,, [needsnprintf=yes]) if test $needsnprintf = yes; then - AC_LIBOBJ(snprintf) + AC_LIBOBJ([snprintf]) fi #