| @@ -1,117 +1,166 @@ | | | @@ -1,117 +1,166 @@ |
1 | $NetBSD: patch-ac,v 1.3 2007/10/08 20:38:17 adam Exp $ | | 1 | $NetBSD: patch-ac,v 1.4 2008/10/30 08:12:34 adam Exp $ |
2 | | | 2 | |
3 | --- Makefile.in.orig 2007-07-24 04:35:15.000000000 +0200 | | 3 | --- Makefile.in.orig 2008-10-28 02:26:13.000000000 +0100 |
4 | +++ Makefile.in | | 4 | +++ Makefile.in |
5 | @@ -41,7 +41,7 @@ VPATH = @srcdir@ | | 5 | @@ -44,7 +44,7 @@ VPATH = @srcdir@ |
6 | # You shouldn't need to edit anything below. | | 6 | # You shouldn't need to edit anything below. |
7 | # | | 7 | # |
8 | | | 8 | |
9 | -CC = @CC@ | | 9 | -CC = @CC@ |
10 | +CC = ${LIBTOOL} --mode=compile @CC@ | | 10 | +CC = ${LIBTOOL} --mode=compile @CC@ |
11 | CCOPT = @V_CCOPT@ | | 11 | CCOPT = @V_CCOPT@ |
12 | INCLS = -I. @V_INCLS@ | | 12 | INCLS = -I. @V_INCLS@ |
13 | DEFS = @DEFS@ @V_DEFS@ | | 13 | DEFS = @DEFS@ @V_DEFS@ |
14 | @@ -69,7 +69,8 @@ YACC = @V_YACC@ | | 14 | @@ -73,7 +73,8 @@ YACC = @V_YACC@ |
15 | # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. | | 15 | # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. |
16 | # Also, gcc does not remove the .o before forking 'as', which can be a | | 16 | # Also, gcc does not remove the .o before forking 'as', which can be a |
17 | # problem if you don't own the file but can write to the directory. | | 17 | # problem if you don't own the file but can write to the directory. |
18 | -.c.o: | | 18 | -.c.o: |
19 | +.SUFFIXES: .lo | | 19 | +.SUFFIXES: .lo |
20 | +.c.lo: | | 20 | +.c.lo: |
21 | @rm -f $@ | | 21 | @rm -f $@ |
22 | $(CC) $(CFLAGS) -c $(srcdir)/$*.c | | 22 | $(CC) $(CFLAGS) -c $(srcdir)/$*.c |
23 | | | 23 | |
24 | @@ -79,13 +80,13 @@ SSRC = @SSRC@ | | 24 | @@ -83,13 +84,13 @@ SSRC = @SSRC@ |
25 | CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \ | | 25 | CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \ |
26 | etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c | | 26 | etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c |
27 | GENSRC = scanner.c grammar.c version.c | | 27 | GENSRC = scanner.c grammar.c version.c |
28 | -LIBOBJS = @LIBOBJS@ | | 28 | -LIBOBJS = @LIBOBJS@ |
29 | +LIBOBJS = @LTLIBOBJS@ | | 29 | +LIBOBJS = @LTLIBOBJS@ |
30 | | | 30 | |
31 | SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC) | | 31 | SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC) |
32 | | | 32 | |
33 | # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot | | 33 | # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot |
34 | # hack the extra indirection | | 34 | # hack the extra indirection |
35 | -OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS) | | 35 | -OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS) |
36 | +OBJ = $(PSRC:.c=.lo) $(FSRC:.c=.lo) $(CSRC:.c=.lo) $(SSRC:.c=.lo) $(GENSRC:.c=.lo) $(LIBOBJS) | | 36 | +OBJ = $(PSRC:.c=.lo) $(FSRC:.c=.lo) $(CSRC:.c=.lo) $(SSRC:.c=.lo) $(GENSRC:.c=.lo) $(LIBOBJS) |
37 | HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \ | | 37 | HDR = \ |
38 | ethertype.h gencode.h gnuc.h | | 38 | acconfig.h \ |
39 | GENHDR = \ | | 39 | arcnet.h \ |
40 | @@ -99,12 +100,10 @@ TAGFILES = \ | | 40 | @@ -311,12 +312,10 @@ EXTRA_DIST = \ |
| | | 41 | Win32/Src/inet_net.c \ |
| | | 42 | Win32/Src/inet_pton.c |
41 | | | 43 | |
42 | CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c | | 44 | -all: libpcap.a pcap-config |
43 | | | 45 | +all: libpcap.la pcap-config |
44 | -all: libpcap.a | | | |
45 | +all: libpcap.la | | | |
46 | | | 46 | |
47 | -libpcap.a: $(OBJ) | | 47 | -libpcap.a: $(OBJ) |
48 | - @rm -f $@ | | 48 | - @rm -f $@ |
49 | - ar rc $@ $(OBJ) $(LIBS) | | 49 | - $(AR) rc $@ $(OBJ) $(LIBS) |
50 | - $(RANLIB) $@ | | 50 | - $(RANLIB) $@ |
51 | +libpcap.la: $(OBJ) | | 51 | +libpcap.la: $(OBJ) |
52 | + ${LIBTOOL} --mode=link @CC@ -rpath ${PREFIX}/lib ${LDFLAGS} $(OBJ) -o libpcap.la | | 52 | + ${LIBTOOL} --mode=link @CC@ -rpath ${PREFIX}/lib ${LDFLAGS} $(OBJ) -o libpcap.la |
53 | | | 53 | |
54 | shared: libpcap.$(DYEXT) | | 54 | shared: libpcap.$(DYEXT) |
55 | | | 55 | |
56 | @@ -128,10 +127,10 @@ scanner.c: $(srcdir)/scanner.l | | 56 | @@ -348,10 +347,10 @@ scanner.c: $(srcdir)/scanner.l |
57 | @rm -f $@ | | 57 | @rm -f $@ |
58 | $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@ | | 58 | ./runlex.sh $(LEX) -o$@ $< |
59 | | | 59 | |
60 | -scanner.o: scanner.c tokdefs.h | | 60 | -scanner.o: scanner.c tokdefs.h |
61 | +scanner.lo: scanner.c tokdefs.h | | 61 | +scanner.lo: scanner.c tokdefs.h |
62 | $(CC) $(CFLAGS) -c scanner.c | | 62 | $(CC) $(CFLAGS) -c scanner.c |
63 | | | 63 | |
64 | -pcap.o: version.h | | 64 | -pcap.o: version.h |
65 | +pcap.lo: version.h | | 65 | +pcap.lo: version.h |
66 | | | 66 | |
67 | tokdefs.h: grammar.c | | 67 | tokdefs.h: grammar.c |
68 | grammar.c: $(srcdir)/grammar.y | | 68 | grammar.c: $(srcdir)/grammar.y |
69 | @@ -140,17 +139,17 @@ grammar.c: $(srcdir)/grammar.y | | 69 | @@ -360,17 +359,17 @@ grammar.c: $(srcdir)/grammar.y |
70 | mv y.tab.c grammar.c | | 70 | mv y.tab.c grammar.c |
71 | mv y.tab.h tokdefs.h | | 71 | mv y.tab.h tokdefs.h |
72 | | | 72 | |
73 | -grammar.o: grammar.c | | 73 | -grammar.o: grammar.c |
74 | +grammar.lo: grammar.c | | 74 | +grammar.lo: grammar.c |
75 | @rm -f $@ | | 75 | @rm -f $@ |
76 | $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c | | 76 | $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c |
77 | | | 77 | |
78 | -version.o: version.c | | 78 | -version.o: version.c |
79 | +version.lo: version.c | | 79 | +version.lo: version.c |
80 | $(CC) $(CFLAGS) -c version.c | | 80 | $(CC) $(CFLAGS) -c version.c |
81 | | | 81 | |
82 | -snprintf.o: $(srcdir)/missing/snprintf.c | | 82 | -snprintf.o: $(srcdir)/missing/snprintf.c |
83 | +snprintf.lo: $(srcdir)/missing/snprintf.c | | 83 | +snprintf.lo: $(srcdir)/missing/snprintf.c |
84 | $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c | | 84 | $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c |
85 | | | 85 | |
86 | -version.c: $(srcdir)/VERSION | | 86 | -version.c: $(srcdir)/VERSION |
87 | +version.c: #$(srcdir)/VERSION | | 87 | +version.c: #$(srcdir)/VERSION |
88 | @rm -f $@ | | 88 | @rm -f $@ |
89 | sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@ | | 89 | sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@ |
90 | | | 90 | |
91 | @@ -161,7 +160,7 @@ version.c: $(srcdir)/VERSION | | 91 | @@ -381,7 +380,7 @@ version.c: $(srcdir)/VERSION |
92 | # so we make the version string static and return it from | | 92 | # so we make the version string static and return it from |
93 | # a function, which does work. | | 93 | # a function, which does work. |
94 | # | | 94 | # |
95 | -version.h: $(srcdir)/VERSION | | 95 | -version.h: $(srcdir)/VERSION |
96 | +version.h: #$(srcdir)/VERSION | | 96 | +version.h: #$(srcdir)/VERSION |
97 | @rm -f $@ | | 97 | @rm -f $@ |
98 | sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@ | | 98 | sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@ |
99 | | | 99 | |
100 | @@ -169,14 +168,13 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt | | 100 | @@ -389,7 +388,7 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt |
101 | rm -f bpf_filter.c | | 101 | rm -f bpf_filter.c |
102 | ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c | | 102 | ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c |
103 | | | 103 | |
104 | -bpf_filter.o: bpf_filter.c | | 104 | -bpf_filter.o: bpf_filter.c |
105 | +bpf_filter.lo: bpf_filter.c | | 105 | +bpf_filter.lo: bpf_filter.c |
106 | $(CC) $(CFLAGS) -c bpf_filter.c | | 106 | $(CC) $(CFLAGS) -c bpf_filter.c |
107 | | | 107 | |
108 | -install: libpcap.a | | 108 | # |
109 | +install: libpcap.la | | 109 | @@ -413,11 +412,10 @@ filtertest: filtertest.c libpcap.a |
| | | 110 | findalldevstest: findalldevstest.c libpcap.a |
| | | 111 | $(CC) $(CFLAGS) -I. -L. -o findalldevstest findalldevstest.c libpcap.a |
| | | 112 | |
| | | 113 | -install: libpcap.a pcap-config |
| | | 114 | +install: libpcap.la pcap-config |
110 | [ -d $(DESTDIR)$(libdir) ] || \ | | 115 | [ -d $(DESTDIR)$(libdir) ] || \ |
111 | (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) | | 116 | (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) |
112 | - $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a | | 117 | - $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a |
113 | - $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a | | 118 | - $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a |
114 | + ${LIBTOOL} --mode=install $(INSTALL_DATA) libpcap.la $(DESTDIR)$(libdir) | | 119 | + ${LIBTOOL} --mode=install $(INSTALL_DATA) libpcap.la $(DESTDIR)$(libdir) |
115 | [ -d $(DESTDIR)$(includedir) ] || \ | | 120 | [ -d $(DESTDIR)$(includedir) ] || \ |
116 | (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) | | 121 | (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) |
117 | $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h | | 122 | [ -d $(DESTDIR)$(includedir)/pcap ] || \ |
| | | 123 | @@ -445,31 +443,31 @@ install: libpcap.a pcap-config |
| | | 124 | $(DESTDIR)$(includedir)/pcap-bpf.h |
| | | 125 | $(INSTALL_DATA) $(srcdir)/pcap-namedb.h \ |
| | | 126 | $(DESTDIR)$(includedir)/pcap-namedb.h |
| | | 127 | - $(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config |
| | | 128 | + ${BSD_INSTALL_SCRIPT} pcap-config $(DESTDIR)$(bindir)/pcap-config |
| | | 129 | for i in $(MAN1); do \ |
| | | 130 | $(INSTALL_DATA) $(srcdir)/$$i \ |
| | | 131 | $(DESTDIR)$(mandir)/man1/$$i; done |
| | | 132 | - for i in $(MAN3PCAP); do \ |
| | | 133 | - $(INSTALL_DATA) $(srcdir)/$$i \ |
| | | 134 | + for i in $(MAN3PCAP:.3pcap=.3); do \ |
| | | 135 | + $(INSTALL_DATA) $(srcdir)/$${i}pcap \ |
| | | 136 | $(DESTDIR)$(mandir)/man3/$$i; done |
| | | 137 | ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3pcap \ |
| | | 138 | - $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap |
| | | 139 | + $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3 |
| | | 140 | ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \ |
| | | 141 | - $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap |
| | | 142 | + $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3 |
| | | 143 | ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \ |
| | | 144 | - $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap |
| | | 145 | + $(DESTDIR)$(mandir)/man3/pcap_perror.3 |
| | | 146 | ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \ |
| | | 147 | - $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap |
| | | 148 | + $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3 |
| | | 149 | ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \ |
| | | 150 | - $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap |
| | | 151 | + $(DESTDIR)$(mandir)/man3/pcap_dispatch.3 |
| | | 152 | ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3pcap \ |
| | | 153 | - $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap |
| | | 154 | + $(DESTDIR)$(mandir)/man3/pcap_minor_version.3 |
| | | 155 | ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3pcap \ |
| | | 156 | - $(DESTDIR)$(mandir)/man3/pcap_next.3pcap |
| | | 157 | + $(DESTDIR)$(mandir)/man3/pcap_next.3 |
| | | 158 | ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3pcap \ |
| | | 159 | - $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap |
| | | 160 | + $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3 |
| | | 161 | ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \ |
| | | 162 | - $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap |
| | | 163 | + $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3 |
| | | 164 | for i in $(MANFILE); do \ |
| | | 165 | $(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manfile.in/.manfile/'` \ |
| | | 166 | $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done |