diff --git a/Makefile.in b/Makefile.in index 5cccbdd..f9e820d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,7 +9,7 @@ CC= gcc AR=/usr/bin/ar RANLIB=/usr/bin/ranlib -CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@ +CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@ @USE_PCAP_BPF@ DEBUG= -g #uncomment the following if you need libpcap based build under linux #(not raccomanded) diff --git a/configure b/configure index dab04ab..6975f0f 100755 --- a/configure +++ b/configure @@ -102,6 +102,14 @@ then TCL_LIB="-ltcl${LIBPOSTFIX} -lm -lpthread" fi +# +# PCAP_BPF detection +# +if [ -f "/usr/include/pcap/bpf.h" ] +then + USE_PCAP_BPF="-DUSE_PCAP_BPF" +fi + # # configurable stuff # @@ -140,6 +148,7 @@ sed -e "s^@PCAP@^$PCAP^g" \ -e "s^@MANPATH@^$INSTALL_MANPATH^g" \ -e "s^@SOLARISLIB@^$SOLARISLIB^g" \ -e "s^@USE_TCL@^$USE_TCL^g" \ + -e "s^@USE_PCAP_BPF@^$USE_PCAP_BPF^g" \ -e "s^@TCL_INC@^$TCL_INC^g" \ -e "s^@TCL_VER@^$TCL_VER^g" \ -e "s^@TCL_LIB@^$TCL_LIB^g" \ diff --git a/libpcap_stuff.c b/libpcap_stuff.c index 26f9993..d93fba5 100644 --- a/libpcap_stuff.c +++ b/libpcap_stuff.c @@ -16,7 +16,11 @@ #include #include #include +#ifdef USE_PCAP_BPF +#include +#else #include +#endif #include #include "globals.h" diff --git a/script.c b/script.c index 124370c..507bd8f 100644 --- a/script.c +++ b/script.c @@ -23,7 +23,13 @@ #include #include + +#ifdef USE_PCAP_BPF +#include +#else #include +#endif + #include #include "release.h"