On Tue, 2 Jan 2001, Guy Harris wrote:
> On Mon, Jan 01, 2001 at 02:00:53AM +0200, Pekka Savola wrote:
> > I used the following patch to get rid of snprintf.o.
>
> Checked in.
>
> Am I missing something, or are we failing to check for "snprintf()" in
> the libpcap configure script? The libpcap "Makefile.in" will build
> "snprintf.o" from "../tcpdump/missing/snprintf.c", but I don't see any
> place where "snprintf.o" is put into the libpcap library.
Yes. The check is missing. I guess everybody has had snprintf for a
while..
Anyway, here's a patch for that. snprintf.c includes tcpdump/interface.h
so an include path must be added in makefile.in there.
--
Pekka Savola "Tell me of difficulties surmounted,
Netcore Oy not those you stumble over and fall"
Systems. Networks. Security. -- Robert Jordan: A Crown of Swords
diff -uNr libpcap/Makefile.in libpcap.fix/Makefile.in
--- libpcap/Makefile.in Sat Dec 23 22:06:15 2000
+++ libpcap.fix/Makefile.in Wed Jan 3 01:45:24 2001
@@ -79,7 +79,7 @@
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
# hack the extra indirection
-OBJ = $(PSRC:.c=.o) $(CSRC:.c=.o) $(GENSRC:.c=.o) # $(LIBOBJS)
+OBJ = $(PSRC:.c=.o) $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
ethertype.h gencode.h gnuc.h
GENHDR = \
@@ -122,7 +122,7 @@
$(CC) $(CFLAGS) -c version.c
snprintf.o: $(srcdir)/../tcpdump/missing/snprintf.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/../tcpdump/missing/snprintf.c
+ $(CC) $(CFLAGS) -o $@ -c $(srcdir)/../tcpdump/missing/snprintf.c
+-I$(srcdir)/../tcpdump
version.c: $(srcdir)/VERSION
@rm -f $@
diff -uNr libpcap/configure.in libpcap.fix/configure.in
--- libpcap/configure.in Thu Dec 21 12:29:22 2000
+++ libpcap.fix/configure.in Wed Jan 3 01:47:21 2001
@@ -31,6 +31,13 @@
AC_CHECK_FUNCS(ether_hostton strerror freeifaddrs strlcpy)
+needsnprintf=no
+AC_CHECK_FUNCS(vsnprintf snprintf ,,
+ [needsnprintf=yes])
+if test $needsnprintf = yes; then
+ LIBOBJS="$LIBOBJS snprintf.o"
+fi
+
dnl to pacify those who hate protochain insn
AC_MSG_CHECKING(if --disable-protochain option is specified)
AC_ARG_ENABLE(protochain, [ --disable-protochain disable \"protochain\" insn])
@@ -220,6 +227,7 @@
AC_SUBST(V_PCAP)
AC_SUBST(V_RANLIB)
AC_SUBST(V_YACC)
+AC_SUBST(LIBOBJS)
AC_PROG_INSTALL