--- Makefile.in +++ Makefile.in @@ -37,6 +37,13 @@ srcdir = @srcdir@ VPATH = @srcdir@ +### +# pcaplib version +MAJOR = 0 +MINOR = 9.3 +VERSION = $(MAJOR).$(MINOR) +export MAJOR MINOR VERSION + # # You shouldn't need to edit anything below. # @@ -95,31 +102,22 @@ 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 -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 $@ - ld -shared -o $@.`cat VERSION` $(OBJ) - -# the following rule succeeds, but the result is untested. -libpcap.dylib: $(OBJ) - rm -f libpcap*.dylib - $(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \ - -install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \ - -current_version `cat VERSION` + $(CC) -shared -Wl,-soname -Wl,$@.$(MAJOR) -o $@.$(VERSION) $(OBJ) + @rm -f $@.$(MAJOR) $@ + @ln -s $@.$(VERSION) $@.$(MAJOR) + @ln -s $@.$(VERSION) $@ scanner.c: $(srcdir)/scanner.l @@ -173,8 +171,11 @@ install: libpcap.a [ -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)) $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h @@ -196,6 +197,7 @@ uninstall: rm -f $(DESTDIR)$(libdir)/libpcap.a + rm -f $(DESTDIR)$(libdir)/$(LIBNAME)* rm -f $(DESTDIR)$(includedir)/pcap.h rm -f $(DESTDIR)$(includedir)/pcap-bpf.h rm -f $(DESTDIR)$(includedir)/pcap-namedb.h