3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 --- libpcap-0.9.3/Makefile.in~shared
7 +++ libpcap-0.9.3/Makefile.in
12 +# some defines for shared library compilation - FIXME, if not matching
15 +VERSION=$(MAJ).$(MIN)
17 +LIBRARY=lib$(LIBNAME).a
18 +SOLIBRARY=lib$(LIBNAME).so
19 +SHAREDLIB=$(SOLIBRARY).$(VERSION)
22 # You shouldn't need to edit anything below.
27 CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
28 +CFLAGS_SHARED = -shared -Wl,-soname,$(SOLIBRARY).$(MAJ)
31 INSTALL_PROGRAM = @INSTALL_PROGRAM@
35 $(CC) $(CFLAGS) -c $(srcdir)/$*.c
38 + $(CC) -fPIC $(CFLAGS) -c -o $@ $(srcdir)/$*.c
40 PSRC = pcap-@V_PCAP@.c
41 FSRC = fad-@V_FINDALLDEVS@.c
43 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
44 # hack the extra indirection
45 OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
46 +OBJ_PIC = $(PSRC:.c=_pic.o) $(FSRC:.c=.o) $(CSRC:.c=_pic.o) $(GENSRC:.c=_pic.o)
47 HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
48 ethertype.h gencode.h gnuc.h
52 $(SRC) $(HDR) $(TAGHDR)
54 -CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
55 +CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so*
58 +all: libpcap.a $(SHAREDLIB)
62 ar rc $@ $(OBJ) $(LIBS)
65 +$(SHAREDLIB): $(OBJ_PIC)
67 + -@rm -f $(SOLIBRARY) $(SOLIBRARY).$(MAJ)
68 + $(CC) $(CFLAGS_SHARED) -o $(SHAREDLIB) $(OBJ_PIC) -lc
69 + ln -s $(SHAREDLIB) $(SOLIBRARY).$(MAJ)
70 + ln -s $(SOLIBRARY).$(MAJ) $(SOLIBRARY)
72 shared: libpcap.$(DYEXT)
76 scanner.o: scanner.c tokdefs.h
77 $(CC) $(CFLAGS) -c scanner.c
79 +scanner_pic.o: scanner.c tokdefs.h
80 + $(CC) -fPIC $(CFLAGS) -o $@ -c scanner.c
87 $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
89 +grammer_pic.o: grammar.c
91 + $(CC) -fPIC $(CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c
94 $(CC) $(CFLAGS) -c version.c
96 +version_pic.o: version.c
97 + $(CC) -fPIC $(CFLAGS) -c version.c -o $@
99 snprintf.o: $(srcdir)/missing/snprintf.c
100 $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
102 @@ -170,11 +201,17 @@
103 bpf_filter.o: bpf_filter.c
104 $(CC) $(CFLAGS) -c bpf_filter.c
106 +bpf_filter_pic.o: bpf_filter.c
107 + $(CC) -fPIC $(CFLAGS) -c bpf_filter.c -o $@
110 [ -d $(DESTDIR)$(libdir) ] || \
111 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
112 $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
113 $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
114 + $(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/
115 + ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY).$(MAJ)
116 + ln -sf $(SOLIBRARY).$(MAJ) $(DESTDIR)$(libdir)/$(SOLIBRARY)
117 [ -d $(DESTDIR)$(includedir) ] || \
118 (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
119 $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h