From: Victor Julien Date: Sat, 15 Jul 2017 07:48:40 +0000 (+0200) Subject: windows: use wpcap instead of pcap X-Git-Tag: suricata-4.0.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1e839eabcc64827fcb4df42ddec339d7931bc84;p=thirdparty%2Fsuricata.git windows: use wpcap instead of pcap Windows pcap libraries such as winpcap all use a library name of wpcap instead of just pcap. Support this in configure. --- diff --git a/configure.ac b/configure.ac index efbdd1e237..ee7408ca3c 100644 --- a/configure.ac +++ b/configure.ac @@ -191,6 +191,7 @@ e_magic_file="" e_magic_file_comment="#" + PCAP_LIB_NAME="pcap" case "$host" in *-*-*freebsd*) LUA_PC_NAME="lua-5.1" @@ -220,11 +221,13 @@ CFLAGS="${CFLAGS} -DOS_WIN32" LDFLAGS="${LDFLAGS} -lws2_32" WINDOWS_PATH="yes" + PCAP_LIB_NAME="wpcap" ;; *-*-cygwin) LUA_PC_NAME="lua" LUA_LIB_NAME="lua" WINDOWS_PATH="yes" + PCAP_LIB_NAME="wpcap" ;; *-*-solaris*) AC_MSG_WARN([support for Solaris/Illumos/SunOS is experimental]) @@ -1078,7 +1081,7 @@ AC_CHECK_HEADERS([pcap.h pcap/pcap.h pcap/bpf.h]) LIBPCAP="" - AC_CHECK_LIB(pcap, pcap_open_live,, LIBPCAP="no") + AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_open_live,, LIBPCAP="no") if test "$LIBPCAP" = "no"; then echo echo " ERROR! libpcap library not found, go get it" @@ -1095,7 +1098,7 @@ #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful TMPLIBS="${LIBS}" - AC_CHECK_LIB(pcap, pcap_activate,, LPCAPVTEST="no") + AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_activate,, LPCAPVTEST="no") if test "$LPCAPVTEST" = "no"; then echo echo " ERROR! libpcap library too old, need at least 1+, " @@ -1120,7 +1123,7 @@ #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful TMPLIBS="${LIBS}" - AC_CHECK_LIB(pcap, pcap_set_buffer_size,, LPCAPSBUFF="no") + AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_set_buffer_size,, LPCAPSBUFF="no") if test "$LPCAPSBUFF" != "no"; then AC_DEFINE([HAVE_PCAP_SET_BUFF],[1],(libpcap has pcap_set_buffer_size function)) fi