X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b14d690f6df6038f17b2b8c46c34365963522814..383670e8f3f5b51d1017d8c1a678aa7eaf1f2b4d:/configure.ac diff --git a/configure.ac b/configure.ac index 4b113c48..48f4dc95 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ dnl # # See # -# http://ftp.gnu.org/gnu/config/README +# https://ftp.gnu.org/gnu/config/README # # for the URLs to use to fetch new versions of config.guess and # config.sub. @@ -20,7 +20,14 @@ AC_CONFIG_SRCDIR(tcpdump.c) AC_CANONICAL_HOST AC_LBL_C_INIT_BEFORE_CC(V_INCLS) +# +# Try to enable as many C99 features as we can. +# At minimum, we want C++/C99-style // comments. +# AC_PROG_CC_C99 +if test "$ac_cv_prog_cc_c99" = "no"; then + AC_MSG_WARN([The C compiler does not support C99; there may be compiler errors]) +fi AC_LBL_C_INIT(V_CCOPT, V_INCLS) AC_LBL_C_INLINE @@ -140,12 +147,11 @@ fi AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer]) AC_ARG_ENABLE(smb, -[ --enable-smb enable possibly-buggy SMB printer [default=yes] +[ --enable-smb enable possibly-buggy SMB printer [default=no] --disable-smb disable possibly-buggy SMB printer],, - enableval=yes) + enableval=no) case "$enableval" in yes) AC_MSG_RESULT(yes) - AC_WARN([The SMB printer may have exploitable buffer overflows!!!]) AC_DEFINE(ENABLE_SMB, 1, [define if you want to build the possibly-buggy SMB printer]) LOCALSRC="print-smb.c smbutil.c $LOCALSRC" @@ -192,10 +198,19 @@ AC_ARG_WITH(sandbox-capsicum, # 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 - AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat, - ac_lbl_capsicum_function_seen=yes, - ac_lbl_capsicum_function_not_seen=yes) +if test ! -z "$with_sandbox_capsicum" && test "$with_sandbox_capsicum" != "no" ; then + # + # First, make sure we have the required header. + # + AC_CHECK_HEADER(sys/capsicum.h, + [ + # + # We do; now make sure we have the required functions. + # + AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat, + ac_lbl_capsicum_function_seen=yes, + ac_lbl_capsicum_function_not_seen=yes) + ]) AC_CHECK_LIB(casper, cap_init, LIBS="$LIBS -lcasper") AC_CHECK_LIB(cap_dns, cap_gethostbyaddr, LIBS="$LIBS -lcap_dns") fi @@ -370,55 +385,17 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then fi fi -AC_SEARCH_LIBS(dnet_htoa, dnet, -[ - AC_DEFINE(HAVE_DNET_HTOA, 1, - [define if you have the dnet_htoa function]) - # - # OK, we have dnet_htoa(). Do we have netdnet/dnetdb.h? - # - AC_CHECK_HEADERS(netdnet/dnetdb.h) - if test "$ac_cv_header_netdnet_dnetdb_h" = "yes"; then - # - # Yes. Does it declare dnet_htoa()? - # - AC_CHECK_DECL(dnet_htoa, - [ - # Yes. - AC_DEFINE(NETDNET_DNETDB_H_DECLARES_DNET_HTOA,, - [Define to 1 if netenet/dnetdb.h declares `dnet_htoa']) - ],, - [ -AC_INCLUDES_DEFAULT -#include - ]) - fi - - # - # Do we have netdnet/dn.h? - # - AC_CHECK_HEADERS(netdnet/dn.h) - if test "$ac_cv_header_netdnet_dn_h" = "yes"; then - # - # Yes. Does it declare struct dn_naddr? - # - AC_CHECK_TYPES(struct dn_naddr,,, - [ -#include - ]) - fi -]) - AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long) AC_CHECK_FUNCS(fork vfork strftime) AC_CHECK_FUNCS(setlinebuf) -needsnprintf=no -AC_CHECK_FUNCS(vsnprintf snprintf,, - [needsnprintf=yes]) -if test $needsnprintf = yes; then - AC_LIBOBJ(snprintf) -fi +# +# Make sure we have vsnprintf() and snprintf(); we require them. +# +AC_CHECK_FUNC(vsnprintf,, + AC_MSG_ERROR([vsnprintf() is required but wasn't found])) +AC_CHECK_FUNC(snprintf,, + AC_MSG_ERROR([snprintf() is required but wasn't found])) AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc @@ -947,19 +924,19 @@ if test "$want_libcrypto" != "no"; then # EVP_CIPHER_CTX, as EVP_CIPHER_CTX may be # opaque; otherwise, we allocate it ourselves. # - # 2) do we have EVP_CipherInit_ex()? + # 2) do we have EVP_DecryptInit_ex()? # If so, we use it, because we need to be # able to make two "initialize the cipher" # calls, one with the cipher and key, and # one with the IV, and, as of OpenSSL 1.1, - # You Can't Do That with EVP_CipherInit(), - # because a call to EVP_CipherInit() will + # You Can't Do That with EVP_DecryptInit(), + # because a call to EVP_DecryptInit() will # unconditionally clear the context, and # if you don't supply a cipher, it'll # clear the cipher, rendering the context # unusable and causing a crash. # - AC_CHECK_FUNCS(EVP_CIPHER_CTX_new EVP_CipherInit_ex) + AC_CHECK_FUNCS(EVP_CIPHER_CTX_new EVP_DecryptInit_ex) fi ]) fi @@ -1015,7 +992,7 @@ AC_CONFIG_HEADER(config.h) AC_OUTPUT_COMMANDS([if test -f .devel; then echo timestamp > stamp-h - cat Makefile-devel-adds >> Makefile + cat $srcdir/Makefile-devel-adds >> Makefile make depend fi]) AC_OUTPUT(Makefile tcpdump.1)