X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/56e2d8cc377e491f201348c91d596baca8bafad2..refs/pull/433/head:/configure diff --git a/configure b/configure index f352e540..293edb14 100755 --- a/configure +++ b/configure @@ -707,6 +707,7 @@ with_sandbox_capsicum enable_ipv6 with_system_libpcap with_crypto +with_cap_ng ' ac_precious_vars='build_alias host_alias @@ -1346,6 +1347,7 @@ Optional Packages: available] --with-system-libpcap don't use local pcap library --with-crypto use OpenSSL libcrypto [default=yes, if available] + --with-cap-ng use libcap-ng [default=yes, if available] Some influential environment variables: CC C compiler command @@ -4541,6 +4543,9 @@ fi # 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 for ac_func in cap_enter cap_rights_limit cap_ioctls_limit openat do : @@ -5115,7 +5120,7 @@ $as_echo_n "checking getaddrinfo bug... " >&6; } $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - td_cv_buggygetaddrinfo=yes + td_cv_buggygetaddrinfo=unknown else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5229,6 +5234,9 @@ fi if test "$td_cv_buggygetaddrinfo" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: good" >&5 $as_echo "good" >&6; } + elif test "$td_cv_buggygetaddrinfo" = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +$as_echo "unknown (cross-compiling)" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5 $as_echo "buggy" >&6; } @@ -6147,110 +6155,6 @@ not be able to determine why this is happening, and thus will not be able to fix it, without that information, as we have not been able to reproduce this problem ourselves." "$LINENO" 5 -fi - - - ac_fn_c_check_func "$LINENO" "pcap_list_datalinks" "ac_cv_func_pcap_list_datalinks" -if test "x$ac_cv_func_pcap_list_datalinks" = xyes; then : - - -$as_echo "#define HAVE_PCAP_LIST_DATALINKS 1" >>confdefs.h - - for ac_func in pcap_free_datalinks -do : - ac_fn_c_check_func "$LINENO" "pcap_free_datalinks" "ac_cv_func_pcap_free_datalinks" -if test "x$ac_cv_func_pcap_free_datalinks" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PCAP_FREE_DATALINKS 1 -_ACEOF - -fi -done - - -else - - case " $LIBOBJS " in - *" datalinks.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS datalinks.$ac_objext" - ;; -esac - - -fi - - for ac_func in pcap_set_datalink -do : - ac_fn_c_check_func "$LINENO" "pcap_set_datalink" "ac_cv_func_pcap_set_datalink" -if test "x$ac_cv_func_pcap_set_datalink" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PCAP_SET_DATALINK 1 -_ACEOF - -fi -done - - ac_fn_c_check_func "$LINENO" "pcap_datalink_name_to_val" "ac_cv_func_pcap_datalink_name_to_val" -if test "x$ac_cv_func_pcap_datalink_name_to_val" = xyes; then : - - -$as_echo "#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1" >>confdefs.h - - ac_fn_c_check_func "$LINENO" "pcap_datalink_val_to_description" "ac_cv_func_pcap_datalink_val_to_description" -if test "x$ac_cv_func_pcap_datalink_val_to_description" = xyes; then : - -$as_echo "#define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1" >>confdefs.h - -else - - case " $LIBOBJS " in - *" dlnames.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS dlnames.$ac_objext" - ;; -esac - - -fi - - -else - - case " $LIBOBJS " in - *" dlnames.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS dlnames.$ac_objext" - ;; -esac - - -fi - - - for ac_func in pcap_breakloop -do : - ac_fn_c_check_func "$LINENO" "pcap_breakloop" "ac_cv_func_pcap_breakloop" -if test "x$ac_cv_func_pcap_breakloop" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PCAP_BREAKLOOP 1 -_ACEOF - -fi -done - - - ac_fn_c_check_func "$LINENO" "pcap_dump_ftell" "ac_cv_func_pcap_dump_ftell" -if test "x$ac_cv_func_pcap_dump_ftell" = xyes; then : - -$as_echo "#define HAVE_PCAP_DUMP_FTELL 1" >>confdefs.h - -else - - case " $LIBOBJS " in - *" pcap_dump_ftell.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS pcap_dump_ftell.$ac_objext" - ;; -esac - - fi @@ -6622,6 +6526,110 @@ if test "$ac_cv_sockaddr_has_sa_len" = no; then missing_includes=yes fi +ac_fn_c_check_func "$LINENO" "pcap_list_datalinks" "ac_cv_func_pcap_list_datalinks" +if test "x$ac_cv_func_pcap_list_datalinks" = xyes; then : + + +$as_echo "#define HAVE_PCAP_LIST_DATALINKS 1" >>confdefs.h + + for ac_func in pcap_free_datalinks +do : + ac_fn_c_check_func "$LINENO" "pcap_free_datalinks" "ac_cv_func_pcap_free_datalinks" +if test "x$ac_cv_func_pcap_free_datalinks" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PCAP_FREE_DATALINKS 1 +_ACEOF + +fi +done + + +else + + case " $LIBOBJS " in + *" datalinks.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS datalinks.$ac_objext" + ;; +esac + + +fi + +for ac_func in pcap_set_datalink +do : + ac_fn_c_check_func "$LINENO" "pcap_set_datalink" "ac_cv_func_pcap_set_datalink" +if test "x$ac_cv_func_pcap_set_datalink" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PCAP_SET_DATALINK 1 +_ACEOF + +fi +done + +ac_fn_c_check_func "$LINENO" "pcap_datalink_name_to_val" "ac_cv_func_pcap_datalink_name_to_val" +if test "x$ac_cv_func_pcap_datalink_name_to_val" = xyes; then : + + +$as_echo "#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1" >>confdefs.h + + ac_fn_c_check_func "$LINENO" "pcap_datalink_val_to_description" "ac_cv_func_pcap_datalink_val_to_description" +if test "x$ac_cv_func_pcap_datalink_val_to_description" = xyes; then : + +$as_echo "#define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1" >>confdefs.h + +else + + case " $LIBOBJS " in + *" dlnames.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dlnames.$ac_objext" + ;; +esac + + +fi + + +else + + case " $LIBOBJS " in + *" dlnames.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dlnames.$ac_objext" + ;; +esac + + +fi + + +for ac_func in pcap_breakloop +do : + ac_fn_c_check_func "$LINENO" "pcap_breakloop" "ac_cv_func_pcap_breakloop" +if test "x$ac_cv_func_pcap_breakloop" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PCAP_BREAKLOOP 1 +_ACEOF + +fi +done + + +ac_fn_c_check_func "$LINENO" "pcap_dump_ftell" "ac_cv_func_pcap_dump_ftell" +if test "x$ac_cv_func_pcap_dump_ftell" = xyes; then : + +$as_echo "#define HAVE_PCAP_DUMP_FTELL 1" >>confdefs.h + +else + + case " $LIBOBJS " in + *" pcap_dump_ftell.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS pcap_dump_ftell.$ac_objext" + ;; +esac + + +fi + + # # 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 @@ -6671,7 +6679,11 @@ done fi -for ac_func in pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection +# +# Check for a miscellaneous collection of functions which we use +# if we have them. +# +for ac_func in pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection pcap_set_immediate_mode do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -6726,7 +6738,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_lbl_cv_pcap_version_defined" = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_PCAP_VERSION 1" >>confdefs.h @@ -8166,6 +8178,98 @@ done fi +# Check for libcap-ng +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libcap-ng" >&5 +$as_echo_n "checking whether to use libcap-ng... " >&6; } +# Specify location for both includes and libraries. +want_libcap_ng=ifavailable + +# Check whether --with-cap_ng was given. +if test "${with_cap_ng+set}" = set; then : + withval=$with_cap_ng; + if test $withval = no + then + want_libcap_ng=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + elif test $withval = yes + then + want_libcap_ng=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + +else + + # + # Use libcap-ng if it's present, otherwise don't. + # + want_libcap_ng=ifavailable + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, if available" >&5 +$as_echo "yes, if available" >&6; } + +fi + +if test "$want_libcap_ng" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for capng_change_id in -lcap-ng" >&5 +$as_echo_n "checking for capng_change_id in -lcap-ng... " >&6; } +if ${ac_cv_lib_cap_ng_capng_change_id+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap-ng $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char capng_change_id (); +int +main () +{ +return capng_change_id (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cap_ng_capng_change_id=yes +else + ac_cv_lib_cap_ng_capng_change_id=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_ng_capng_change_id" >&5 +$as_echo "$ac_cv_lib_cap_ng_capng_change_id" >&6; } +if test "x$ac_cv_lib_cap_ng_capng_change_id" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCAP_NG 1 +_ACEOF + + LIBS="-lcap-ng $LIBS" + +fi + + for ac_header in cap-ng.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "cap-ng.h" "ac_cv_header_cap_ng_h" "$ac_includes_default" +if test "x$ac_cv_header_cap_ng_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CAP_NG_H 1 +_ACEOF + +fi + +done + +fi + if test "$missing_includes" = "yes"; then CPPFLAGS="$CPPFLAGS -I$srcdir/missing" V_INCLS="$V_INCLS -I$srcdir/missing"