Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added: support for compiling under cygwin.

  • Loading branch information...
commit f71a8d3136970aef184bbab071532a23903584d2 1 parent deb8603
@binf binf authored committed
Showing with 73 additions and 3 deletions.
  1. +66 −1 configure.in
  2. +2 −1  src/barnyard2.c
  3. +3 −0  src/plugbase.h
  4. +2 −1  src/util.c
View
67 configure.in
@@ -109,6 +109,10 @@ case "$host" in
AC_DEFINE([BROKEN_SIOCGIFMTU],[1],[Define if broken SIOCGIFMTU])
LDFLAGS="${LDFLAGS} -L/sw/lib"
extra_incl="-I/sw/include"
+ ;;
+ *-cygwin*)
+ AC_DEFINE([CYGWIN],[1],[Define if CYGWIN])
+ ;;
esac
# This is really meant for Solaris Sparc v9 where it has 32bit and 64bit
@@ -311,8 +315,51 @@ if test "x$with_libpfring_libraries" != "xno"; then
LDFLAGS="${LDFLAGS} -L${with_libpfring_libraries}"
fi
+
+PCAP_HEADERS=""
+# Test for pcap headers
+
+AC_CHECK_HEADERS(pcap.h,,PCAP_HEADERS="no")
+
+if test "x$PCAP_HEADERS" = "xno"; then
+
+ if test "x$CYGWIN" = "x1" ; then
+
+ echo
+ echo " ERROR: You will need to get Winpcap, install libraries and headers in your path"
+ echo " Downlad from http://www.winpcap.org, uncompress it and copy */Lib/* to your lib path (/lib)"
+ echo " and */Include/* to your include path (/usr/include)"
+ echo " or use the --with-libpcap-* options, if you have it installed"
+ echo " in unusual place. Also check if your libpcap depends on another"
+ echo " shared library that may be installed in an unusual place"
+
+ exit 1
+
+ else
+
+ echo
+ echo " ERROR! Libpcap library/headers (libpcap.a (or .so)/pcap.h)"
+ echo " not found, go get it from http://www.tcpdump.org"
+ echo " or use the --with-libpcap-* options, if you have it installed"
+ echo " in unusual place. Also check if your libpcap depends on another"
+ echo " shared library that may be installed in an unusual place"
+ exit 1
+
+ fi
+
+fi
+
+
LPCAP=""
-AC_CHECK_LIB(pcap, pcap_datalink,, LPCAP="no")
+
+if test "x$with_libpcap_libraries" != "xyes"; then
+ if test "x$CYGWIN" = "x1"; then
+ AC_CHECK_LIB(wpcap, pcap_datalink,, LPCAP="no")
+ else
+ AC_CHECK_LIB(pcap, pcap_datalink,, LPCAP="no")
+ fi
+fi
+
# If the normal AC_CHECK_LIB for pcap fails then check to see if we are
# using a pfring-enabled pcap.
@@ -336,6 +383,21 @@ fi
# If both the AC_CHECK_LIB for normal pcap and pfring-enabled pcap fail then exit.
if test "x$LPCAP" = "xno"; then
if test "x$LPFRING_PCAP" = "xno"; then
+
+ if test "x$CYGWIN" = "1" ; then
+
+ echo
+ echo " ERROR: You will need to get Winpcap, install libraries and headers in your path"
+ echo " Downlad from http://www.winpcap.org, uncompress it and copy */Lib/* to your lib path (/lib)"
+ echo " and */Include/* to your include path (/usr/include)"
+ echo " or use the --with-libpcap-* options, if you have it installed"
+ echo " in unusual place. Also check if your libpcap depends on another"
+ echo " shared library that may be installed in an unusual place"
+
+ exit 1
+
+ else
+
echo
echo " ERROR! Libpcap library/headers (libpcap.a (or .so)/pcap.h)"
echo " not found, go get it from http://www.tcpdump.org"
@@ -343,6 +405,9 @@ if test "x$LPCAP" = "xno"; then
echo " in unusual place. Also check if your libpcap depends on another"
echo " shared library that may be installed in an unusual place"
exit 1
+
+ fi
+
fi
fi
View
3  src/barnyard2.c
@@ -1825,7 +1825,8 @@ static void SetNoCores(void)
static void InitSignals(void)
{
-#ifndef WIN32
+#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__) && \
+ !defined( __CYGWIN64__)
# if defined(LINUX) || defined(FREEBSD) || defined(OPENBSD) || \
defined(SOLARIS) || defined(BSD) || defined(MACOS)
sigset_t set;
View
3  src/plugbase.h
@@ -45,7 +45,10 @@
# include <sys/socket.h>
#endif
+#if !defined(__SOLARIS__) && !defined(__CYGWIN32__) && !defined(__CYGWIN__) && \
+ !defined( __CYGWIN64__)
#include <net/route.h>
+#endif
#ifdef ENABLE_SSL
# undef Free
View
3  src/util.c
@@ -1986,7 +1986,8 @@ int GetLocalTimezone()
time(&ut);
ltm = localtime(&ut);
-#if defined(WIN32) || defined(SOLARIS) || defined(AIX) || defined(HPUX)
+#if defined(WIN32) || defined(SOLARIS) || defined(AIX) || defined(HPUX) ||\
+ defined(__CYGWIN__) || defined( __CYGWIN64__) || defined(__CYGWIN__)
/* localtime() sets the global timezone variable,
which is defined in <time.h> */
seconds_away_from_utc = timezone;

0 comments on commit f71a8d3

Please sign in to comment.
Something went wrong with that request. Please try again.