aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2015-01-06 19:03:11 +0000
committerXin LI <delphij@FreeBSD.org>2015-01-06 19:03:11 +0000
commite91eac244982a8728f370000c353b16e18174ec9 (patch)
treeb0af675e15d65cc0adac2367c37233a794389c9a /configure.in
parent05b21c9adf4d7f1b7b616a703b98e4df42633c9f (diff)
downloadsrc-e91eac244982a8728f370000c353b16e18174ec9.tar.gz
src-e91eac244982a8728f370000c353b16e18174ec9.zip
Vendor import of tcpdump 4.6.2.vendor/tcpdump/4.6.2
Notes
Notes: svn path=/vendor/tcpdump/dist/; revision=276761 svn path=/vendor/tcpdump/4.6.2/; revision=276762; tag=vendor/tcpdump/4.6.2
Diffstat (limited to 'configure.in')
-rwxr-xr-xconfigure.in309
1 files changed, 166 insertions, 143 deletions
diff --git a/configure.in b/configure.in
index 14a60e185e31..5d0f771b3753 100755
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,3 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.204 2008-11-18 07:39:20 guy Exp $ (LBL)
-dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
dnl
@@ -15,20 +13,25 @@ dnl
# config.sub.
#
-AC_REVISION($Revision: 1.204 $)
-AC_PREREQ(2.50)
+AC_PREREQ(2.61)
AC_INIT(tcpdump.c)
AC_CANONICAL_HOST
-AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
+AC_LBL_C_INIT_BEFORE_CC(V_INCLS)
AC_PROG_CC
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_LBL_C_INLINE
AC_C___ATTRIBUTE__
if test "$ac_cv___attribute__" = "yes"; then
- AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
+ AC_C___ATTRIBUTE___UNUSED
+ AC_C___ATTRIBUTE___NORETURN_FUNCTION_POINTER
+ AC_C___ATTRIBUTE___FORMAT
+ if test "$ac_cv___attribute___format" = "yes"; then
+ AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
+ fi
fi
+
AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
#include <sys/socket.h>
@@ -86,28 +89,6 @@ darwin*)
esac
fi
;;
-
-linux*)
- AC_MSG_CHECKING(Linux kernel version)
- if test "$cross_compiling" = yes; then
- AC_CACHE_VAL(ac_cv_linux_vers,
- ac_cv_linux_vers=unknown)
- else
- AC_CACHE_VAL(ac_cv_linux_vers,
- ac_cv_linux_vers=`uname -r 2>&1 | \
- sed -n -e '$s/.* //' -e '$s/\..*//p'`)
- fi
- AC_MSG_RESULT($ac_cv_linux_vers)
- if test $ac_cv_linux_vers = unknown ; then
- AC_MSG_ERROR(cannot determine linux version when cross-compiling)
- fi
- if test $ac_cv_linux_vers -lt 2 ; then
- AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
- fi
- ;;
-
-*)
- ;;
esac
@@ -117,18 +98,28 @@ AC_ARG_WITH(smi,
with_smi=yes)
if test "x$with_smi" != "xno" ; then
-AC_CHECK_HEADERS(smi.h)
-AC_CHECK_LIB(smi, smiInit)
-if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
-then
-AC_MSG_CHECKING([whether to enable libsmi])
- AC_TRY_RUN([ /* libsmi available check */
+ AC_CHECK_HEADER(smi.h,
+ [
+ #
+ # OK, we found smi.h. Do we have libsmi with smiInit?
+ #
+ AC_CHECK_LIB(smi, smiInit,
+ [
+ #
+ # OK, we have libsmi with smiInit. Can we use it?
+ #
+ AC_MSG_CHECKING([whether to enable libsmi])
+ savedlibs="$LIBS"
+ LIBS="-lsmi $LIBS"
+ AC_TRY_RUN(
+ [
+/* libsmi available check */
#include <smi.h>
main()
{
int current, revision, age, n;
const int required = 2;
- if (smiInit(""))
+ if (smiInit(""))
exit(1);
if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
exit(2);
@@ -139,25 +130,35 @@ main()
exit(4);
exit(0);
}
-],
-[ AC_MSG_RESULT(yes)
- AC_DEFINE(LIBSMI)
- libsmi=yes],
-dnl autoconf documentation says that $? contains the exit value.
-dnl reality is that it does not. We leave this in just in case
-dnl autoconf ever comes back to match the documentation.
-[ case $? in
- 1) AC_MSG_RESULT(no - smiInit failed) ;;
- 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
- 3) AC_MSG_RESULT(no - can't determine library version) ;;
- 4) AC_MSG_RESULT(no - too old) ;;
- *) AC_MSG_RESULT(no) ;;
- esac
- libsmi=no],
-[ AC_MSG_RESULT(not when cross-compiling)
- libsmi=no]
-)
-fi
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(USE_LIBSMI, 1,
+ [Define if you enable support for libsmi])
+ ],
+ [
+ dnl autoconf documentation says that
+ dnl $? contains the exit value.
+ dnl reality is that it does not.
+ dnl We leave this in just in case
+ dnl autoconf ever comes back to
+ dnl match the documentation.
+ case $? in
+ 1) AC_MSG_RESULT(no - smiInit failed) ;;
+ 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
+ 3) AC_MSG_RESULT(no - can't determine library version) ;;
+ 4) AC_MSG_RESULT(no - too old) ;;
+ *) AC_MSG_RESULT(no) ;;
+ esac
+ LIBS="$savedlibs"
+ ],
+ [
+ AC_MSG_RESULT(not when cross-compiling)
+ LIBS="$savedlibs"
+ ]
+ )
+ ])
+ ])
fi
AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
@@ -168,7 +169,8 @@ AC_ARG_ENABLE(smb,
case "$enableval" in
yes) AC_MSG_RESULT(yes)
AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
- AC_DEFINE(TCPDUMP_DO_SMB)
+ AC_DEFINE(TCPDUMP_DO_SMB, 1,
+ [define if you want to build the possibly-buggy SMB printer])
LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
;;
*) AC_MSG_RESULT(no)
@@ -178,7 +180,8 @@ esac
AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
AC_MSG_CHECKING([whether to drop root privileges by default])
if test ! -z "$with_user" ; then
- AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
+ AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
+ [define if should drop privileges by default])
AC_MSG_RESULT(to \"$withval\")
else
AC_MSG_RESULT(no)
@@ -187,12 +190,41 @@ fi
AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
AC_MSG_CHECKING([whether to chroot])
if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
- AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
+ AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
+ [define if should chroot when dropping privileges])
AC_MSG_RESULT(to \"$withval\")
else
AC_MSG_RESULT(no)
fi
+AC_ARG_WITH(sandbox-capsicum, [ --with-sandbox-capsicum ])
+#
+# Check whether various functions are available. If any are, set
+# ac_lbl_capsicum_function_seen to yes; if any are not, set
+# ac_lbl_capsicum_function_not_seen to yes.
+#
+# All of them must be available in order to enable capsicum sandboxing.
+#
+if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
+ AC_CHECK_FUNCS(cap_enter cap_rights_init cap_rights_limit cap_ioctls_limit openat,
+ ac_lbl_capsicum_function_seen=yes,
+ ac_lbl_capsicum_function_not_seen=yes)
+fi
+AC_MSG_CHECKING([whether to sandbox using capsicum])
+if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then
+ AC_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+#
+# We must check this before checking whether to enable IPv6, because,
+# on some platforms (such as SunOS 5.x), the test program requires
+# the extra networking libraries.
+#
+AC_LBL_LIBRARY_NET
+
AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 enable ipv6 (with ipv4) support
@@ -200,7 +232,7 @@ AC_ARG_ENABLE(ipv6,
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
- AC_DEFINE(INET6)
+ AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
ipv6=yes
;;
*)
@@ -209,20 +241,27 @@ yes) AC_MSG_RESULT(yes)
;;
esac ],
- AC_TRY_RUN([ /* AF_INET6 available check */
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_SOURCE(
+ [[/* AF_INET6 available check */
#include <sys/types.h>
#include <sys/socket.h>
-main()
+#include <netinet/in.h>
+#ifdef AF_INET6
+void
+foo(struct in6_addr *addr)
{
- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
- exit(1);
- else
- exit(0);
+ memset(addr, 0, sizeof (struct in6_addr));
}
-],
+#else
+#error "AF_INET6 not defined"
+#endif
+ ]])
+ ],
[ AC_MSG_RESULT(yes)
LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
- AC_DEFINE(INET6)
+ AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
ipv6=yes],
[ AC_MSG_RESULT(no)
ipv6=no],
@@ -491,7 +530,8 @@ AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
- AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
+ AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA, 1,
+ [define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>])
fi
dnl
@@ -515,14 +555,7 @@ if test "$ac_cv_namereqd" = no; then
missing_includes=yes
fi
-dnl
-dnl Checks for sockaddr_storage structure
-AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
-if test "$ac_cv_sa_storage" = no; then
- missing_includes=yes
-fi
-
-AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
+AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep getopt_long)
AC_CHECK_FUNCS(fork vfork strftime)
AC_CHECK_FUNCS(setlinebuf alarm)
@@ -535,12 +568,14 @@ fi
AC_LBL_TYPE_SIGNAL
-AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
+AC_SEARCH_LIBS(dnet_htoa, dnet,
+ AC_DEFINE(HAVE_DNET_HTOA, 1, [define if you have the dnet_htoa function]))
AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
dnl Some platforms may need -lnsl for getrpcbynumber.
-AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
+AC_SEARCH_LIBS(getrpcbynumber, nsl,
+ AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
dnl AC_CHECK_LIB(z, uncompress)
dnl AC_CHECK_HEADERS(zlib.h)
@@ -619,7 +654,8 @@ AC_CHECK_FUNCS(ether_ntohost, [
[ac_cv_buggy_ether_ntohost=yes],
[ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
if test "$ac_cv_buggy_ether_ntohost" = "no"; then
- AC_DEFINE(USE_ETHER_NTOHOST)
+ AC_DEFINE(USE_ETHER_NTOHOST, 1,
+ [define if you have ether_ntohost() and it works])
fi
])
if test "$ac_cv_func_ether_ntohost" = yes -a \
@@ -725,9 +761,14 @@ if test $ac_cv_func_pcap_create = "yes" ; then
# pcap_list_tstamp_types and pcap_free_tstamp_types as well.
#
AC_CHECK_FUNCS(pcap_set_tstamp_type)
+ #
+ # And do we have pcap_set_tstamp_precision? If so, we assume
+ # we also have pcap_open_offline_with_tstamp_precision.
+ #
+ AC_CHECK_FUNCS(pcap_set_tstamp_precision)
fi
-AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
+AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection)
if test $ac_cv_func_pcap_findalldevs = "yes" ; then
dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
@@ -750,7 +791,7 @@ if test $ac_cv_func_pcap_lib_version = "no" ; then
ac_lbl_cv_pcap_version_defined=no)
if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_PCAP_VERSION)
+ AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
else
AC_MSG_RESULT(no)
fi
@@ -766,7 +807,7 @@ AC_TRY_LINK([],
ac_lbl_cv_pcap_debug_defined=no)
if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_PCAP_DEBUG)
+ AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
else
AC_MSG_RESULT(no)
#
@@ -783,7 +824,7 @@ else
ac_lbl_cv_yydebug_defined=no)
if test "$ac_lbl_cv_yydebug_defined" = yes ; then
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_YYDEBUG)
+ AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
else
AC_MSG_RESULT(no)
fi
@@ -850,73 +891,56 @@ if test -f /dev/bpf0 ; then
V_GROUP=bpf
fi
-AC_CHECK_HEADERS(sys/bitypes.h)
+#
+# Make sure we have definitions for all the C99 specified-width types
+# (regardless of whether the environment is a C99 environment or not).
+#
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
-AC_CHECK_TYPE([int8_t], ,
- [AC_DEFINE([int8_t], [signed char],
- [Define to `signed char' if int8_t not defined.])],
- [AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
+#
+# Define the old BSD specified-width types in terms of the C99 types;
+# we may need them with libpcap include files.
+#
AC_CHECK_TYPE([u_int8_t], ,
- [AC_DEFINE([u_int8_t], [unsigned char],
- [Define to `unsigned char' if u_int8_t not defined.])],
- [AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
-AC_CHECK_TYPE([int16_t], ,
- [AC_DEFINE([int16_t], [short],
- [Define to `short' if int16_t not defined.])]
+ [AC_DEFINE([u_int8_t], [uint8_t],
+ [Define to `uint8_t' if u_int8_t not defined.])],
[AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
+#include <sys/types.h>
+])
AC_CHECK_TYPE([u_int16_t], ,
- [AC_DEFINE([u_int16_t], [unsigned short],
- [Define to `unsigned short' if u_int16_t not defined.])],
- [AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
-AC_CHECK_TYPE([int32_t], ,
- [AC_DEFINE([int32_t], [int],
- [Define to `int' if int32_t not defined.])],
+ [AC_DEFINE([u_int16_t], [uint16_t],
+ [Define to `uint16_t' if u_int16_t not defined.])],
[AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
+#include <sys/types.h>
+])
AC_CHECK_TYPE([u_int32_t], ,
- [AC_DEFINE([u_int32_t], [unsigned int],
- [Define to `unsigned int' if u_int32_t not defined.])],
+ [AC_DEFINE([u_int32_t], [uint32_t],
+ [Define to `uint32_t' if u_int32_t not defined.])],
[AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
-AC_CHECK_TYPE([int64_t], ,
- [AC_DEFINE([int64_t], [long long],
- [Define to `long long' if int64_t not defined.])],
- [AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
+#include <sys/types.h>
+])
AC_CHECK_TYPE([u_int64_t], ,
- [AC_DEFINE([u_int64_t], [unsigned long long],
- [Define to `unsigned long long' if u_int64_t not defined.])],
+ [AC_DEFINE([u_int64_t], [uint64_t],
+ [Define to `uint64_t' if u_int64_t not defined.])],
[AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif])
+#include <sys/types.h>
+])
#
-# We can't just check for <inttypes.h> - some systems have one that
-# doesn't define all the PRI[doxu]64 macros.
+# Check for <inttypes.h>
#
AC_CHECK_HEADERS(inttypes.h,
[
#
- # OK, we have inttypes.h, but does it define those macros?
+ # OK, we have inttypes.h, but does it define all the PRI[doxu]64 macros?
+ # Some systems have an inttypes.h that doesn't define all of them.
#
AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
AC_COMPILE_IFELSE(
@@ -926,16 +950,13 @@ AC_CHECK_HEADERS(inttypes.h,
#include <inttypes.h>
#include <stdio.h>
#include <sys/types.h>
- #ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
- #endif
main()
{
- printf("%" PRId64 "\n", (u_int64_t)1);
- printf("%" PRIo64 "\n", (u_int64_t)1);
- printf("%" PRIx64 "\n", (u_int64_t)1);
- printf("%" PRIu64 "\n", (u_int64_t)1);
+ printf("%" PRId64 "\n", (uint64_t)1);
+ printf("%" PRIo64 "\n", (uint64_t)1);
+ printf("%" PRIx64 "\n", (uint64_t)1);
+ printf("%" PRIu64 "\n", (uint64_t)1);
}
]])
],
@@ -980,11 +1001,13 @@ fi
#
savedcppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $V_INCLS"
-AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
-AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
+AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include "tcpdump-stdinc.h"])
+AC_CHECK_HEADERS(pcap/nflog.h,,,[#include "tcpdump-stdinc.h"])
+AC_CHECK_HEADERS(pcap/usb.h,,,[#include "tcpdump-stdinc.h"])
CPPFLAGS="$savedcppflags"
AC_PROG_RANLIB
+AC_CHECK_TOOL([AR], [ar])
AC_LBL_DEVEL(V_CCOPT)