Skip to content
This repository
Browse code

added: support for compiling under cygwin.

  • Loading branch information...
commit f71a8d3136970aef184bbab071532a23903584d2 1 parent deb8603
Eric Lauzon binf authored committed
67 configure.in
@@ -109,6 +109,10 @@ case "$host" in
109 109 AC_DEFINE([BROKEN_SIOCGIFMTU],[1],[Define if broken SIOCGIFMTU])
110 110 LDFLAGS="${LDFLAGS} -L/sw/lib"
111 111 extra_incl="-I/sw/include"
  112 + ;;
  113 + *-cygwin*)
  114 + AC_DEFINE([CYGWIN],[1],[Define if CYGWIN])
  115 + ;;
112 116 esac
113 117
114 118 # 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
311 315 LDFLAGS="${LDFLAGS} -L${with_libpfring_libraries}"
312 316 fi
313 317
  318 +
  319 +PCAP_HEADERS=""
  320 +# Test for pcap headers
  321 +
  322 +AC_CHECK_HEADERS(pcap.h,,PCAP_HEADERS="no")
  323 +
  324 +if test "x$PCAP_HEADERS" = "xno"; then
  325 +
  326 + if test "x$CYGWIN" = "x1" ; then
  327 +
  328 + echo
  329 + echo " ERROR: You will need to get Winpcap, install libraries and headers in your path"
  330 + echo " Downlad from http://www.winpcap.org, uncompress it and copy */Lib/* to your lib path (/lib)"
  331 + echo " and */Include/* to your include path (/usr/include)"
  332 + echo " or use the --with-libpcap-* options, if you have it installed"
  333 + echo " in unusual place. Also check if your libpcap depends on another"
  334 + echo " shared library that may be installed in an unusual place"
  335 +
  336 + exit 1
  337 +
  338 + else
  339 +
  340 + echo
  341 + echo " ERROR! Libpcap library/headers (libpcap.a (or .so)/pcap.h)"
  342 + echo " not found, go get it from http://www.tcpdump.org"
  343 + echo " or use the --with-libpcap-* options, if you have it installed"
  344 + echo " in unusual place. Also check if your libpcap depends on another"
  345 + echo " shared library that may be installed in an unusual place"
  346 + exit 1
  347 +
  348 + fi
  349 +
  350 +fi
  351 +
  352 +
314 353 LPCAP=""
315   -AC_CHECK_LIB(pcap, pcap_datalink,, LPCAP="no")
  354 +
  355 +if test "x$with_libpcap_libraries" != "xyes"; then
  356 + if test "x$CYGWIN" = "x1"; then
  357 + AC_CHECK_LIB(wpcap, pcap_datalink,, LPCAP="no")
  358 + else
  359 + AC_CHECK_LIB(pcap, pcap_datalink,, LPCAP="no")
  360 + fi
  361 +fi
  362 +
316 363
317 364 # If the normal AC_CHECK_LIB for pcap fails then check to see if we are
318 365 # using a pfring-enabled pcap.
@@ -336,6 +383,21 @@ fi
336 383 # If both the AC_CHECK_LIB for normal pcap and pfring-enabled pcap fail then exit.
337 384 if test "x$LPCAP" = "xno"; then
338 385 if test "x$LPFRING_PCAP" = "xno"; then
  386 +
  387 + if test "x$CYGWIN" = "1" ; then
  388 +
  389 + echo
  390 + echo " ERROR: You will need to get Winpcap, install libraries and headers in your path"
  391 + echo " Downlad from http://www.winpcap.org, uncompress it and copy */Lib/* to your lib path (/lib)"
  392 + echo " and */Include/* to your include path (/usr/include)"
  393 + echo " or use the --with-libpcap-* options, if you have it installed"
  394 + echo " in unusual place. Also check if your libpcap depends on another"
  395 + echo " shared library that may be installed in an unusual place"
  396 +
  397 + exit 1
  398 +
  399 + else
  400 +
339 401 echo
340 402 echo " ERROR! Libpcap library/headers (libpcap.a (or .so)/pcap.h)"
341 403 echo " not found, go get it from http://www.tcpdump.org"
@@ -343,6 +405,9 @@ if test "x$LPCAP" = "xno"; then
343 405 echo " in unusual place. Also check if your libpcap depends on another"
344 406 echo " shared library that may be installed in an unusual place"
345 407 exit 1
  408 +
  409 + fi
  410 +
346 411 fi
347 412 fi
348 413
3  src/barnyard2.c
@@ -1825,7 +1825,8 @@ static void SetNoCores(void)
1825 1825
1826 1826 static void InitSignals(void)
1827 1827 {
1828   -#ifndef WIN32
  1828 +#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__) && \
  1829 + !defined( __CYGWIN64__)
1829 1830 # if defined(LINUX) || defined(FREEBSD) || defined(OPENBSD) || \
1830 1831 defined(SOLARIS) || defined(BSD) || defined(MACOS)
1831 1832 sigset_t set;
3  src/plugbase.h
@@ -45,7 +45,10 @@
45 45 # include <sys/socket.h>
46 46 #endif
47 47
  48 +#if !defined(__SOLARIS__) && !defined(__CYGWIN32__) && !defined(__CYGWIN__) && \
  49 + !defined( __CYGWIN64__)
48 50 #include <net/route.h>
  51 +#endif
49 52
50 53 #ifdef ENABLE_SSL
51 54 # undef Free
3  src/util.c
@@ -1986,7 +1986,8 @@ int GetLocalTimezone()
1986 1986 time(&ut);
1987 1987 ltm = localtime(&ut);
1988 1988
1989   -#if defined(WIN32) || defined(SOLARIS) || defined(AIX) || defined(HPUX)
  1989 +#if defined(WIN32) || defined(SOLARIS) || defined(AIX) || defined(HPUX) ||\
  1990 + defined(__CYGWIN__) || defined( __CYGWIN64__) || defined(__CYGWIN__)
1990 1991 /* localtime() sets the global timezone variable,
1991 1992 which is defined in <time.h> */
1992 1993 seconds_away_from_utc = timezone;

0 comments on commit f71a8d3

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