X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/519d41dd8c8ac2a9668bbec53d98ab753df3415c..refs/pull/471/head:/configure diff --git a/configure b/configure index 91a03a7c..57234921 100755 --- a/configure +++ b/configure @@ -704,8 +704,9 @@ enable_smb with_user with_chroot with_sandbox_capsicum -enable_ipv6 +with_system_libpcap with_crypto +with_cap_ng ' ac_precious_vars='build_alias host_alias @@ -1330,8 +1331,6 @@ Optional Features: --disable-universal don't build universal on OS X --enable-smb enable possibly-buggy SMB printer default=yes --disable-smb disable possibly-buggy SMB printer - --enable-ipv6 enable ipv6 (with ipv4) support - --disable-ipv6 disable ipv6 support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1343,7 +1342,9 @@ Optional Packages: --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY --with-sandbox-capsicum use Capsicum security functions [default=yes, if 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 @@ -3348,7 +3349,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -ffloat-store option" >&5 $as_echo_n "checking whether the compiler supports the -ffloat-store option... " >&6; } save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -ffloat-store" + if expr "x-ffloat-store" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -ffloat-store" + elif expr "x-ffloat-store" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -ffloat-store" + elif expr "x-ffloat-store" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -ffloat-store" + else + CFLAGS="$CFLAGS -ffloat-store" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4209,7 +4221,25 @@ fi done if test "$ac_cv_header_net_pfvar_h" = yes; then - LOCALSRC="print-pflog.c $LOCALSRC" + for ac_header in net/if_pflog.h +do : + ac_fn_c_check_header_compile "$LINENO" "net/if_pflog.h" "ac_cv_header_net_if_pflog_h" "#include + #include + #include + #include +" +if test "x$ac_cv_header_net_if_pflog_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NET_IF_PFLOG_H 1 +_ACEOF + +fi + +done + + if test "$ac_cv_header_net_if_pflog_h" = yes; then + LOCALSRC="print-pflog.c $LOCALSRC" + fi fi for ac_header in netinet/if_ether.h do : @@ -4470,7 +4500,7 @@ $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&5 $as_echo "$as_me: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&2;} -$as_echo "#define TCPDUMP_DO_SMB 1" >>confdefs.h +$as_echo "#define ENABLE_SMB 1" >>confdefs.h LOCALSRC="print-smb.c smbutil.c $LOCALSRC" ;; @@ -4532,10 +4562,18 @@ fi # 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. +# 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 - for ac_func in cap_enter cap_rights_init cap_rights_limit cap_ioctls_limit openat + for ac_func in cap_enter cap_rights_limit cap_ioctls_limit openat 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" @@ -4564,9 +4602,9 @@ $as_echo "no" >&6; } 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. +# We must check this before checking whether to check the OS's IPv6, +# support because, on some platforms (such as SunOS 5.x), the test +# program requires the extra networking libraries. # # Most operating systems have gethostbyname() in the default searched @@ -4830,30 +4868,19 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ipv6" >&5 -$as_echo_n "checking whether to enable ipv6... " >&6; } -# Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then : - enableval=$enable_ipv6; case "$enableval" in -yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - 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" - -$as_echo "#define INET6 1" >>confdefs.h - - ipv6=yes - ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ipv6=no - ;; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# +# Check whether AF_INET6 and struct in6_addr are defined. +# If they aren't both defined, we don't have sufficient OS +# support for IPv6, so we don't look for IPv6 support libraries, +# and we define AF_INET6 and struct in6_addr ourselves. +# +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the operating system supports IPv6" >&5 +$as_echo_n "checking whether the operating system supports IPv6... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - /* AF_INET6 available check */ + +/* AF_INET6 available check */ #include #include #include @@ -4870,21 +4897,23 @@ foo(struct in6_addr *addr) _ACEOF if ac_fn_c_try_compile "$LINENO"; 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; } - 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" -$as_echo "#define INET6 1" >>confdefs.h +$as_echo "#define HAVE_OS_IPV6_SUPPORT 1" >>confdefs.h + + ipv6=yes - ipv6=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - ipv6=no + ipv6=no + + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - ipv6type=unknown ipv6lib=none @@ -4905,8 +4934,7 @@ yes _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : - ipv6type=$i; - CFLAGS="-DINET6 $CFLAGS" + ipv6type=$i fi rm -f conftest* @@ -4924,8 +4952,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib; - ipv6trylibc=yes; - CFLAGS="-DINET6 $CFLAGS" + ipv6trylibc=yes fi rm -f conftest* @@ -4940,8 +4967,7 @@ yes _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : - ipv6type=$i; - CFLAGS="-DINET6 $CFLAGS" + ipv6type=$i fi rm -f conftest* @@ -4952,7 +4978,7 @@ rm -f conftest* ipv6lib=inet6 ipv6libdir=/usr/inet6/lib ipv6trylibc=yes; - CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS" + CFLAGS="-I/usr/inet6/include $CFLAGS" fi ;; toshiba) @@ -4967,8 +4993,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i; ipv6lib=inet6; - ipv6libdir=/usr/local/v6/lib; - CFLAGS="-DINET6 $CFLAGS" + ipv6libdir=/usr/local/v6/lib fi rm -f conftest* @@ -5003,8 +5028,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i; ipv6lib=inet6; - ipv6libdir=/usr/local/v6/lib; - CFLAGS="-DINET6 $CFLAGS" + ipv6libdir=/usr/local/v6/lib fi rm -f conftest* @@ -5034,236 +5058,6 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then fi fi - -if test "$ipv6" = "yes"; then - # - # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()" - # function in libc; there are "ngetaddrinfo()" and - # "ogetaddrinfo()" functions, and #defines - # "getaddrinfo" to be either "ngetaddrinfo" or - # "ogetaddrinfo", depending on whether _SOCKADDR_LEN - # or _XOPEN_SOURCE_EXTENDED are defined or not. - # - # So this test doesn't work on Tru64 5.1, and possibly - # on other 5.x releases. This causes the configure - # script to become confused, and results in libpcap - # being unbuildable. - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 -$as_echo_n "checking for library containing getaddrinfo... " >&6; } -if ${ac_cv_search_getaddrinfo+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$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 getaddrinfo (); -int -main () -{ -return getaddrinfo (); - ; - return 0; -} -_ACEOF -for ac_lib in '' socket; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_getaddrinfo=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_getaddrinfo+:} false; then : - break -fi -done -if ${ac_cv_search_getaddrinfo+:} false; then : - -else - ac_cv_search_getaddrinfo=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 -$as_echo "$ac_cv_search_getaddrinfo" >&6; } -ac_res=$ac_cv_search_getaddrinfo -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5 -$as_echo_n "checking getaddrinfo bug... " >&6; } - if ${td_cv_buggygetaddrinfo+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - td_cv_buggygetaddrinfo=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -#include -#include - -main() -{ - int passive, gaierr, inet4 = 0, inet6 = 0; - struct addrinfo hints, *ai, *aitop; - char straddr[INET6_ADDRSTRLEN], strport[16]; - - for (passive = 0; passive <= 1; passive++) { - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_flags = passive ? AI_PASSIVE : 0; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { - (void)gai_strerror(gaierr); - goto bad; - } - for (ai = aitop; ai; ai = ai->ai_next) { - if (ai->ai_addr == NULL || - ai->ai_addrlen == 0 || - getnameinfo(ai->ai_addr, ai->ai_addrlen, - straddr, sizeof(straddr), strport, sizeof(strport), - NI_NUMERICHOST|NI_NUMERICSERV) != 0) { - goto bad; - } - switch (ai->ai_family) { - case AF_INET: - if (strcmp(strport, "54321") != 0) { - goto bad; - } - if (passive) { - if (strcmp(straddr, "0.0.0.0") != 0) { - goto bad; - } - } else { - if (strcmp(straddr, "127.0.0.1") != 0) { - goto bad; - } - } - inet4++; - break; - case AF_INET6: - if (strcmp(strport, "54321") != 0) { - goto bad; - } - if (passive) { - if (strcmp(straddr, "::") != 0) { - goto bad; - } - } else { - if (strcmp(straddr, "::1") != 0) { - goto bad; - } - } - inet6++; - break; - case AF_UNSPEC: - goto bad; - break; -#ifdef AF_UNIX - case AF_UNIX: -#else -#ifdef AF_LOCAL - case AF_LOCAL: -#endif -#endif - default: - /* another family support? */ - break; - } - } - } - - /* supported family should be 2, unsupported family should be 0 */ - if (!(inet4 == 0 || inet4 == 2)) - goto bad; - if (!(inet6 == 0 || inet6 == 2)) - goto bad; - - if (aitop) - freeaddrinfo(aitop); - exit(0); - - bad: - if (aitop) - freeaddrinfo(aitop); - exit(1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - td_cv_buggygetaddrinfo=no -else - td_cv_buggygetaddrinfo=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi - - if test "$td_cv_buggygetaddrinfo" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: good" >&5 -$as_echo "good" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5 -$as_echo "buggy" >&6; } - fi - - if test "$td_cv_buggygetaddrinfo" = "yes"; then - # - # XXX - it doesn't appear that "ipv6type" can ever be - # set to "linux". Should this be testing for - # "linux-glibc", or for that *or* "linux-libinet6"? - # If the latter, note that "linux-libinet6" is also - # the type given to some non-Linux OSes. - # - if test "$ipv6type" != "linux"; then - echo 'Fatal: You must get working getaddrinfo() function.' - echo ' or you can specify "--disable-ipv6"'. - exit 1 - else - echo 'Warning: getaddrinfo() implementation on your system seems be buggy.' - echo ' Better upgrade your system library to newest version' - echo ' of GNU C library (aka glibc).' - fi - fi - -fi - - ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" -if test "x$ac_cv_func_getnameinfo" = xyes; then : - $as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" getnameinfo.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS getnameinfo.$ac_objext" - ;; -esac - -fi - - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_htoa declaration in netdnet/dnetdb.h" >&5 $as_echo_n "checking for dnet_htoa declaration in netdnet/dnetdb.h... " >&6; } if ${td_cv_decl_netdnet_dnetdb_h_dnet_htoa+:} false; then : @@ -5291,116 +5085,6 @@ $as_echo "#define HAVE_NETDNET_DNETDB_H_DNET_HTOA 1" >>confdefs.h fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5 -$as_echo_n "checking for addrinfo... " >&6; } - if ${ac_cv_addrinfo+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include -int -main () -{ -struct addrinfo a - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_addrinfo=yes -else - ac_cv_addrinfo=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_addrinfo" >&5 -$as_echo "$ac_cv_addrinfo" >&6; } - if test $ac_cv_addrinfo = yes; then - -$as_echo "#define HAVE_ADDRINFO 1" >>confdefs.h - - else - -$as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h - - fi - -if test "$ac_cv_addrinfo" = no; then - missing_includes=yes -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NI_MAXSERV" >&5 -$as_echo_n "checking for NI_MAXSERV... " >&6; } - if ${ac_cv_maxserv+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#ifdef NI_MAXSERV -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ac_cv_maxserv=yes -else - ac_cv_maxserv=no -fi -rm -f conftest* - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_maxserv" >&5 -$as_echo "$ac_cv_maxserv" >&6; } - if test $ac_cv_maxserv != yes; then - $as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h - - fi - -if test "$ac_cv_maxserv" = no; then - missing_includes=yes -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NI_NAMEREQD" >&5 -$as_echo_n "checking for NI_NAMEREQD... " >&6; } - if ${ac_cv_namereqd+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#ifdef NI_NOFQDN -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - ac_cv_namereqd=yes -else - ac_cv_namereqd=no -fi -rm -f conftest* - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_namereqd" >&5 -$as_echo "$ac_cv_namereqd" >&6; } - if test $ac_cv_namereqd != yes; then - $as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h - - fi - -if test "$ac_cv_namereqd" = no; then - missing_includes=yes -fi - ac_fn_c_check_func "$LINENO" "vfprintf" "ac_cv_func_vfprintf" if test "x$ac_cv_func_vfprintf" = xyes; then : $as_echo "#define HAVE_VFPRINTF 1" >>confdefs.h @@ -5414,19 +5098,6 @@ esac fi -ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" -if test "x$ac_cv_func_strcasecmp" = xyes; then : - $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" strcasecmp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" - ;; -esac - -fi - ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" if test "x$ac_cv_func_strlcat" = xyes; then : $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h @@ -5800,24 +5471,34 @@ $as_echo "Using $pfopen" >&6; } LIBS="$LIBS $pfopen" fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local pcap library" >&5 + libpcap=FAIL + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local pcap library" >&5 $as_echo_n "checking for local pcap library... " >&6; } - libpcap=FAIL - lastdir=FAIL - places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ - egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` - for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do - basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \ - sed -e 's/-PRE-GIT$//' ` - if test $lastdir = $basedir ; then - continue; - fi - lastdir=$dir - if test -r $dir/libpcap.a ; then - libpcap=$dir/libpcap.a - d=$dir - fi - done + +# Check whether --with-system-libpcap was given. +if test "${with_system_libpcap+set}" = set; then : + withval=$with_system_libpcap; +fi + + if test "x$with_system_libpcap" != xyes ; then + lastdir=FAIL + places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ + egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` + places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ + egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` + for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do + basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \ + sed -e 's/-PRE-GIT$//' ` + if test $lastdir = $basedir ; then + continue; + fi + lastdir=$dir + if test -r $dir/libpcap.a ; then + libpcap=$dir/libpcap.a + d=$dir + fi + done + fi if test $libpcap = FAIL ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } @@ -6002,13 +5683,23 @@ $as_echo "found -- -I$d added" >&6; } V_PCAPDEP=$libpcap places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` + places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ + egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` + pcapH=FAIL if test -r $d/pcap.h; then - V_INCLS="-I$d $V_INCLS" - elif test -r $places/pcap.h; then - V_INCLS="-I$places $V_INCLS" + pcapH=$d else - as_fn_error see INSTALL "cannot find pcap.h" "$LINENO" 5 + for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do + if test -r $dir/pcap.h ; then + pcapH=$dir + fi + done + fi + + if test $pcapH = FAIL ; then + as_fn_error $? "cannot find pcap.h: see INSTALL" "$LINENO" 5 fi + V_INCLS="-I$pcapH $V_INCLS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5 $as_echo "$libpcap" >&6; } # Extract the first word of "pcap-config", so it can be a program name with args. @@ -6123,234 +5814,22 @@ 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 - - - -# -# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate -# libraries (e.g., "-lsocket -lnsl" on Solaris). -# -# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which -# use AC_CHECK_FUNC which doesn't let us specify the right #includes -# to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8 -# resolver, and the way it defines inet_{ntop,pton} is rather strange; -# it does not ship with a libc symbol "inet_ntop()", it ships with -# "_inet_ntop()", and has a #define macro in one of the system headers -# to rename it. -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop" >&5 -$as_echo_n "checking for inet_ntop... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ -char src[4], dst[128]; -inet_ntop(AF_INET, src, dst, sizeof(dst)); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - case " $LIBOBJS " in - *" inet_ntop.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext" - ;; -esac - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5 -$as_echo_n "checking for inet_pton... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ -char src[128], dst[4]; -inet_pton(AF_INET, src, dst); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - case " $LIBOBJS " in - *" inet_pton.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS inet_pton.$ac_objext" - ;; -esac - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5 -$as_echo_n "checking for inet_aton... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -int -main () -{ -char src[128]; -struct in_addr dst; -inet_aton(src, &dst); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - case " $LIBOBJS " in - *" inet_aton.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext" - ;; -esac - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -# -# Check for these after AC_LBL_LIBPCAP, for the same reason. -# -# You are in a twisty little maze of UN*Xes, all different. -# Some might not have ether_ntohost(). -# Some might have it, but not declare it in any header file. -# Some might have it, but declare it in . -# Some might have it, but declare it in -# (And some might have it but document it as something declared in -# , although appears to work.) -# -# Before you is a C compiler. -# -for ac_func in ether_ntohost +# +# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate +# libraries (e.g., "-lsocket -lnsl" on Solaris). +# +# You are in a twisty little maze of UN*Xes, all different. +# Some might not have ether_ntohost(). +# Some might have it, but not declare it in any header file. +# Some might have it, but declare it in . +# Some might have it, but declare it in +# (And some might have it but document it as something declared in +# , although appears to work.) +# +# Before you is a C compiler. +# +for ac_func in ether_ntohost do : ac_fn_c_check_func "$LINENO" "ether_ntohost" "ac_cv_func_ether_ntohost" if test "x$ac_cv_func_ether_ntohost" = xyes; then : @@ -6557,43 +6036,109 @@ if test "x$ac_cv_lib_dlpi_dlpi_walk" = xyes; then : 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 + - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr struct has sa_len member" >&5 -$as_echo_n "checking if sockaddr struct has sa_len member... " >&6; } - if ${ac_cv_sockaddr_has_sa_len+:} false; then : - $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -# include -# include -int -main () -{ -u_int i = sizeof(((struct sockaddr *)0)->sa_len) - ; - return 0; -} + 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 -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sockaddr_has_sa_len=yes + +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 - ac_cv_sockaddr_has_sa_len=no + + case " $LIBOBJS " in + *" dlnames.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dlnames.$ac_objext" + ;; +esac + + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +else + + case " $LIBOBJS " in + *" dlnames.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dlnames.$ac_objext" + ;; +esac + + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sockaddr_has_sa_len" >&5 -$as_echo "$ac_cv_sockaddr_has_sa_len" >&6; } - if test $ac_cv_sockaddr_has_sa_len = yes ; then - $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h - 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 -if test "$ac_cv_sockaddr_has_sa_len" = no; then - missing_includes=yes 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, @@ -6644,7 +6189,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" @@ -6699,7 +6248,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 @@ -6958,6 +6507,48 @@ _ACEOF esac +# +# Make sure we have a definition for C99's uintptr_t (regardless of +# whether the environment is a C99 environment or not). +# + + ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : + +$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h + +else + for ac_type in 'unsigned int' 'unsigned long int' \ + 'unsigned long long int'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +cat >>confdefs.h <<_ACEOF +#define uintptr_t $ac_type +_ACEOF + + ac_type= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -z "$ac_type" && break + done +fi + + + # # Define the old BSD specified-width types in terms of the C99 types; # we may need them with libpcap include files. @@ -7336,7 +6927,7 @@ savedcppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $V_INCLS" for ac_header in pcap/bluetooth.h do : - ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include \"tcpdump-stdinc.h\" + ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include \"netdissect-stdinc.h\" " if test "x$ac_cv_header_pcap_bluetooth_h" = xyes; then : cat >>confdefs.h <<_ACEOF @@ -7349,7 +6940,7 @@ done for ac_header in pcap/nflog.h do : - ac_fn_c_check_header_compile "$LINENO" "pcap/nflog.h" "ac_cv_header_pcap_nflog_h" "#include \"tcpdump-stdinc.h\" + ac_fn_c_check_header_compile "$LINENO" "pcap/nflog.h" "ac_cv_header_pcap_nflog_h" "#include \"netdissect-stdinc.h\" " if test "x$ac_cv_header_pcap_nflog_h" = xyes; then : cat >>confdefs.h <<_ACEOF @@ -7362,7 +6953,7 @@ done for ac_header in pcap/usb.h do : - ac_fn_c_check_header_compile "$LINENO" "pcap/usb.h" "ac_cv_header_pcap_usb_h" "#include \"tcpdump-stdinc.h\" + ac_fn_c_check_header_compile "$LINENO" "pcap/usb.h" "ac_cv_header_pcap_usb_h" "#include \"netdissect-stdinc.h\" " if test "x$ac_cv_header_pcap_usb_h" = xyes; then : cat >>confdefs.h <<_ACEOF @@ -7493,87 +7084,349 @@ done done IFS=$as_save_IFS -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + +rm -f os-proto.h + if test "${LBL_CFLAGS+set}" = set; then + V_CCOPT="$V_CCOPT ${LBL_CFLAGS}" + fi + if test -f .devel ; then + # + # Skip all the warning option stuff on some compilers. + # + if test "$ac_lbl_cc_dont_try_gcc_dashW" != yes; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler fails when given an unknown warning option" >&5 +$as_echo_n "checking whether the compiler fails when given an unknown warning option... " >&6; } + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wxyzzy-this-will-never-succeed-xyzzy" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + # + # We're assuming this is clang, where + # -Werror=unknown-warning-option is the appropriate + # option to force the compiler to fail. + # + ac_lbl_unknown_warning_option_error="-Werror=unknown-warning-option" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wall option" >&5 +$as_echo_n "checking whether the compiler supports the -Wall option... " >&6; } + save_CFLAGS="$CFLAGS" + if expr "x-Wall" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wall" + elif expr "x-Wall" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wall" + elif expr "x-Wall" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wall" + else + CFLAGS="$CFLAGS -Wall" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$save_CFLAGS" + V_CCOPT="$V_CCOPT -Wall" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$save_CFLAGS" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wmissing-prototypes option" >&5 +$as_echo_n "checking whether the compiler supports the -Wmissing-prototypes option... " >&6; } + save_CFLAGS="$CFLAGS" + if expr "x-Wmissing-prototypes" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wmissing-prototypes" + elif expr "x-Wmissing-prototypes" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wmissing-prototypes" + elif expr "x-Wmissing-prototypes" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wmissing-prototypes" + else + CFLAGS="$CFLAGS -Wmissing-prototypes" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$save_CFLAGS" + V_CCOPT="$V_CCOPT -Wmissing-prototypes" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$save_CFLAGS" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wstrict-prototypes option" >&5 +$as_echo_n "checking whether the compiler supports the -Wstrict-prototypes option... " >&6; } + save_CFLAGS="$CFLAGS" + if expr "x-Wstrict-prototypes" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wstrict-prototypes" + elif expr "x-Wstrict-prototypes" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wstrict-prototypes" + elif expr "x-Wstrict-prototypes" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wstrict-prototypes" + else + CFLAGS="$CFLAGS -Wstrict-prototypes" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$save_CFLAGS" + V_CCOPT="$V_CCOPT -Wstrict-prototypes" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$save_CFLAGS" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wwrite-strings option" >&5 +$as_echo_n "checking whether the compiler supports the -Wwrite-strings option... " >&6; } + save_CFLAGS="$CFLAGS" + if expr "x-Wwrite-strings" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wwrite-strings" + elif expr "x-Wwrite-strings" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wwrite-strings" + elif expr "x-Wwrite-strings" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wwrite-strings" + else + CFLAGS="$CFLAGS -Wwrite-strings" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$save_CFLAGS" + V_CCOPT="$V_CCOPT -Wwrite-strings" + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + CFLAGS="$save_CFLAGS" + fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wpointer-arith option" >&5 +$as_echo_n "checking whether the compiler supports the -Wpointer-arith option... " >&6; } + save_CFLAGS="$CFLAGS" + if expr "x-Wpointer-arith" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wpointer-arith" + elif expr "x-Wpointer-arith" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wpointer-arith" + elif expr "x-Wpointer-arith" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wpointer-arith" + else + CFLAGS="$CFLAGS -Wpointer-arith" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$save_CFLAGS" + V_CCOPT="$V_CCOPT -Wpointer-arith" -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -fi + CFLAGS="$save_CFLAGS" - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -rm -f os-proto.h - if test "${LBL_CFLAGS+set}" = set; then - V_CCOPT="$V_CCOPT ${LBL_CFLAGS}" - fi - if test -f .devel ; then - # - # Skip all the warning option stuff on some compilers. - # - if test "$ac_lbl_cc_dont_try_gcc_dashW" != yes; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wall option" >&5 -$as_echo_n "checking whether the compiler supports the -Wall option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wcast-qual option" >&5 +$as_echo_n "checking whether the compiler supports the -Wcast-qual option... " >&6; } save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wall" + if expr "x-Wcast-qual" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wcast-qual" + elif expr "x-Wcast-qual" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wcast-qual" + elif expr "x-Wcast-qual" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wcast-qual" + else + CFLAGS="$CFLAGS -Wcast-qual" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7590,7 +7443,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$save_CFLAGS" - V_CCOPT="$V_CCOPT -Wall" + V_CCOPT="$V_CCOPT -Wcast-qual" else @@ -7602,10 +7455,21 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wmissing-prototypes option" >&5 -$as_echo_n "checking whether the compiler supports the -Wmissing-prototypes option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wshadow option" >&5 +$as_echo_n "checking whether the compiler supports the -Wshadow option... " >&6; } save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wmissing-prototypes" + if expr "x-Wshadow" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wshadow" + elif expr "x-Wshadow" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wshadow" + elif expr "x-Wshadow" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wshadow" + else + CFLAGS="$CFLAGS -Wshadow" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7622,7 +7486,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$save_CFLAGS" - V_CCOPT="$V_CCOPT -Wmissing-prototypes" + V_CCOPT="$V_CCOPT -Wshadow" else @@ -7634,10 +7498,21 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wstrict-prototypes option" >&5 -$as_echo_n "checking whether the compiler supports the -Wstrict-prototypes option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wdeclaration-after-statement option" >&5 +$as_echo_n "checking whether the compiler supports the -Wdeclaration-after-statement option... " >&6; } save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wstrict-prototypes" + if expr "x-Wdeclaration-after-statement" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wdeclaration-after-statement" + elif expr "x-Wdeclaration-after-statement" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wdeclaration-after-statement" + elif expr "x-Wdeclaration-after-statement" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wdeclaration-after-statement" + else + CFLAGS="$CFLAGS -Wdeclaration-after-statement" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7654,7 +7529,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$save_CFLAGS" - V_CCOPT="$V_CCOPT -Wstrict-prototypes" + V_CCOPT="$V_CCOPT -Wdeclaration-after-statement" else @@ -7666,10 +7541,21 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wwrite-strings option" >&5 -$as_echo_n "checking whether the compiler supports the -Wwrite-strings option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -pedantic option" >&5 +$as_echo_n "checking whether the compiler supports the -pedantic option... " >&6; } save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wwrite-strings" + if expr "x-pedantic" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -pedantic" + elif expr "x-pedantic" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -pedantic" + elif expr "x-pedantic" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -pedantic" + else + CFLAGS="$CFLAGS -pedantic" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7686,7 +7572,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$save_CFLAGS" - V_CCOPT="$V_CCOPT -Wwrite-strings" + V_CCOPT="$V_CCOPT -pedantic" else @@ -7698,10 +7584,21 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wpointer-arith option" >&5 -$as_echo_n "checking whether the compiler supports the -Wpointer-arith option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wold-style-definition option" >&5 +$as_echo_n "checking whether the compiler supports the -Wold-style-definition option... " >&6; } save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wpointer-arith" + if expr "x-Wold-style-definition" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wold-style-definition" + elif expr "x-Wold-style-definition" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wold-style-definition" + elif expr "x-Wold-style-definition" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -Wold-style-definition" + else + CFLAGS="$CFLAGS -Wold-style-definition" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7718,7 +7615,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$save_CFLAGS" - V_CCOPT="$V_CCOPT -Wpointer-arith" + V_CCOPT="$V_CCOPT -Wold-style-definition" else @@ -7733,7 +7630,18 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -W option" >&5 $as_echo_n "checking whether the compiler supports the -W option... " >&6; } save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -W" + if expr "x-W" : "x-W.*" >/dev/null + then + CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -W" + elif expr "x-W" : "x-f.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -W" + elif expr "x-W" : "x-m.*" >/dev/null + then + CFLAGS="$CFLAGS -Werror -W" + else + CFLAGS="$CFLAGS -W" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8011,42 +7919,6 @@ $as_echo "#define LBL_ALIGN 1" >>confdefs.h fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for h_errno" >&5 -$as_echo_n "checking for h_errno... " >&6; } - if ${ac_cv_var_h_errno+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include -# include -int -main () -{ -int foo = h_errno; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_var_h_errno=yes -else - ac_cv_var_h_errno=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_h_errno" >&5 -$as_echo "$ac_cv_var_h_errno" >&6; } - if test "$ac_cv_var_h_errno" = "yes"; then - -$as_echo "#define HAVE_H_ERRNO 1" >>confdefs.h - - fi - - # Check for OpenSSL libcrypto { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenSSL libcrypto" >&5 $as_echo_n "checking whether to use OpenSSL libcrypto... " >&6; } @@ -8080,7 +7952,19 @@ $as_echo "yes, if available" >&6; } fi if test "$want_libcrypto" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DES_cbc_encrypt in -lcrypto" >&5 + # + # Don't check for libcrypto unless we have its headers; + # Apple, bless their pointy little heads, apparently ship + # libcrypto as a library, but not the header files, in + # El Capitan, probably because they don't want you writing + # nasty portable code that could run on other UN*Xes, they + # want you writing code that uses their Shiny New Crypto + # Library and that only runs on OS X. + # + ac_fn_c_check_header_mongrel "$LINENO" "openssl/crypto.h" "ac_cv_header_openssl_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_crypto_h" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DES_cbc_encrypt in -lcrypto" >&5 $as_echo_n "checking for DES_cbc_encrypt in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_DES_cbc_encrypt+:} false; then : $as_echo_n "(cached) " >&6 @@ -8125,7 +8009,7 @@ _ACEOF fi - for ac_header in openssl/evp.h + for ac_header in openssl/evp.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_evp_h" = xyes; then : @@ -8137,6 +8021,102 @@ fi done + +fi + + +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