Commit Graph

164 Commits

Author SHA1 Message Date
Guy Harris
318ecd24c5 Check for extra networking libraries before checking for IPv6.
On some platforms, such as SunOS 5.x, building the "do we have IPv6
support?" test program requires the extra networking libraries, so we
need to know what extra networking libraries are required before doing
that test.
2013-04-06 13:03:58 -07:00
Marc Abramowitz
c4b7e5f2b2 Simplify the detection of OpenSSL libcrypto by using standard autoconf
macros rather than a local copy of AC_LBL_SSLEAY.

AC_LBL_SSLEAY is old and has not kept pace with some more recent
developments in packaging like Debian and Ubuntu's multiarch support.
The autoconf macros have been updated to handle multiarch so using them
means that tcpdump gains the ability to be built with libcrypto on these
new multiarch distros and to work successfully with Travis CI, which
uses Ubuntu 12, which is one such multiarch distro (see GH-32).

Fixes GH-33
2012-10-13 11:21:45 -07:00
Guy Harris
02efb7bdd0 Fix the other typo, so setting CPPFLAGS in the environment works correctly.
Based-On-Patch-From: Simon Ruderich <simon@ruderich.org>
2012-03-05 08:12:32 -08:00
Guy Harris
29c908c198 Fix typo, so setting CPPFLAGS in the environment works correctly.
Based-On-Patch-From: Simon Ruderich <simon@ruderich.org>
2012-03-03 13:36:17 -08:00
Guy Harris
2886b89df6 Back out DLT_PFSYNC support.
Unfortunately, the DLT_PFSYNC support depends on header files included
from the pfctl command's source tree, and trying to arrange to find that
would be too much trouble.
2012-02-29 21:14:50 -08:00
Guy Harris
0d2d222ffb Add DLT_PFSYNC support.
From FreeBSD PR bin/124825: tcpdump(8) does not support pfsync(4) data,
which in turn was ported over from OpenBSD.  We already have CARP
support, so we did not port that part over.
2012-02-29 01:51:27 -08:00
Guy Harris
9daf436721 Handle systems with getrpcbynumber() but no header file for it.
Glibc 2.14 doesn't install the ONC RPC headers, but it installs the ONC
RPC routines, presumably for binary compatibility.  Don't use
getrpcbynumber() unless we have it *and* the header file to declare it.
2011-09-02 21:31:09 -07:00
Guy Harris
79f94f4c12 Don't compile print-babel.c if we don't have IPv6 support. 2011-08-14 16:26:32 -07:00
Guy Harris
8a52e408e9 Include <tcpdump-stdinc.h> when checking for headers.
Now that we're setting V_INCLS correctly, we don't need to include
"tcpdump-stdinc.h" - including <tcpdump-stdinc.h> works.

This also picks up configure changes from the previous configure.in
change.
2011-04-04 12:07:11 -07:00
Guy Harris
539ef30544 Properly define {u_}intN_t types when testing pcap/*.h headers.
pcap/bluetooth.h and pcap/usb.h require those types, so we check for
those types before checking those headers, and we include
"tcpdump-stdinc.h" in the tests, so the appropriate headers to define
those types get pulled in.
2011-04-04 12:02:02 -07:00
Guy Harris
f0296bc39c Expand srcdir in V_INCLS at configure time, not make time.
That way, if we temporarily set CPPFLAGS to include V_INCLS, it'll work
correctly.
2011-04-04 11:49:41 -07:00
Guy Harris
6a5c81baf7 Fix one place where we didn't save and restore CPPFLAGS when modifying it. 2011-04-04 11:34:14 -07:00
Guy Harris
e6933ca143 Check for uudecode at make time by uudecoding a uuencoded empty file.
Doing it at make time means you don't have to re-run the configure
script if you add uudecode to your system, and doing it by uudecoding a
uuencoded empty file means we don't depend on uudecode supporting
"--help".
2011-04-04 00:44:41 -07:00
Guy Harris
1aaedce9e7 Don't assume uudecode supports a --help option; not all uudecodes do.
Instead, check for uudecode in the configure script, and set the
CHECK_UUDECODE configuration variable to "true" if we find it and to a
command that prints an error message and exits with 1 if we don't find
it, and substitute that variable into the Makefile as the first command
for "make check".
2011-04-03 15:43:21 -07:00
Guy Harris
687b442022 Get rid of unnecessary configure script tests and missing/XXX.h headers.
This also fixes configure-script problems on OSes that have IPv6 support
but don't have <netinet6/in6.h> - no standard I could find requires that
header for IPv6 support (the Single UNIX Specification speaks of
<netinet/in.h> for both IPv4 and IPv6, and RFCs 2292 and 3542 don't
mention <netinet6/in6.h>, just <netinet/in.h> and <netinet6/ip6.h>).
2011-02-01 02:08:41 -08:00
Guy Harris
d8252d0c05 Add support for nommu systems.
Rather than hardcode the WIN32 define, add proper fork checks to the
configure script and check those.  This fixes building for nommu systems
which lack the fork function.

While we're here though, add support for this functionality via vfork
so that it does work on nommu systems.  And fix an old bug where we
exit properly in the forked child when the exec failed instead of just
returning to the calling code (which isn't expecting it).

Reviewed-By: Guy Harris <guy@alum.mit.edu>
2010-11-30 16:18:32 -08:00
Guy Harris
a20a6126fc Add support for setting the time stamp type for a capture.
Based on a patch from Scott Mcmillan <scott.a.mcmillan@intel.com>.

While we're at it, make some error messages a bit less geeky.
2010-08-22 17:32:26 -07:00
Guy Harris
e97d5ed3c2 Add a comment to the AC_DEFINE for _SUN, matching what we do in libpcap. 2010-04-16 03:31:33 -07:00
Guy Harris
8db70a1a1b Build fat appropriately for Leopard. 2010-04-06 15:10:31 -07:00
Guy Harris
9b2d37151d Don't define any of the SIZEOF_ values. 2010-04-04 13:41:27 -07:00
Guy Harris
103de367dc Fix check for Snow Leopard.
For OS X version 10.{x}.{y}, Darwin is (at least for later versions)
version {x+4}.{y}.
2010-04-04 12:42:00 -07:00
Guy Harris
c1b245043f Build universal on OS X by default; add an option to disable that.
Instead of requiring the user to specify -arch options on OS X to build
a universal version of tcpdump, just default to universal on OS X by
default.  Pick the particular targets to match the way tcpdump is built
for the OS for which we're building.
2010-04-04 12:08:11 -07:00
Peter Volkov
9aca99aa40 Respect --without-chroot correctly
./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.
2010-04-01 22:55:22 -07:00
Guy Harris
f7b185510a Add a --with-arch-flags configuration option to specify target architectures.
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.
2010-03-31 17:24:33 -07:00
Guy Harris
ebc9a33b11 Fix some problems that show up in autoconf 2.64 and later. 2010-01-02 15:29:06 -08:00
Guy Harris
ce952c7dc4 Get rid of some autoconf macros not used, or no longer used, with
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.
2009-07-08 01:22:27 -07:00
Guy Harris
2a5fc2e1fc Copy a comment from the libpcap configure.in. 2009-07-02 19:49:53 -07:00
Guy Harris
2425b023c1 Use <sys/bitypes.h> in all tests for types. 2009-06-29 00:58:33 -07:00
Guy Harris
97b52f9f3f Don't put -L/usr/lib into LDFLAGS - it would cause linking with -lpcap,
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".)
2009-06-07 18:19:59 -07:00
Guy Harris
2c28d8f466 From Bert Vermeulen: add a USB printer, and fix the error message
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.)
2009-04-04 12:30:27 -07:00
guy
a28495afd3 Propagate from the git tree:
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.
2008-11-18 07:39:20 +00:00
guy
3565ec111d Run the tcpdump man page through config, so that it refers to the right
man page sections.  Have it refer to the new pcap-savefile man page for
a description of the savefile format.
2008-10-27 21:12:48 +00:00
guy
2fa88fe1a3 We support building tcpdump with versions of libpcap other than the one
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.
2008-09-25 21:45:50 +00:00
guy
bca64a2755 Use the new libpcap API's if available; that means we can support "-B"
on all platforms in that case.  Also, add a "-I" flag to turn on monitor
mode.
2008-04-04 19:42:11 +00:00
guy
eb65de093f From Sagun Shakya: check whether we need libdlpi. 2008-03-13 18:32:51 +00:00
guy
5d375b6ca0 Have --with-crypto take an optional argument, specifying where libcrypto
can be found.  If --with-crypto is specified, and libcrypto isn't found,
fail, as presumably the user expected libcrypto to be available.
2008-02-26 20:47:12 +00:00
guy
0fe13260f1 The string-comparison operator in the "test" command is "=", not "==". 2008-02-05 18:58:19 +00:00
guy
cfab7ed87f Run ranlib on libnetdissect.a if necessary. Remove it before building
it, so we discard any stuff already in the archive.
2008-02-04 20:33:21 +00:00
guy
7e5e89df69 From Max Laier: check whether the system has <net/pfvar.h> and:
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.
2007-09-12 19:36:18 +00:00
guy
385cd8601b From David Smith: let the path for the crypto headers and libraries be
set explicitly by setting Xprefix as an environment variable, for use
when cross-compiling.
2005-09-21 16:47:59 +00:00
guy
d0f903c65d Split a line to match the way it's split in libpcap's configure.in. 2005-04-24 01:34:59 +00:00
guy
505ddaca27 Albert Chin's patch to libpcap's configure.in:
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.
2005-04-24 01:25:23 +00:00
guy
d26090f659 Put back AC_LBL_C_INLINE; it turns out that wasn't the cause of the
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.
2005-04-21 02:21:47 +00:00
guy
794a52c42c Some systems (*cough*Irix*cough) not only don't declare
"ether_ntohost()" but don't even declare "struct ether_addr"; on those
systems, declare "struct ether_addr".
2005-04-20 11:17:18 +00:00
guy
caf503e482 From Albert Chin:
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.
2005-04-20 09:49:52 +00:00
guy
e1db53eeb7 From Albert Chin:
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.
2005-04-20 09:44:30 +00:00
guy
6198b3a089 Check for ether_ntohost() after checking for libpcap, so that we do so
after we've checked whether we need -lsocket -lnsl to get routines such
as ether_ntohost().
2005-03-27 23:16:08 +00:00
guy
a7f2c5e465 Don't check for netinet/ether.h unless we're going to use it. 2005-03-27 22:58:08 +00:00
guy
97f3ed0073 Fix an error in the previous checkin. 2005-03-27 22:46:21 +00:00
guy
969f75a107 Fix a typo.
Don't bother checking whether ether_ntohost() is declared if it exists
but is buggy so we won't be using it.
2005-03-27 22:44:22 +00:00