./configure --without-chroot will configure tcpdump with "no" as the
value of chroot directory and cause tcpdump to fail with:
tcpdump: Couldn't chroot/chdir to 'no': No such file or directory
This patch makes ./configure to avoid chroot directory when called with
--without-chroot.
They allow the user to specify flags to indicate the target
architecture(s) (yes, possibly plural - think, for example, Mac OS X)
for which we're building. Those might need to be used not only when
compiling, but also when linking and when building a shared library.
This is not for general cross-compiling, it's for use on platforms where
versions of the native OS support more than one instruction set and
where you want to build for the OS on which you're running but not for
the default build architecture on the machine on which you're running.
This may currently be less useful for tcpdump, as tcpdump currently
builds no libraries, but it's there for compatibility with libpcap.
tcpdump.
Check whether __attribute__((format)) can be applied to function
pointers and, if not, don't apply it to function pointers; some older
versions of GCC appear to support applying it to functions, but not
pointers to functions.
As we've gotten rid of missing/getaddrinfo.c, don't use it.
on a system that comes with libpcap, to link with the system libpcap
even if, say, you've installed a newer libpcap under /usr/local and its
pcap-config added -L/usr/local/lib to LDFLAGS, as the -L/usr/lib comes
earlier in LDFLAGS. (For "would", read "did, when I tried it".)
printed when trying to print packets for a DLT_ for which we don't have
a printer to indicate that you can still save to a capture file in that
case. (Slightly changed not to require DLT_USB_LINUX_MMAPPED to be
defined, for older libpcaps that only define DLT_USB_LINUX.)
Author: Peter Volkov <pva@gentoo.org>
Date: Sun Nov 9 20:33:27 2008 -0500
Currently it's impossible to build tcpdump without libsmi on system with
libsmi installed. The patch in attachment adds --with{,out}-smi
configure switch which allows to disable it.
with which it was released, and DLT_BLUETOOTH_HCI_H4_WITH_PHDR might be
defined by pcap-bpf.h without pcap/bluetooth.h being present (as appears
to be the case on Fedora 9, for example), so check whether
<pcap/bluetooth.h> is usable.
Update a comment - F9 appears to have a "/usr/include/pcap.h" if you
install the libpcap headers.
When adding -I flags when running a compiler-based test, add them to
CPPFLAGS, not CFLAGS - the latter doesn't work right with
AC_CHECK_HEADERS, as the "gcc -E" run doesn't have the -I flags added.
if it does, use that for the pf definitions;
if it doesn't, don't compile in pf support;
as both OpenBSD and FreeBSD have changed the pf definitions and header
format without changing the DLT value, so you can't reliably read
pflog-format libpcap files on a machine running an OS version other than
the one on which the file was generated.
AC_CHECK_DECLS will define the HAVE_DECL_xxx variable whether it
succeeds or fails, so you can't erase a "no" result and try
again with a different header. Use AC_CHECK_DECL, which doesn't
define HAVE_DECL_xxx, and then explicitly define it based on
whether we found a declaration or not.
is required for tcpdump's configure.in as well.
inline problem, and AC_LBL_C_INLINE checks for a case that some versions
of the HP C compiler don't handle, and only uses inline if that case
succeeds.
1. aclocal.m4 patch required by Tru64 UNIX which has
inttypes.h in a non-standard location so gcc cannot find
the PRI types. So, use <sys/bitypes.h> to get u_int#_t
types for help detecting %llx, etc.
2. Help gcc on aix find ether_ntohost declaration.
1. On AIX, AC_LBL_C_INLINE detected the compiler supported
the inline keyword which is wrong. AC_C_INLINE from
autoconf-2.59 worked.
2. AC_CHECK_TYPE from autoconf-2.5x is no longer broken.
Replaced AC_LBL_CHECK_TYPE with it, mainly to use
<sys/bitypes.h> for Tru64 UNIX where some of the u_int#_t
types are defined.
3. Tru64 UNIX 4.0D doesn't support %llx; however, it does support %lx.
4. Added <stdint.h> to interface.h for int#_t types on
Tru64 UNIX 4.0D (required for missing/snprintf.c).
5. Reworked includes in tcpdump-stdinc.h for int#_t types.
do in libpcap for ether_hostton(). Include <netinet/ether.h> only if it
declares ether_ntohost(). If nothing declares it, declare it ourselves,
as we do in libpcap.
Don't cast the second argument to ether_ntohost() to a const pointer, as
some systems don't modify it but don't declare that argument as a const
pointer. (This is similar to what we do on libpvap for
ether_hostton().)
Fix indentation.
the wire; the definitions in many systems use u_long, which is 64 bits
long on many platforms - that's OK for in-memory structures, but it
doesn't match what's on the wire. Use headers based on the Sun ones,
but use u_int32_t for fields, and otherwise make the structures match
what's on the wire, and change some names to avoid collision with
<rpc/rpc.h>, which print-sunrpc.c includes to declare "getrpcbynumber()"
and the structure it returns.
Record whether "getrpcbynumber()" is found, and use it only if it's
found, rather than basing the decisison on whether we're building for
Win32 or not.
"pcap_version", "pcap_debug", and "yydebug", don't add our own functions
referring to those variables - GCC 3.4.1 optimizes the test code out
before the link is done, as it's in a function that's not called.
causes the configure script to attempt to define the PRI[doux]64 macros
if they're not defined by including <inttypes.h>, and causes
"missing/bittypes.h" to attempt to define them, if undefined, in a
fashion that should, with any luck, work on MSVC++ and various flavors
of GNU C on Windows.
Fix the spelling of "Mac OS X".
causes "int64_t" and "u_int64_t" to be defined by the configure script,
and causes "missing/bittypes.h" to attempt to define "u_int64_t" in a
fashion that should, with any luck, work on MSVC++ and various flavors
of GNU C on Windows.
error.
Check for pcap_if_t in <pcap.h> if we have pcap_findalldevs; MacOS X
10.3.3 ships a newer libpcap which has pcap_findalldevs but an older
pcap.h which doesn't have a pcap_if_t.
When saving to a file with "-w", have the "-v" flag make tcpdump
report, every 10 seconds, the number of packets captured.
Include <smi.h> if we're building with libsmi, to declare
"smiInit()" and "smiLoadModule()".
modify it.
AC_LIBOBJ isn't supported by pre-2.50 autoconf; require 2.50.
2.5x apparently does quoting, or dnl, or something differently from
2.13; fix AC_EGREP_CPP calls.
propagate CPPFLAGS to Makefile.in;
move the CPPFLAGS and V_INCLS change to the end of the configure
run so users don't see "-I$(srcdir)/missing" in their config.log
output.
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".
Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
inet_ntop/inet_pton/inet_aton, and don't use AC_REPLACE_FUNCS to set
LIBOBJS to include the replacement module, as that does the full check
for the routine again, not just the simple replacement.
Move the tests in question after AC_LBL_LIBPCAP, so that we link with
the appropriate libraries (e.g., "-lsocket -lnsl" on Solaris) to use
when using those routines.