libs/libpcap: update to 1.8.1
Update libpcap to upstream release 1.8.1 Change the name from libpcap.so.1.3 to libpcap.so.1 Remove parts of patch 201 which moved code among src files. Import patch 204 from Debian to update the USB path. Signed-off-by: Paul Wassi <p.wassi@gmx.at> Signed-off-by: Felix Fietkau <nbd@nbd.name> [fix parallel build bug]
This commit is contained in:
		| @@ -3,13 +3,12 @@ build a shared library. | ||||
|  | ||||
| --- a/Makefile.in | ||||
| +++ b/Makefile.in | ||||
| @@ -38,6 +38,14 @@ mandir = @mandir@ | ||||
| @@ -38,6 +38,13 @@ mandir = @mandir@ | ||||
|  srcdir = @srcdir@ | ||||
|  VPATH = @srcdir@ | ||||
|   | ||||
| +# some defines for shared library compilation | ||||
| +MAJ=1.3 | ||||
| +LIBVERSION=$(MAJ).0 | ||||
| +LIBVERSION=1 | ||||
| +LIBNAME=pcap | ||||
| +LIBRARY=lib$(LIBNAME).a | ||||
| +SOLIBRARY=lib$(LIBNAME).so | ||||
| @@ -18,30 +17,30 @@ build a shared library. | ||||
|  # | ||||
|  # You shouldn't need to edit anything below. | ||||
|  # | ||||
| @@ -62,7 +70,8 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ | ||||
| @@ -62,7 +69,8 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ | ||||
|  PROG=libpcap | ||||
|   | ||||
|  # Standard CFLAGS | ||||
| -FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS) | ||||
| +FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS) $(CPPFLAGS) | ||||
| +CFLAGS_SHARED = -shared -Wl,-soname,$(SOLIBRARY).$(MAJ) | ||||
| +CFLAGS_SHARED = -shared -Wl,-soname,$(SHAREDLIB) | ||||
|   | ||||
|  INSTALL = @INSTALL@ | ||||
|  INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||||
| @@ -82,7 +91,11 @@ YACC = @V_YACC@ | ||||
| @@ -77,7 +85,11 @@ YACC = @YACC@ | ||||
|  # problem if you don't own the file but can write to the directory. | ||||
|  .c.o: | ||||
|  	@rm -f $@ | ||||
| -	$(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c | ||||
| +	$(CC) $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c | ||||
| + | ||||
| +%_pic.o: %.c | ||||
| +%_pic.o: %.c %.o | ||||
| +	@rm -f $@ | ||||
| +	$(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c | ||||
|   | ||||
|  PSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @CAN_SRC@ @NETFILTER_SRC@ @CANUSB_SRC@ @DBUS_SRC@ | ||||
|  FSRC =  fad-@V_FINDALLDEVS@.c | ||||
| @@ -98,6 +111,7 @@ SRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $( | ||||
|  PSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @NETFILTER_SRC@ @DBUS_SRC@ | ||||
|  FSRC =  @V_FINDALLDEVS@ | ||||
| @@ -93,6 +105,7 @@ SRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $( | ||||
|  # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot | ||||
|  # hack the extra indirection | ||||
|  OBJ =	$(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS) | ||||
| @@ -49,7 +48,7 @@ build a shared library. | ||||
|  PUBHDR = \ | ||||
|  	pcap.h \ | ||||
|  	pcap-bpf.h \ | ||||
| @@ -153,7 +167,7 @@ TAGFILES = \ | ||||
| @@ -157,7 +170,7 @@ TAGFILES = \ | ||||
|   | ||||
|  CLEANFILES = $(OBJ) libpcap.* $(TESTS) \ | ||||
|  	$(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ | ||||
| @@ -58,7 +57,7 @@ build a shared library. | ||||
|   | ||||
|  MAN1 = pcap-config.1 | ||||
|   | ||||
| @@ -365,7 +379,7 @@ libpcap.a: $(OBJ) | ||||
| @@ -365,7 +378,7 @@ libpcap.a: $(OBJ) | ||||
|  	$(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS) | ||||
|  	$(RANLIB) $@ | ||||
|   | ||||
| @@ -67,33 +66,32 @@ build a shared library. | ||||
|   | ||||
|  libpcap.so: $(OBJ) | ||||
|  	@rm -f $@ | ||||
| @@ -443,6 +457,13 @@ libpcap.shareda: $(OBJ) | ||||
| @@ -443,6 +456,12 @@ libpcap.shareda: $(OBJ) | ||||
|  # | ||||
|  libpcap.none: | ||||
|   | ||||
| +$(SHAREDLIB): $(OBJ_PIC) | ||||
| +	-@rm -f $@ | ||||
| +	-@rm -f $(SOLIBRARY) $(SOLIBRARY).$(MAJ) | ||||
| +	-@rm -f $(SOLIBRARY) | ||||
| +	$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $(SHAREDLIB) $(OBJ_PIC) -lc $(LIBS) | ||||
| +	ln -s $(SHAREDLIB) $(SOLIBRARY).$(MAJ) | ||||
| +	ln -s $(SOLIBRARY).$(MAJ) $(SOLIBRARY) | ||||
| +	ln -s $(SHAREDLIB) $(SOLIBRARY) | ||||
| + | ||||
|  scanner.c: $(srcdir)/scanner.l | ||||
|  	@rm -f $@ $@.bottom | ||||
|  	$(srcdir)/runlex.sh $(LEX) -o$@ $< | ||||
| @@ -453,6 +474,9 @@ scanner.c: $(srcdir)/scanner.l | ||||
|  scanner.o: scanner.c tokdefs.h | ||||
|  	$(LEX) -P pcap_ --header-file=scanner.h --nounput -o scanner.c $< | ||||
|  scanner.h: scanner.c | ||||
| @@ -455,6 +474,9 @@ scanner.h: scanner.c | ||||
|  scanner.o: scanner.c grammar.h | ||||
|  	$(CC) $(FULL_CFLAGS) -c scanner.c | ||||
|   | ||||
| +scanner_pic.o: scanner.c tokdefs.h | ||||
| +scanner_pic.o: scanner.c grammar.h | ||||
| +	$(CC) -fPIC $(FULL_CFLAGS) -o $@ -c scanner.c | ||||
| + | ||||
|  pcap.o: version.h | ||||
|  pcap.o: pcap_version.h | ||||
|   | ||||
|  tokdefs.h: grammar.c | ||||
| @@ -466,9 +490,16 @@ grammar.o: grammar.c | ||||
|  	@rm -f $@ | ||||
|  	$(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c | ||||
|  grammar.c: $(srcdir)/grammar.y | ||||
| @@ -472,9 +494,16 @@ grammar.o: grammar.c | ||||
|  gencode.o: $(srcdir)/gencode.c grammar.h scanner.h | ||||
|  	$(CC) $(FULL_CFLAGS) -c $(srcdir)/gencode.c | ||||
|   | ||||
| +grammar_pic.o: grammar.c | ||||
| +	@rm -f $@ | ||||
| @@ -108,7 +106,7 @@ build a shared library. | ||||
|  snprintf.o: $(srcdir)/missing/snprintf.c | ||||
|  	$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c | ||||
|   | ||||
| @@ -506,6 +537,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt | ||||
| @@ -501,6 +530,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt | ||||
|  bpf_filter.o: bpf_filter.c | ||||
|  	$(CC) $(FULL_CFLAGS) -c bpf_filter.c | ||||
|   | ||||
| @@ -118,7 +116,7 @@ build a shared library. | ||||
|  # | ||||
|  # Generate the pcap-config script. | ||||
|  # | ||||
| @@ -622,14 +656,12 @@ install: install-shared install-archive | ||||
| @@ -623,14 +655,11 @@ install: install-shared install-archive | ||||
|  		    $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done | ||||
|   | ||||
|  install-shared: install-shared-$(DYEXT) | ||||
| @@ -132,14 +130,13 @@ build a shared library. | ||||
| -	ln -sf libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \ | ||||
| -	ln -sf libpcap.so.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.so | ||||
| +	$(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/ | ||||
| +	ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY).$(MAJ) | ||||
| +	ln -sf $(SOLIBRARY).$(MAJ) $(DESTDIR)$(libdir)/$(SOLIBRARY) | ||||
| +	ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY) | ||||
|  install-shared-dylib: libpcap.dylib | ||||
|  	[ -d $(DESTDIR)$(libdir) ] || \ | ||||
|  	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) | ||||
| --- a/aclocal.m4 | ||||
| +++ b/aclocal.m4 | ||||
| @@ -438,7 +438,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, | ||||
| @@ -470,7 +470,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, | ||||
|  			esac | ||||
|  			;; | ||||
|  		    esac | ||||
| @@ -148,7 +145,7 @@ build a shared library. | ||||
|  		    V_SONAME_OPT="-Wl,-soname," | ||||
|  		    V_RPATH_OPT="-Wl,-rpath," | ||||
|  		    ;; | ||||
| @@ -501,7 +501,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, | ||||
| @@ -533,7 +533,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, | ||||
|  		    # | ||||
|  		    # "cc" is GCC. | ||||
|  		    # | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 p-wassi
					p-wassi