Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/tcpdump/configure.in
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | |||||
if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then | 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]) | [define if should chroot when dropping privileges]) | ||||
AC_MSG_RESULT(to \"$withval\") | AC_MSG_RESULT(to \"$withval\") | ||||
else | else | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
fi | fi | ||||
AC_ARG_WITH(sandbox-capsicum, [ --with-sandbox-capsicum ]) | AC_ARG_WITH(sandbox-capsicum, | ||||
AS_HELP_STRING([--with-sandbox-capsicum], | |||||
[use Capsicum security functions @<:@default=yes, if available@:>@])) | |||||
# | # | ||||
# Check whether various functions are available. If any are, set | # 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_seen to yes; if any are not, set | ||||
# ac_lbl_capsicum_function_not_seen to yes. | # ac_lbl_capsicum_function_not_seen to yes. | ||||
# | # | ||||
# All of them must be available in order to enable capsicum sandboxing. | # We don't check cap_rights_init(), as it's a macro, wrapping another | ||||
# function, in at least some versions of FreeBSD, and AC_CHECK_FUNCS() | |||||
# doesn't handle that. | |||||
# | # | ||||
# All of the ones we check for must be available in order to enable | |||||
# capsicum sandboxing. | |||||
# | |||||
# XXX - do we need to check for all of them, or are there some that, if | |||||
# present, imply others are present? | |||||
# | |||||
if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then | 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_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat, | ||||
ac_lbl_capsicum_function_seen=yes, | ac_lbl_capsicum_function_seen=yes, | ||||
ac_lbl_capsicum_function_not_seen=yes) | ac_lbl_capsicum_function_not_seen=yes) | ||||
fi | fi | ||||
AC_MSG_CHECKING([whether to sandbox using capsicum]) | 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 | 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_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available]) | ||||
AC_MSG_RESULT(yes) | AC_MSG_RESULT(yes) | ||||
else | else | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
fi | fi | ||||
# | # | ||||
# We must check this before checking whether to enable IPv6, because, | # We must check this before checking whether to enable IPv6, because, | ||||
# on some platforms (such as SunOS 5.x), the test program requires | # on some platforms (such as SunOS 5.x), the test program requires | ||||
# the extra networking libraries. | # the extra networking libraries. | ||||
# | # | ||||
AC_LBL_LIBRARY_NET | AC_LBL_LIBRARY_NET | ||||
AC_MSG_CHECKING([whether to enable ipv6]) | AC_MSG_CHECKING([whether to enable ipv6]) | ||||
AC_ARG_ENABLE(ipv6, | AC_ARG_ENABLE(ipv6, | ||||
[ --enable-ipv6 enable ipv6 (with ipv4) support | [ --enable-ipv6 enable ipv6 (with ipv4) support | ||||
--disable-ipv6 disable ipv6 support], | --disable-ipv6 disable ipv6 support], | ||||
[ case "$enableval" in | [ case "$enableval" in | ||||
yes) AC_MSG_RESULT(yes) | 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" | LOCALSRC="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, 1, [Define if you enable IPv6 support]) | AC_DEFINE(INET6, 1, [Define if you enable IPv6 support]) | ||||
ipv6=yes | ipv6=yes | ||||
;; | ;; | ||||
*) | *) | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
ipv6=no | ipv6=no | ||||
;; | ;; | ||||
esac ], | esac ], | ||||
Show All 12 Lines | |||||
memset(addr, 0, sizeof (struct in6_addr)); | memset(addr, 0, sizeof (struct in6_addr)); | ||||
} | } | ||||
#else | #else | ||||
#error "AF_INET6 not defined" | #error "AF_INET6 not defined" | ||||
#endif | #endif | ||||
]]) | ]]) | ||||
], | ], | ||||
[ AC_MSG_RESULT(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" | LOCALSRC="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, 1, [Define if you enable IPv6 support]) | AC_DEFINE(INET6, 1, [Define if you enable IPv6 support]) | ||||
ipv6=yes], | ipv6=yes], | ||||
[ AC_MSG_RESULT(no) | [ AC_MSG_RESULT(no) | ||||
ipv6=no], | ipv6=no], | ||||
[ AC_MSG_RESULT(no) | [ AC_MSG_RESULT(no) | ||||
ipv6=no] | ipv6=no] | ||||
)) | )) | ||||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | |||||
bad: | bad: | ||||
if (aitop) | if (aitop) | ||||
freeaddrinfo(aitop); | freeaddrinfo(aitop); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
], | ], | ||||
td_cv_buggygetaddrinfo=no, | td_cv_buggygetaddrinfo=no, | ||||
td_cv_buggygetaddrinfo=yes, | td_cv_buggygetaddrinfo=yes, | ||||
td_cv_buggygetaddrinfo=yes)]) | td_cv_buggygetaddrinfo=unknown)]) | ||||
if test "$td_cv_buggygetaddrinfo" = no; then | if test "$td_cv_buggygetaddrinfo" = no; then | ||||
AC_MSG_RESULT(good) | AC_MSG_RESULT(good) | ||||
elif test "$td_cv_buggygetaddrinfo" = unknown; then | |||||
AC_MSG_RESULT([unknown (cross-compiling)]) | |||||
else | else | ||||
AC_MSG_RESULT(buggy) | AC_MSG_RESULT(buggy) | ||||
fi | fi | ||||
if test "$td_cv_buggygetaddrinfo" = "yes"; then | if test "$td_cv_buggygetaddrinfo" = "yes"; then | ||||
# | # | ||||
# XXX - it doesn't appear that "ipv6type" can ever be | # XXX - it doesn't appear that "ipv6type" can ever be | ||||
# set to "linux". Should this be testing for | # set to "linux". Should this be testing for | ||||
▲ Show 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | |||||
dnl portability macros for getaddrinfo/getnameinfo | dnl portability macros for getaddrinfo/getnameinfo | ||||
dnl | dnl | ||||
dnl Check for sa_len | dnl Check for sa_len | ||||
AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len) | AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len) | ||||
if test "$ac_cv_sockaddr_has_sa_len" = no; then | if test "$ac_cv_sockaddr_has_sa_len" = no; then | ||||
missing_includes=yes | missing_includes=yes | ||||
fi | fi | ||||
dnl | |||||
dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()", | |||||
dnl and "pcap_datalink_name_to_val()", and use substitute versions | |||||
dnl if they're not present. | |||||
dnl | |||||
AC_CHECK_FUNC(pcap_list_datalinks, | |||||
[ | |||||
AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1, | |||||
[define if libpcap has pcap_list_datalinks()]) | |||||
AC_CHECK_FUNCS(pcap_free_datalinks) | |||||
], | |||||
[ | |||||
AC_LIBOBJ(datalinks) | |||||
]) | |||||
AC_CHECK_FUNCS(pcap_set_datalink) | |||||
AC_CHECK_FUNC(pcap_datalink_name_to_val, | |||||
[ | |||||
AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL, 1, | |||||
[define if libpcap has pcap_datalink_name_to_val()]) | |||||
AC_CHECK_FUNC(pcap_datalink_val_to_description, | |||||
AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION, 1, | |||||
[define if libpcap has pcap_datalink_val_to_description()]), | |||||
[ | |||||
AC_LIBOBJ(dlnames) | |||||
]) | |||||
], | |||||
[ | |||||
AC_LIBOBJ(dlnames) | |||||
]) | |||||
dnl | |||||
dnl Check for "pcap_breakloop()"; you can't substitute for it if | |||||
dnl it's absent (it has hooks into the live capture routines), | |||||
dnl so just define the HAVE_ value if it's there. | |||||
dnl | |||||
AC_CHECK_FUNCS(pcap_breakloop) | |||||
dnl | |||||
dnl Check for "pcap_dump_ftell()" and use a substitute version | |||||
dnl if it's not present. | |||||
dnl | |||||
AC_CHECK_FUNC(pcap_dump_ftell, | |||||
AC_DEFINE(HAVE_PCAP_DUMP_FTELL, 1, | |||||
[define if libpcap has pcap_dump_ftell()]), | |||||
[ | |||||
AC_LIBOBJ(pcap_dump_ftell) | |||||
]) | |||||
# | # | ||||
# Do we have the new open API? Check for pcap_create, and assume that, | # Do we have the new open API? Check for pcap_create, and assume that, | ||||
# if we do, we also have pcap_activate() and the other new routines | # if we do, we also have pcap_activate() and the other new routines | ||||
# introduced in libpcap 1.0.0. | # introduced in libpcap 1.0.0. | ||||
# | # | ||||
AC_CHECK_FUNCS(pcap_create) | AC_CHECK_FUNCS(pcap_create) | ||||
if test $ac_cv_func_pcap_create = "yes" ; then | if test $ac_cv_func_pcap_create = "yes" ; then | ||||
# | # | ||||
# OK, do we have pcap_set_tstamp_type? If so, assume we have | # OK, do we have pcap_set_tstamp_type? If so, assume we have | ||||
# pcap_list_tstamp_types and pcap_free_tstamp_types as well. | # pcap_list_tstamp_types and pcap_free_tstamp_types as well. | ||||
# | # | ||||
AC_CHECK_FUNCS(pcap_set_tstamp_type) | AC_CHECK_FUNCS(pcap_set_tstamp_type) | ||||
# | # | ||||
# And do we have pcap_set_tstamp_precision? If so, we assume | # And do we have pcap_set_tstamp_precision? If so, we assume | ||||
# we also have pcap_open_offline_with_tstamp_precision. | # we also have pcap_open_offline_with_tstamp_precision. | ||||
# | # | ||||
AC_CHECK_FUNCS(pcap_set_tstamp_precision) | AC_CHECK_FUNCS(pcap_set_tstamp_precision) | ||||
fi | fi | ||||
AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection) | # | ||||
# Check for a miscellaneous collection of functions which we use | |||||
# if we have them. | |||||
# | |||||
AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection pcap_set_immediate_mode) | |||||
if test $ac_cv_func_pcap_findalldevs = "yes" ; then | 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 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 | dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't | ||||
dnl have pcap_if_t. | dnl have pcap_if_t. | ||||
savedcppflags="$CPPFLAGS" | savedcppflags="$CPPFLAGS" | ||||
CPPFLAGS="$CPPFLAGS $V_INCLS" | CPPFLAGS="$CPPFLAGS $V_INCLS" | ||||
AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>]) | AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>]) | ||||
CPPFLAGS="$savedcppflags" | CPPFLAGS="$savedcppflags" | ||||
fi | fi | ||||
if test $ac_cv_func_pcap_lib_version = "no" ; then | if test $ac_cv_func_pcap_lib_version = "no" ; then | ||||
AC_MSG_CHECKING(whether pcap_version is defined by libpcap) | AC_MSG_CHECKING(whether pcap_version is defined by libpcap) | ||||
AC_TRY_LINK([], | AC_TRY_LINK([], | ||||
[ | [ | ||||
extern char pcap_version[]; | extern char pcap_version[]; | ||||
return (int)pcap_version; | return (int)pcap_version; | ||||
], | ], | ||||
ac_lbl_cv_pcap_version_defined=yes, | ac_lbl_cv_pcap_version_defined=yes, | ||||
ac_lbl_cv_pcap_version_defined=no) | ac_lbl_cv_pcap_version_defined=no) | ||||
if test "$ac_lbl_cv_pcap_version_defined" = yes ; then | if test "$ac_lbl_cv_pcap_version_defined" = yes ; then | ||||
AC_MSG_RESULT(yes) | AC_MSG_RESULT(yes) | ||||
AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version]) | AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version]) | ||||
else | else | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
fi | fi | ||||
fi | fi | ||||
AC_MSG_CHECKING(whether pcap_debug is defined by libpcap) | AC_MSG_CHECKING(whether pcap_debug is defined by libpcap) | ||||
AC_TRY_LINK([], | AC_TRY_LINK([], | ||||
[ | [ | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
AC_TYPE_INT32_T | AC_TYPE_INT32_T | ||||
AC_TYPE_INT64_T | AC_TYPE_INT64_T | ||||
AC_TYPE_UINT8_T | AC_TYPE_UINT8_T | ||||
AC_TYPE_UINT16_T | AC_TYPE_UINT16_T | ||||
AC_TYPE_UINT32_T | AC_TYPE_UINT32_T | ||||
AC_TYPE_UINT64_T | AC_TYPE_UINT64_T | ||||
# | # | ||||
# Make sure we have a definition for C99's uintptr_t (regardless of | |||||
# whether the environment is a C99 environment or not). | |||||
# | |||||
AC_TYPE_UINTPTR_T | |||||
# | |||||
# Define the old BSD specified-width types in terms of the C99 types; | # Define the old BSD specified-width types in terms of the C99 types; | ||||
# we may need them with libpcap include files. | # we may need them with libpcap include files. | ||||
# | # | ||||
AC_CHECK_TYPE([u_int8_t], , | AC_CHECK_TYPE([u_int8_t], , | ||||
[AC_DEFINE([u_int8_t], [uint8_t], | [AC_DEFINE([u_int8_t], [uint8_t], | ||||
[Define to `uint8_t' if u_int8_t not defined.])], | [Define to `uint8_t' if u_int8_t not defined.])], | ||||
[AC_INCLUDES_DEFAULT | [AC_INCLUDES_DEFAULT | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | ],[ | ||||
# Use libcrypto if it's present, otherwise don't. | # Use libcrypto if it's present, otherwise don't. | ||||
# | # | ||||
want_libcrypto=ifavailable | want_libcrypto=ifavailable | ||||
AC_MSG_RESULT([yes, if available]) | AC_MSG_RESULT([yes, if available]) | ||||
]) | ]) | ||||
if test "$want_libcrypto" != "no"; then | if test "$want_libcrypto" != "no"; then | ||||
AC_CHECK_LIB(crypto, DES_cbc_encrypt) | AC_CHECK_LIB(crypto, DES_cbc_encrypt) | ||||
AC_CHECK_HEADERS(openssl/evp.h) | AC_CHECK_HEADERS(openssl/evp.h) | ||||
fi | |||||
# Check for libcap-ng | |||||
AC_MSG_CHECKING(whether to use libcap-ng) | |||||
# Specify location for both includes and libraries. | |||||
want_libcap_ng=ifavailable | |||||
AC_ARG_WITH(cap_ng, | |||||
AS_HELP_STRING([--with-cap-ng], | |||||
[use libcap-ng @<:@default=yes, if available@:>@]), | |||||
[ | |||||
if test $withval = no | |||||
then | |||||
want_libcap_ng=no | |||||
AC_MSG_RESULT(no) | |||||
elif test $withval = yes | |||||
then | |||||
want_libcap_ng=yes | |||||
AC_MSG_RESULT(yes) | |||||
fi | |||||
],[ | |||||
# | |||||
# Use libcap-ng if it's present, otherwise don't. | |||||
# | |||||
want_libcap_ng=ifavailable | |||||
AC_MSG_RESULT([yes, if available]) | |||||
]) | |||||
if test "$want_libcap_ng" != "no"; then | |||||
AC_CHECK_LIB(cap-ng, capng_change_id) | |||||
AC_CHECK_HEADERS(cap-ng.h) | |||||
fi | fi | ||||
dnl | dnl | ||||
dnl set additional include path if necessary | dnl set additional include path if necessary | ||||
if test "$missing_includes" = "yes"; then | if test "$missing_includes" = "yes"; then | ||||
CPPFLAGS="$CPPFLAGS -I$srcdir/missing" | CPPFLAGS="$CPPFLAGS -I$srcdir/missing" | ||||
V_INCLS="$V_INCLS -I$srcdir/missing" | V_INCLS="$V_INCLS -I$srcdir/missing" | ||||
fi | fi | ||||
Show All 21 Lines |