- #
- # We have BPF, so build valgrindtest with "make test".
- #
- VALGRINDTEST=valgrindtest
-elif test -r /usr/include/sys/dlpi.h ; then
- V_PCAP=dlpi
-elif test -c /dev/enet ; then # check again in case not readable
- V_PCAP=enet
-elif test -c /dev/nit ; then # check again in case not readable
- V_PCAP=snit
-else
- V_PCAP=null
+ for ac_header in linux/socket.h net/raw.h sys/dlpi.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test "$ac_cv_header_net_bpf_h" = yes; then
+ #
+ # BPF.
+ # Check this before DLPI, so that we pick BPF on
+ # Solaris 11 and later.
+ #
+ V_PCAP=bpf
+
+ #
+ # We have BPF, so build valgrindtest with "make test"
+ # on macOS, FreeBSD, and Linux (add your OS once
+ # there's a valgrind for it).
+ #
+ case "$host_os" in
+
+ freebsd*|darwin*|linux*)
+ VALGRINDTEST=valgrindtest
+ ;;
+ esac
+ elif test "$ac_cv_header_net_pfilt_h" = yes; then
+ V_PCAP=pf
+ elif test "$ac_cv_header_net_enet_h" = yes; then
+ V_PCAP=enet
+ elif test "$ac_header_net_nit_h" = yes; then
+ V_PCAP=snit
+ elif test "$ac_header_sys_net_nit_h" = yes; then
+ V_PCAP=nit
+ elif test "$ac_header_linux_socket_h" = yes; then
+ V_PCAP=linux
+
+ #
+ # XXX - this won't work with older kernels that have
+ # SOCK_PACKET sockets but not PF_PACKET sockets.
+ #
+ VALGRINDTEST=valgrindtest
+ elif test "$ac_header_net_raw_h" = yes; then
+ V_PCAP=snoop
+ elif test "$ac_header_sys_dlpi_h" = yes; then
+ V_PCAP=dlpi
+ else
+ V_PCAP=null
+ fi