Commit Graph

222 Commits

Author SHA1 Message Date
Guy Harris
b485483022 Use the new libpcap <pcap/nflog.h> for NFLOG definitions and declarations.
Use the header file for information about LINKTYPE_NFLOG files.

Don't build the NFLOG printer if we don't have that header file.

Fix some checks for pcap/XXX.h header files to look for
"tcpdump-stdinc.h" rather than <tcpdump-stdinc.h>, so that we don't fail
to find that header.
2014-02-02 20:14:26 -08:00
Guy Harris
5f357be7ac Check for compiling for IPv6; don't check whether we can create an IPv6 socket.
Don't check whether we can create a TCP-over-IPv6 socket; that appears
to fail in some cases where tcpdump can be built with IPv6 support.
Instead, just check whether AF_INET6 and struct in6_addr are defined.
2014-01-17 14:08:39 -08:00
Guy Harris
5cb460bef8 We're not using struct sockaddr_storage any more, so don't check for it. 2014-01-17 12:49:49 -08:00
Guy Harris
3b149607b9 Use AC_CHECK_TOOL to find ar.
On some platforms, such as at least some versions of HP-UX, AR isn't
automatically set by make.
2014-01-16 14:40:46 -08:00
Guy Harris
3b720a31d7 Add -g3 on some platforms even if .devel isn't present.
Now that we're requiring autoconf 2.61 or later, AC_PROG_CC sets -g
along with -O2 for GCC-like compilers regardless of whether .devel is
present.  Add "include debugging symbols" options for MIPS C/DEC C
regardless of whether .devel is present; that's -g3, which is the
version that doesn't turn optimization off (we also turn on -O).

Also, don't change the ABI on IRIX depending on .devel.

I'm not sure why we were doing that; if somebody has a good reason to
continue doing it, please let us know what it is.

Expand some comments while we're at it.
2013-10-21 10:56:33 -07:00
Guy Harris
ecb87d847b Explain why we set -xansi -signed for MIPS C. 2013-10-17 22:14:53 -07:00
Guy Harris
776ef2baf6 We no longer use the GCC version, so don't fetch it.
Fix some indentation while we're at it.
2013-10-17 19:33:18 -07:00
Guy Harris
d6bfd142e9 With .devel, add -g3 for MIPS C and DEC C.
Lifted from the libpcap configure script, which adds -g even without
.devel, presumably so that programs linked with libpcap can get
debugging symbols.

Those compilers are for dead OSes (IRIX, Tru64 UNIX); we should probably
do whatever voodoo is needed to get Sun^WOracle C, IBM's C compiler for
AIX, and HP C to build optimized with debug symbols.
2013-10-17 17:20:49 -07:00
Guy Harris
e462b975e2 Clean up handling of -g and -O flags.
AC_PROG_CC adds -g and -O2 to CFLAGS if you're using GCC; don't bother
adding either of them, or -O, ourselves if we're using GCC.

Add -O for all non-GCC compilers.
2013-10-17 16:50:43 -07:00
Guy Harris
a6c16ed8ab Fix build issues with the OpenFlow printer on some systems.
Don't assume we have <stdint.h>.  Instead, use the AC_TYPE_ macros to
ensure we have the C99 intN_t and uintN_t types; we already include
<inttypes.h> in tcpdump-stdinc.h iff we have it.

Get rid of the structure declarations in openflow-1.0.h, as they have
zero-length arrays (not supported by all the compilers people might be
using) and as

	1) they're only used in sizeof()

and

	2) after each one there's an assertion to check that sizeof()
returns a specific numerical value

so, instead, just #define various _LEN items to those numerical values
and use them.

Add an openflow.h header with a #define for the length of the basic
header, and move the declaration of of10_header_body_print() there.
2013-06-23 14:03:38 -07:00
Guy Harris
94bf5a24bf Avoid some warnings from Sun C.
Some versions of Sun C support __attribute__ but don't support the
"unused" or "format" attributes - they don't fail, but they whine a lot.
They also support the "noreturn" attribute, but don't allow it to be
applied to function pointers, only to functions.

Check whether they can be used without warnings, and use them only if
they can.
2013-06-22 14:06:33 -07:00
Guy Harris
04aa650dc3 AC_SUBST doesn't take a list of macros to substitute. 2013-05-12 16:37:47 -07:00
Guy Harris
c52f2fa7a0 Update a comment. 2013-05-12 16:10:09 -07:00
Guy Harris
a332503d7d Get rid of acconfig.h. 2013-05-12 15:28:28 -07:00
Guy Harris
c2269364b1 Git produces no useful revision information; don't use AC_REVISION(). 2013-05-12 13:37:19 -07:00
Guy Harris
985ad5e359 Require autoconf 2.61 as a minimum, and eliminate stuff that does for you.
autoconf 2.61 and later do, in AC_PROG_CC, tests to figure out how to
beat non-GCC compilers into doing the closest thing to ANSI C of which
they're capable, so we don't need to do them ourselves.
2013-05-12 12:35:43 -07:00
Guy Harris
60f8354159 HP C isn't the only compiler on which we must avoid GCC-style -W flags.
MIPS C and DEC C also can't be made to reliably Just Say No to those
flags, and they don't support those flags, so don't try them with those
compilers either.
2013-05-12 12:30:01 -07:00
Guy Harris
122e1529b7 Support dependency generation with some non-GCC compilers.
Also, if we don't support it with a given compiler, have "make depend"
not run mkdep, as it won't do anything useful.
2013-05-08 00:08:12 -07:00
Guy Harris
b2fd5f862c Get rid of extra blank line. 2013-05-08 00:02:15 -07:00
Guy Harris
e6ffaf8395 Don't try -W flags with HP's C compiler.
HP's C compiler cannot be made to exit with a non-zero exit status when
given an unknown compiler flag, so you can't use that to figure out if a
flag is supported, but it *will* print a warning, which we don't want.

In addition, it doesn't support -W flags for warnings in any case, so
let's not bother with them.
2013-05-07 23:58:51 -07:00
Guy Harris
7d0510cec8 With .devel, use -W flags iff the compiler supports them.
Don't base the question of whether to use a particular -W flag on
whether we're compiling with GCC or not, and on which version of GCC
we're using; some compilers, such as clang, also support many of those
-W flags.  Base it on whether the compiler complains if we use it (which
means, for clang, that we have to force it to exit with a non-zero exit
status if it doesn't like a flag; otherwise, we'll specify it, and clang
will warn about it on every compile).
2013-05-06 23:54:20 -07:00
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
a02d547a6f Ask for the libpcap Makefile while we're at it.
...so that we can see what's being used to turn grammar.y into
grammar.c.

While we're at it, say "config.log file from the libpcap source
directory", in the hopes of making it more likely that we'll get it in
addition to the tcpdump config.log.
2012-03-03 16:10:42 -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
e2b98d2cc6 Ask for more information if we don't find pcap_loop.
I give up.

People keep reporting that the configure process for tcpdump fails to
find pcap_loop, and the config.log file they send us says there's no
pcap_parse in libpcap, which suggests that something went wrong in the
build process for libpcap; perhaps they don't have Bison and the
configure script got confused and failed to cause the parser to be named
"pcap_parse", or something such as that, or perhaps Bison was recently
"improved" in a fashion that breaks that, but I've never been able to
reproduce this on any of the Linux distribution installations to which
*I* have access.

I therefore ask them to send the config.log output and make output for
libpcap; *not one of the reporters of this problem* has bothered to send
that information, so we're stuck.  Perhaps they don't care enough (in
which case, why did they bother asking us about it?), or perhaps they're
annoyed that we asked them a further question rather than Just Fixing
The Problem(TM) (in which case, all I have to say is "welcome to the
Wonderful World Of Computer Software(TM) - get used to it").

So let's just ask for all that information.  (I would not be surprised
if this doesn't suffice and that they *still* just send us the tcpdump
config.log output, but at least I'll be able to tell them that they
should have Read The Fine Error Message(TM).)
2012-03-03 13:32:11 -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
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
f663403419 And another quoting of AC_LANG_SOURCE. 2011-02-01 15:04:00 -08:00
Guy Harris
6d9c7f9ae0 Put the call to AC_LANG_SOURCE in AC_C___ATTRIBUTE__ in quotes.
That's what they do in the autoconf manual; perhaps it'll squelch some
warnings I'm seeing on NetBSD 5.1 with autoconf 2.68.
2011-02-01 14:59:53 -08: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
aa0cc41863 Fix e-mail address for tcpdump-workers.
Thanks to Cameron Elliott for pointing out that the address hadn't been
updated.
2011-01-27 11:09:28 -08:00
Guy Harris
7254c152b3 Point people to the autoconf documentation on shell substitution.
Hopefully this will keep people from sending "helpful" patches that
break things.
2011-01-23 15:07:01 -08:00
Guy Harris
869efa23a3 Handle POSIX quoting rules.
See section 11.6 "Shell Substitutions" in the autoconf documentation,
especially the

	There is just no portable way to use double-quoted strings
	inside double-quoted back-quoted expressions (pfew!).

part.
2011-01-23 13:35:31 -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
Mike Frysinger
316d5087cc Use AC_PATH_TOOL, not AC_PATH_PROG, to find pcap-config.
The PROG variant does not take into consideration cross-compilation, so
it always looks for "pcap-config" which finds the host script.  So use
the TOOL variant instead which first searches for the cross-prefixed
pcap-config before falling back to the bare "pcap-config".

Reviewed-By: Guy Harris <guy@alum.mit.edu>
2010-11-30 16:13:05 -08:00
Guy Harris
71894d1a62 Make sure we can link with libpcap.
After finding libpcap and getting a list of other flags needed when
linking, we check for "pcap_loop()", to make sure we found a working
libpcap and have all the right other libraries with which dnl to link.
(Otherwise, for example, the check for pcap_list_datalinks() will fail,
not because the routines are missing from the library, but because we
aren't linking properly with libpcap, and that will cause confusing
errors at build time.)
2010-11-14 12:23:40 -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