c183c894df
version.c on case-insensitive file systems. Fixes build on Darwin in its out-of-the-box case-insensitive configuration.
282 lines
11 KiB
Text
282 lines
11 KiB
Text
$NetBSD: patch-ac,v 1.12 2017/04/19 11:50:18 dsainty Exp $
|
|
|
|
Add libtoolization
|
|
|
|
Fix manpage installation
|
|
|
|
Remove dependencies on VERSION, which trigger unintended implicit rules against
|
|
version.c on case-insensitive file systems.
|
|
|
|
--- Makefile.in.orig 2016-10-26 11:07:59.000000000 +1100
|
|
+++ Makefile.in 2017-04-19 21:01:59.000000000 +1000
|
|
@@ -43,7 +43,7 @@
|
|
#
|
|
|
|
LD = /usr/bin/ld
|
|
-CC = @CC@
|
|
+CC = ${LIBTOOL} --mode=compile @CC@
|
|
AR = @AR@
|
|
LN_S = @LN_S@
|
|
MKDEP = @MKDEP@
|
|
@@ -75,7 +75,8 @@
|
|
# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
|
|
# Also, gcc does not remove the .o before forking 'as', which can be a
|
|
# problem if you don't own the file but can write to the directory.
|
|
-.c.o:
|
|
+.SUFFIXES: .lo
|
|
+.c.lo:
|
|
@rm -f $@
|
|
$(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
|
|
|
|
@@ -86,13 +87,13 @@
|
|
etherent.c savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \
|
|
bpf_image.c bpf_dump.c
|
|
GENSRC = scanner.c grammar.c bpf_filter.c version.c
|
|
-LIBOBJS = @LIBOBJS@
|
|
+LIBOBJS = @LTLIBOBJS@
|
|
|
|
SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
|
|
|
|
# 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)
|
|
+OBJ = $(PSRC:.c=.lo) $(FSRC:.c=.lo) $(CSRC:.c=.lo) $(SSRC:.c=.lo) $(GENSRC:.c=.lo) $(LIBOBJS)
|
|
PUBHDR = \
|
|
pcap.h \
|
|
pcap-bpf.h \
|
|
@@ -358,12 +359,10 @@
|
|
Win32/Prj/wpcap.vcxproj \
|
|
Win32/Prj/wpcap.vcxproj.filters
|
|
|
|
-all: libpcap.a shared pcap-config
|
|
+all: libpcap.la pcap-config
|
|
|
|
-libpcap.a: $(OBJ)
|
|
- @rm -f $@
|
|
- $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
|
|
- $(RANLIB) $@
|
|
+libpcap.la: $(OBJ)
|
|
+ ${LIBTOOL} --mode=link @CC@ -rpath ${PREFIX}/lib ${LDFLAGS} $(OBJ) $(LIBS) -o libpcap.la
|
|
|
|
shared: libpcap.$(DYEXT)
|
|
|
|
@@ -452,10 +451,10 @@
|
|
$(MAKE) $(MAKEFLAGS) scanner.c; \
|
|
fi
|
|
|
|
-scanner.o: scanner.c grammar.h
|
|
+scanner.lo: scanner.c grammar.h
|
|
$(CC) $(FULL_CFLAGS) -c scanner.c
|
|
|
|
-pcap.o: pcap_version.h
|
|
+pcap.lo: pcap_version.h
|
|
|
|
grammar.c: $(srcdir)/grammar.y
|
|
$(YACC) -p pcap_ -o grammar.c -d $<
|
|
@@ -466,22 +465,22 @@
|
|
$(MAKE) $(MAKEFLAGS) grammar.c; \
|
|
fi
|
|
|
|
-grammar.o: grammar.c
|
|
+grammar.lo: grammar.c
|
|
$(CC) $(FULL_CFLAGS) -c grammar.c
|
|
|
|
-gencode.o: $(srcdir)/gencode.c grammar.h scanner.h
|
|
+gencode.lo: $(srcdir)/gencode.c grammar.h scanner.h
|
|
$(CC) $(FULL_CFLAGS) -c $(srcdir)/gencode.c
|
|
|
|
-version.o: version.c
|
|
+version.lo: version.c
|
|
$(CC) $(FULL_CFLAGS) -c version.c
|
|
|
|
-snprintf.o: $(srcdir)/missing/snprintf.c
|
|
+snprintf.lo: $(srcdir)/missing/snprintf.c
|
|
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
|
|
|
|
-strtok_r.o: $(srcdir)/missing/strtok_r.c
|
|
+strtok_r.lo: $(srcdir)/missing/strtok_r.c
|
|
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strtok_r.c
|
|
|
|
-version.c: $(srcdir)/VERSION $(srcdir)/gen_version_c.sh
|
|
+version.c: $(srcdir)/gen_version_c.sh
|
|
#
|
|
# Older programs import this if they want to show the
|
|
# libpcap version number, rather than calling
|
|
@@ -490,7 +489,7 @@
|
|
@rm -f $@
|
|
$(srcdir)/gen_version_c.sh $(srcdir)/VERSION $@
|
|
|
|
-pcap_version.h: $(srcdir)/VERSION $(srcdir)/pcap_version.h.in $(srcdir)/gen_version_header.sh
|
|
+pcap_version.h: $(srcdir)/pcap_version.h.in $(srcdir)/gen_version_header.sh
|
|
@rm -f $@
|
|
$(srcdir)/gen_version_header.sh $(srcdir)/VERSION $(srcdir)/pcap_version.h.in $@
|
|
|
|
@@ -498,7 +497,7 @@
|
|
rm -f bpf_filter.c
|
|
ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
|
|
|
|
-bpf_filter.o: bpf_filter.c
|
|
+bpf_filter.lo: bpf_filter.c
|
|
$(CC) $(FULL_CFLAGS) -c bpf_filter.c
|
|
|
|
#
|
|
@@ -550,7 +549,7 @@
|
|
valgrindtest: tests/valgrindtest.c libpcap.a
|
|
$(CC) $(FULL_CFLAGS) -I. -L. -o valgrindtest $(srcdir)/tests/valgrindtest.c libpcap.a $(LIBS)
|
|
|
|
-install: install-shared install-archive pcap-config
|
|
+install: libpcap.la pcap-config
|
|
[ -d $(DESTDIR)$(libdir) ] || \
|
|
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
|
|
[ -d $(DESTDIR)$(includedir) ] || \
|
|
@@ -565,56 +564,73 @@
|
|
(mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
|
|
[ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
|
|
(mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
|
|
+ ${LIBTOOL} --mode=install $(INSTALL_DATA) libpcap.la $(DESTDIR)$(libdir)
|
|
for i in $(PUBHDR); do \
|
|
$(INSTALL_DATA) $(srcdir)/$$i \
|
|
$(DESTDIR)$(includedir)/$$i; done
|
|
[ -d $(DESTDIR)$(bindir) ] || \
|
|
(mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
|
|
- $(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
|
|
+ $(BSD_INSTALL_SCRIPT) pcap-config $(DESTDIR)$(bindir)/pcap-config
|
|
for i in $(MAN1); do \
|
|
$(INSTALL_DATA) $(srcdir)/$$i \
|
|
$(DESTDIR)$(mandir)/man1/$$i; done
|
|
- for i in $(MAN3PCAP_NOEXPAND); do \
|
|
- $(INSTALL_DATA) $(srcdir)/$$i \
|
|
+ for i in $(MAN3PCAP_NOEXPAND:.3pcap=.3); do \
|
|
+ $(INSTALL_DATA) $(srcdir)/$${i}pcap \
|
|
$(DESTDIR)$(mandir)/man3/$$i; done
|
|
- for i in $(MAN3PCAP_EXPAND:.in=); do \
|
|
- $(INSTALL_DATA) $$i \
|
|
+ for i in $(MAN3PCAP_EXPAND:.3pcap.in=.3); do \
|
|
+ $(INSTALL_DATA) $${i}pcap \
|
|
$(DESTDIR)$(mandir)/man3/$$i; done
|
|
- (cd $(DESTDIR)$(mandir)/man3 && \
|
|
- rm -f pcap_datalink_val_to_description.3pcap && \
|
|
- $(LN_S) pcap_datalink_val_to_name.3pcap \
|
|
- pcap_datalink_val_to_description.3pcap && \
|
|
- rm -f pcap_dump_fopen.3pcap && \
|
|
- $(LN_S) pcap_dump_open.3pcap pcap_dump_fopen.3pcap && \
|
|
- rm -f pcap_freealldevs.3pcap && \
|
|
- $(LN_S) pcap_findalldevs.3pcap pcap_freealldevs.3pcap && \
|
|
- rm -f pcap_perror.3pcap && \
|
|
- $(LN_S) pcap_geterr.3pcap pcap_perror.3pcap && \
|
|
- rm -f pcap_sendpacket.3pcap && \
|
|
- $(LN_S) pcap_inject.3pcap pcap_sendpacket.3pcap && \
|
|
- rm -f pcap_free_datalinks.3pcap && \
|
|
- $(LN_S) pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap && \
|
|
- rm -f pcap_free_tstamp_types.3pcap && \
|
|
- $(LN_S) pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap && \
|
|
- rm -f pcap_dispatch.3pcap && \
|
|
- $(LN_S) pcap_loop.3pcap pcap_dispatch.3pcap && \
|
|
- rm -f pcap_minor_version.3pcap && \
|
|
- $(LN_S) pcap_major_version.3pcap pcap_minor_version.3pcap && \
|
|
- rm -f pcap_next.3pcap && \
|
|
- $(LN_S) pcap_next_ex.3pcap pcap_next.3pcap && \
|
|
- rm -f pcap_open_dead_with_tstamp_precision.3pcap && \
|
|
- $(LN_S) pcap_open_dead.3pcap \
|
|
- pcap_open_dead_with_tstamp_precision.3pcap && \
|
|
- rm -f pcap_open_offline_with_tstamp_precision.3pcap && \
|
|
- $(LN_S) pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap && \
|
|
- rm -f pcap_fopen_offline.3pcap && \
|
|
- $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline.3pcap && \
|
|
- rm -f pcap_fopen_offline_with_tstamp_precision.3pcap && \
|
|
- $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap && \
|
|
- rm -f pcap_tstamp_type_val_to_description.3pcap && \
|
|
- $(LN_S) pcap_tstamp_type_val_to_name.3pcap pcap_tstamp_type_val_to_description.3pcap && \
|
|
- rm -f pcap_getnonblock.3pcap && \
|
|
- $(LN_S) pcap_setnonblock.3pcap pcap_getnonblock.3pcap)
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_perror.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_inject.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_list_tstamp_types.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_loop.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_dispatch.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_minor_version.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_next.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_open_dead_with_tstamp_precision.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_open_dead.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_open_dead_with_tstamp_precision.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_open_offline_with_tstamp_precision.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_open_offline_with_tstamp_precision.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline_with_tstamp_precision.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_fopen_offline_with_tstamp_precision.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_tstamp_type_val_to_description.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_tstamp_type_val_to_name.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_tstamp_type_val_to_description.3
|
|
+ rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3
|
|
+ ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3 \
|
|
+ $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3
|
|
for i in $(MANFILE); do \
|
|
$(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \
|
|
$(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
|
|
@@ -656,15 +672,15 @@
|
|
install-shared-none:
|
|
|
|
install-archive: install-archive-$(DYEXT)
|
|
-install-archive-so install-archive-dylib install-archive-sl install-archive-none: libpcap.a
|
|
+install-archive-so install-archive-dylib install-archive-sl install-archive-none: libpcap.la
|
|
#
|
|
# Most platforms have separate suffixes for shared and
|
|
# archive libraries, so we install both.
|
|
#
|
|
[ -d $(DESTDIR)$(libdir) ] || \
|
|
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
|
|
- $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
|
|
- $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
|
|
+ $(INSTALL_DATA) libpcap.la $(DESTDIR)$(libdir)/libpcap.la
|
|
+ $(RANLIB) $(DESTDIR)$(libdir)/libpcap.la
|
|
install-archive-shareda:
|
|
#
|
|
# AIX, however, doesn't, so we don't install the archive
|
|
@@ -672,7 +688,7 @@
|
|
#
|
|
|
|
uninstall: uninstall-shared
|
|
- rm -f $(DESTDIR)$(libdir)/libpcap.a
|
|
+ rm -f $(DESTDIR)$(libdir)/libpcap.la
|
|
for i in $(PUBHDR); do \
|
|
rm -f $(DESTDIR)$(includedir)/$$i; done
|
|
-rmdir $(DESTDIR)$(includedir)/pcap
|
|
@@ -720,7 +736,7 @@
|
|
rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER; \
|
|
rm -f $(DESTDIR)$(libdir)/libpcap.sl
|
|
uninstall-shared-shareda:
|
|
- rm -f $(DESTDIR)$(libdir)/libpcap.a
|
|
+ rm -f $(DESTDIR)$(libdir)/libpcap.la
|
|
uninstall-shared-none:
|
|
|
|
clean:
|