[prev in list] [next in list] [prev in thread] [next in thread] 

List:       winpcap-users
Subject:    Re: [Winpcap-users] [PATCH] mingw build
From:       "Gianluca Varenni" <gianluca.varenni () cacetech ! com>
Date:       2010-11-12 21:49:59
Message-ID: 5A734B0054A34FC2A30F1719A91A7C40 () NELSON3
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Alon,

sorry for taking so much time in getting back to you. I've been extremely busy after \
the recent acquisition and I haven't found time to work on it. I plan to work again \
on it within the next couple of weeks.

Have a nice day
GV



From: Alon Bar-Lev 
Sent: Thursday, October 21, 2010 4:10 AM
To: winpcap-users@winpcap.org 
Subject: Re: [Winpcap-users] [PATCH] mingw build


I use the simple way...

Gentoo's crossdev

crossdev -t i686-w64-mingw32
crossdev -t x86_64-w64-mingw32


On Wed, Oct 20, 2010 at 2:39 AM, Gianluca Varenni <gianluca.varenni@cacetech.com> \
wrote:

  That should work.

  Can you tell me the exact steps and environment that you use to target 32bit
  with MINGW64?


  Have a nice day
  GV



  --------------------------------------------------

  From: "Alon Bar-Lev" <alon.barlev@gmail.com>

  Sent: Tuesday, October 19, 2010 10:33 AM

  To: <winpcap-users@winpcap.org>
  Subject: Re: [Winpcap-users] [PATCH] mingw build

  > Hi,
  >
  > No I don't use -m32, you can build cross compile that targets 32bit
  > without multilib...
  > But it is not such important.
  >
  > What I am suggesting is a simple Makefile rule, or just use the
  > autoconf provided with libpcap anyway... but if not, please consider
  > the following, then #include config.h, and use its constants to
  > conditionally do whatever.
  >
  > target: config.h
  >
  > config.h:
  >        -rm config.h config.h.tmp
  >        touch config.h.tmp
  >        echo "#include <windows.h>" > conftest.c
  >        echo "#include <ntddndis.h>" >> conftest.c
  >        $(CC) -c conftest.c > /dev/null 2>&1 && echo "#define
  > HAVE_NTDDNDIS_H 1" >> config.h.tmp || true
  >        echo "#include <windows.h>" > conftest.c
  >        echo "#include <ddk/ntddndis.h>" >> conftest.c
  >        $(CC) -c conftest.c > /dev/null 2>&1 && echo "#define
  > HAVE_DDK_NTDDNDIS_H 1" >> config.h.tmp || true
  >        echo "int getaddrinfo();int main(void){getaddrinfo();}" >
  > conftest.c
  >        $(CC) conftest.c -lws2_32 > /dev/null 2>&1 && echo "#define
  > HAVE_GETADDRINFO 1" >> config.h.tmp || true
  >        mv config.h.tmp config.h
  >
  >
  >
  > On Tue, Oct 19, 2010 at 6:51 PM, Gianluca Varenni
  > <gianluca.varenni@cacetech.com> wrote:
  >>
  >>
  >> --------------------------------------------------
  >> From: "Alon Bar-Lev" <alon.barlev@gmail.com>
  >> Sent: Tuesday, October 19, 2010 12:16 AM
  >> To: <winpcap-users@winpcap.org>
  >> Subject: Re: [Winpcap-users] [PATCH] mingw build
  >>
  >>> Hi,
  >>>
  >>> This is incorrect:
  >>> ---
  >>> #ifdef __MINGW32__
  >>> +#ifdef __MINGW64__
  >>> +#include <ntddndis.h>
  >>> +#else /*__MINGW64__*/
  >>> #include <ddk/ntddndis.h>
  >>> +#endif /*__MINGW64__*/
  >>> #else
  >>> ---
  >>>
  >>> As mingw-w64 can be used as both 32bit and 64bit (i686-w64-mingw32,
  >>> x86_64-w64-mingw32).
  >>> So you fix this for 64bit but if you use 32bit you will get the same
  >>> error.
  >>
  >> I think I know what you mean now (after searching more on the internet).
  >> You
  >> are using MINGW64 *and* the option -m32 to generate 32bit binaries. I
  >> didn't
  >> know about the existence of -m32 ...
  >>
  >> Regarding the addition of the ddk include in the makefile, the reason why
  >> I
  >> didn't do that is because I couldn't find a definition of the default
  >> include folder for that specific toolchain (and that works on mingw,
  >> mingw64, mingw64 with -m32, linux, windows, cygwin). Ideally the addition
  >> should be something like
  >>
  >> CFLAGS = ........  -I ${default_include_dir}/ddk
  >>
  >> but I haven't  found what is the right env variable that I should put in
  >> place of "default_include_dir". I don't want to put an absolute path
  >> there.
  >>
  >> I'm definitely open to suggestions...
  >>
  >> Have a nice day
  >> GV
  >>
  >>
  >>>
  >>> What I recommend is to add ddk include file LAST in the CPP search
  >>> list in make file.
  >>>
  >>> Same goes to:
  >>> +/*
  >>> + * Mingw64 has its own implementation of getaddrinfo, mingw32 no
  >>> + */
  >>> +#ifndef __MINGW64__
  >>> +
  >>> +
  >>>
  >>> Best to have it done in Makefile, by trying to compile something with
  >>> getaddrinfo and create mini config.h file.
  >>>
  >>> If you want I can create such a patch. And if we do this, we can also
  >>> check if the ddk is needed or not using the same method.
  >>>
  >>> Regards,
  >>> Alon Bar-Lev.
  >>>
  >>> On Tue, Oct 19, 2010 at 12:19 AM, Gianluca Varenni
  >>> <gianluca.varenni@cacetech.com> wrote:
  >>>>
  >>>> I reworked the patch originally provided by Alon Bar-Lev (thanks!) a
  >>>> bit
  >>>> to
  >>>> have WinPcap 4.1.2 compile under MINGW32 and MINGW64, Windows and Linux
  >>>> cross compilation.
  >>>>
  >>>> You can find it at
  >>>>
  >>>> http://www.winpcap.org/install/bin/WinPcap_4_1_2_mingw_win.patch
  >>>> http://www.winpcap.org/install/bin/WinPcap_4_1_2_mingw_linux.patch
  >>>>
  >>>> MD5's are as follows:
  >>>>
  >>>> 6cecf64649cfd4f32553025d2b6daa96 *WinPcap_4_1_2_mingw_linux.patch
  >>>> 8b341ba39bb0b621c81f5c8df7e7536a *WinPcap_4_1_2_mingw_win.patch
  >>>>
  >>>> Due to a big mess with line endings in the source code of WinPcap 4.1.2
  >>>> (some files have the CR/LF line ending, some have the LF one), the
  >>>> patch
  >>>> that was working on Windows  (with patch.exe coming from cygwin or
  >>>> MSYS)
  >>>> was
  >>>> not working on linux, and viceversa. So I created two patch files for
  >>>> WinPcap 4.1.2.
  >>>>
  >>>> The resulting patched WinPcap 4.1.2 was tested on
  >>>> - Cygwin 1.7
  >>>> - MSYS+MINGW64 (I used the TDM-GCC one at http://tdm-gcc.tdragon.net/)
  >>>> - MSYS+MINGW32 (I used the TDM-GCC one at http://tdm-gcc.tdragon.net/)
  >>>> - MINGW32 on a debian "squeeze" machine
  >>>> - MINGW64 on a debian "squeeze" machine
  >>>>
  >>>> Also, the same patches were committed on the WinPcap repository +
  >>>> libpcap
  >>>> repository (HEAD and libpcap_1.1 branch).
  >>>>
  >>>> Have a nice day
  >>>> GV
  >>>>
  >>>>
  >>>>
  >>>> --------------------------------------------------
  >>>> From: "Gianluca Varenni" <gianluca.varenni@cacetech.com>
  >>>> Sent: Tuesday, October 12, 2010 9:43 AM
  >>>> To: <winpcap-users@winpcap.org>
  >>>> Subject: Re: [Winpcap-users] [PATCH] mingw build
  >>>>
  >>>> >
  >>>> >
  >>>> > --------------------------------------------------
  >>>> > From: "Guy Harris" <guy@alum.mit.edu>
  >>>> > Sent: Wednesday, October 06, 2010 5:02 PM
  >>>> > To: <winpcap-users@winpcap.org>
  >>>> > Subject: Re: [Winpcap-users] [PATCH] mingw build
  >>>> >
  >>>> >>
  >>>> >> On Sep 14, 2010, at 9:17 AM, Alon Bar-Lev wrote:
  >>>> >>
  >>>> >>> 4. grammar.y - any idea why we need pcap_parse if yacc defines it
  >>>> >>> anyway instead of yyparse?
  >>>> >>
  >>>> >> Because
  >>>> >>
  >>>> >> 1) WinPcap is based on libpcap;
  >>>> >>
  >>>> >> 2) libpcap was originally written back when many UN*Xes had only the
  >>>> >> old
  >>>> >> AT&T YACC, which only defined yyparse().
  >>>> >>
  >>>> >> The current top-of-trunk version of grammar.y, at least, defines
  >>>> >> pcap_parse() only if YYBISON is not defined, which presumably means
  >>>> >> "not
  >>>> >> Bison".
  >>>> >>
  >>>> >>> 5. yacc does not accept -y argument.
  >>>> >>
  >>>> >> Earlier versions of GNUmakefile mirrored the UN*X Makefile.in, and
  >>>> >> had
  >>>> >> a
  >>>> >> YACC variable that ran Bison, rather than YACC, with the "-y" flag
  >>>> >> (which,
  >>>> >> for Bison, means "act like YACC and produce y.tab.c and y.tab.h
  >>>> >> files").
  >>>> >>
  >>>> >> The 4.1.2 version runs whatever make sets YACC to refer to, with the
  >>>> >> YFLAGS flag.  Is there some reason why that was done?
  >>>> >
  >>>> > No idea. The original GNUMakefile was contributed by someone and
  >>>> > included
  >>>> > into the WinPcap sources.
  >>>> > I modified GNUMakefile to
  >>>> > 1. define "BISON = bison" and "FLEX = flex"
  >>>> > 2. use ${BISON} to compile grammar.y
  >>>> >
  >>>> >
  >>>> >> Was this to support parser-generators *other* than Bison?  Unless
  >>>> >> there's
  >>>> >> a compelling reason not to run Bison, it should probably go back to
  >>>> >> the
  >>>> >> way it was, using Bison - that'll fix that problem *and* the
  >>>> >> previous
  >>>> >> problem, with no changes required to grammar.y.
  >>>> >>
  >>>> >> If there *is* a compelling reason not to run Bison, then
  >>>> >>
  >>>> >> 1) it should not include "-y"
  >>>> >>
  >>>> >> and
  >>>> >>
  >>>> >> 2) either it should not do "-p pcap_", if whatever version of YACC
  >>>> >> is
  >>>> >> being used doesn't support "-p", or:
  >>>> >>
  >>>> >> 2a) grammar.y should check for YYBISON *and* some other #define
  >>>> >> named
  >>>> >> appropriately for whatever parser-generator is being used
  >>>> >>
  >>>> >> and
  >>>> >>
  >>>> >> 2b) it should do "-D{that #define name}".
  >>>> >>
  >>>> >>> 7. Minor modification of (char*)A += code.
  >>>> >>
  >>>> >> (I.e., "casting lvalues considered harmful - and possibly rejected
  >>>> >> by
  >>>> >> some
  >>>> >> compilers.")
  >>>> >
  >>>> > I will commit it on the libpcap git repository as soon as possible.
  >>>> >
  >>>> > Have a nice day
  >>>> > GV
  >>>> >
  >>>> >> _______________________________________________
  >>>> >> Winpcap-users mailing list
  >>>> >> Winpcap-users@winpcap.org
  >>>> >> https://www.winpcap.org/mailman/listinfo/winpcap-users
  >>>> >
  >>>> > _______________________________________________
  >>>> > Winpcap-users mailing list
  >>>> > Winpcap-users@winpcap.org
  >>>> > https://www.winpcap.org/mailman/listinfo/winpcap-users
  >>>>
  >>>> _______________________________________________
  >>>> Winpcap-users mailing list
  >>>> Winpcap-users@winpcap.org
  >>>> https://www.winpcap.org/mailman/listinfo/winpcap-users
  >>> _______________________________________________
  >>> Winpcap-users mailing list
  >>> Winpcap-users@winpcap.org
  >>> https://www.winpcap.org/mailman/listinfo/winpcap-users
  >>>
  >> _______________________________________________
  >> Winpcap-users mailing list
  >> Winpcap-users@winpcap.org
  >> https://www.winpcap.org/mailman/listinfo/winpcap-users
  >>
  > _______________________________________________
  > Winpcap-users mailing list
  > Winpcap-users@winpcap.org
  > https://www.winpcap.org/mailman/listinfo/winpcap-users
  >
  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users@winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users





--------------------------------------------------------------------------------


_______________________________________________
Winpcap-users mailing list
Winpcap-users@winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=utf-8 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16671"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px" 
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV><FONT face=Calibri>Alon,</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>sorry for taking so much time in getting back to you. 
I've been extremely busy after the recent acquisition and I haven't found time 
to work on it. I plan to work again on it within the next couple of 
weeks.</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>Have a nice day</FONT></DIV>
<DIV><FONT face=Calibri>GV</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=alon.barlev@gmail.com 
href="mailto:alon.barlev@gmail.com">Alon Bar-Lev</A> </DIV>
<DIV><B>Sent:</B> Thursday, October 21, 2010 4:10 AM</DIV>
<DIV><B>To:</B> <A 
title="mailto:winpcap-users@winpcap.org&#10;CTRL + Click to follow link" 
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV><B>Subject:</B> Re: [Winpcap-users] [PATCH] mingw build</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV dir=ltr>I use the simple way...<BR><BR>Gentoo's crossdev<BR><BR>crossdev -t 
i686-w64-mingw32<BR>crossdev -t x86_64-w64-mingw32<BR><BR>
<DIV class=gmail_quote>On Wed, Oct 20, 2010 at 2:39 AM, Gianluca Varenni <SPAN 
dir=ltr>&lt;<A 
href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</A>&gt;</SPAN> \
 wrote:<BR>
<BLOCKQUOTE 
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; \
PADDING-LEFT: 1ex"  class=gmail_quote>That should work.<BR><BR>Can you tell me the \
exact steps and   environment that you use to target 32bit<BR>with MINGW64?<BR>
  <DIV class=im><BR>Have a nice 
  day<BR>GV<BR><BR><BR><BR>--------------------------------------------------<BR></DIV>
  <DIV class=im>From: "Alon Bar-Lev" &lt;<A 
  href="mailto:alon.barlev@gmail.com">alon.barlev@gmail.com</A>&gt;<BR></DIV>Sent: 
  Tuesday, October 19, 2010 10:33 AM<BR>
  <DIV>
  <DIV></DIV>
  <DIV class=h5>To: &lt;<A 
  href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A>&gt;<BR>Subject: \
  Re: [Winpcap-users] [PATCH] mingw build<BR><BR>&gt; Hi,<BR>&gt;<BR>&gt; No I 
  don't use -m32, you can build cross compile that targets 32bit<BR>&gt; without 
  multilib...<BR>&gt; But it is not such important.<BR>&gt;<BR>&gt; What I am 
  suggesting is a simple Makefile rule, or just use the<BR>&gt; autoconf 
  provided with libpcap anyway... but if not, please consider<BR>&gt; the 
  following, then #include config.h, and use its constants to<BR>&gt; 
  conditionally do whatever.<BR>&gt;<BR>&gt; target: config.h<BR>&gt;<BR>&gt; 
  config.h:<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp;-rm config.h config.h.tmp<BR>&gt; 
  &nbsp; &nbsp; &nbsp; &nbsp;touch config.h.tmp<BR>&gt; &nbsp; &nbsp; &nbsp; 
  &nbsp;echo "#include &lt;windows.h&gt;" &gt; conftest.c<BR>&gt; &nbsp; &nbsp; 
  &nbsp; &nbsp;echo "#include &lt;ntddndis.h&gt;" &gt;&gt; conftest.c<BR>&gt; 
  &nbsp; &nbsp; &nbsp; &nbsp;$(CC) -c conftest.c &gt; /dev/null 2&gt;&amp;1 
  &amp;&amp; echo "#define<BR>&gt; HAVE_NTDDNDIS_H 1" &gt;&gt; config.h.tmp || 
  true<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp;echo "#include &lt;windows.h&gt;" &gt; 
  conftest.c<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp;echo "#include 
  &lt;ddk/ntddndis.h&gt;" &gt;&gt; conftest.c<BR>&gt; &nbsp; &nbsp; &nbsp; 
  &nbsp;$(CC) -c conftest.c &gt; /dev/null 2&gt;&amp;1 &amp;&amp; echo 
  "#define<BR>&gt; HAVE_DDK_NTDDNDIS_H 1" &gt;&gt; config.h.tmp || true<BR>&gt; 
  &nbsp; &nbsp; &nbsp; &nbsp;echo "int getaddrinfo();int 
  main(void){getaddrinfo();}" &gt;<BR>&gt; conftest.c<BR>&gt; &nbsp; &nbsp; 
  &nbsp; &nbsp;$(CC) conftest.c -lws2_32 &gt; /dev/null 2&gt;&amp;1 &amp;&amp; 
  echo "#define<BR>&gt; HAVE_GETADDRINFO 1" &gt;&gt; config.h.tmp || 
  true<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp;mv config.h.tmp 
  config.h<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; On Tue, Oct 19, 2010 at 6:51 PM, 
  Gianluca Varenni<BR>&gt; &lt;<A 
  href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</A>&gt; 
  wrote:<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; 
  --------------------------------------------------<BR>&gt;&gt; From: "Alon 
  Bar-Lev" &lt;<A 
  href="mailto:alon.barlev@gmail.com">alon.barlev@gmail.com</A>&gt;<BR>&gt;&gt; 
  Sent: Tuesday, October 19, 2010 12:16 AM<BR>&gt;&gt; To: &lt;<A 
  href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A>&gt;<BR>&gt;&gt; \
  Subject: Re: [Winpcap-users] [PATCH] mingw build<BR>&gt;&gt;<BR>&gt;&gt;&gt; 
  Hi,<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; This is incorrect:<BR>&gt;&gt;&gt; 
  ---<BR>&gt;&gt;&gt; #ifdef __MINGW32__<BR>&gt;&gt;&gt; +#ifdef 
  __MINGW64__<BR>&gt;&gt;&gt; +#include &lt;ntddndis.h&gt;<BR>&gt;&gt;&gt; 
  +#else /*__MINGW64__*/<BR>&gt;&gt;&gt; #include 
  &lt;ddk/ntddndis.h&gt;<BR>&gt;&gt;&gt; +#endif /*__MINGW64__*/<BR>&gt;&gt;&gt; 
  #else<BR>&gt;&gt;&gt; ---<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; As mingw-w64 can be 
  used as both 32bit and 64bit (i686-w64-mingw32,<BR>&gt;&gt;&gt; 
  x86_64-w64-mingw32).<BR>&gt;&gt;&gt; So you fix this for 64bit but if you use 
  32bit you will get the same<BR>&gt;&gt;&gt; error.<BR>&gt;&gt;<BR>&gt;&gt; I 
  think I know what you mean now (after searching more on the 
  internet).<BR>&gt;&gt; You<BR>&gt;&gt; are using MINGW64 *and* the option -m32 
  to generate 32bit binaries. I<BR>&gt;&gt; didn't<BR>&gt;&gt; know about the 
  existence of -m32 ...<BR>&gt;&gt;<BR>&gt;&gt; Regarding the addition of the 
  ddk include in the makefile, the reason why<BR>&gt;&gt; I<BR>&gt;&gt; didn't 
  do that is because I couldn't find a definition of the default<BR>&gt;&gt; 
  include folder for that specific toolchain (and that works on 
  mingw,<BR>&gt;&gt; mingw64, mingw64 with -m32, linux, windows, cygwin). 
  Ideally the addition<BR>&gt;&gt; should be something 
  like<BR>&gt;&gt;<BR>&gt;&gt; CFLAGS = ........ &nbsp;-I 
  ${default_include_dir}/ddk<BR>&gt;&gt;<BR>&gt;&gt; but I haven't &nbsp;found 
  what is the right env variable that I should put in<BR>&gt;&gt; place of 
  "default_include_dir". I don't want to put an absolute path<BR>&gt;&gt; 
  there.<BR>&gt;&gt;<BR>&gt;&gt; I'm definitely open to 
  suggestions...<BR>&gt;&gt;<BR>&gt;&gt; Have a nice day<BR>&gt;&gt; 
  GV<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; What I recommend is 
  to add ddk include file LAST in the CPP search<BR>&gt;&gt;&gt; list in make 
  file.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Same goes to:<BR>&gt;&gt;&gt; 
  +/*<BR>&gt;&gt;&gt; + * Mingw64 has its own implementation of getaddrinfo, 
  mingw32 no<BR>&gt;&gt;&gt; + */<BR>&gt;&gt;&gt; +#ifndef 
  __MINGW64__<BR>&gt;&gt;&gt; +<BR>&gt;&gt;&gt; 
  +<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Best to have it done in Makefile, by trying 
  to compile something with<BR>&gt;&gt;&gt; getaddrinfo and create mini config.h 
  file.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; If you want I can create such a patch. 
  And if we do this, we can also<BR>&gt;&gt;&gt; check if the ddk is needed or 
  not using the same method.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; 
  Regards,<BR>&gt;&gt;&gt; Alon Bar-Lev.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; On Tue, 
  Oct 19, 2010 at 12:19 AM, Gianluca Varenni<BR>&gt;&gt;&gt; &lt;<A 
  href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</A>&gt; 
  wrote:<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; I reworked the patch originally 
  provided by Alon Bar-Lev (thanks!) a<BR>&gt;&gt;&gt;&gt; 
  bit<BR>&gt;&gt;&gt;&gt; to<BR>&gt;&gt;&gt;&gt; have WinPcap 4.1.2 compile 
  under MINGW32 and MINGW64, Windows and Linux<BR>&gt;&gt;&gt;&gt; cross 
  compilation.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; You can find it 
  at<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; <A 
  href="http://www.winpcap.org/install/bin/WinPcap_4_1_2_mingw_win.patch" 
  target=_blank>http://www.winpcap.org/install/bin/WinPcap_4_1_2_mingw_win.patch</A><BR>&gt;&gt;&gt;&gt; \
  <A href="http://www.winpcap.org/install/bin/WinPcap_4_1_2_mingw_linux.patch" 
  target=_blank>http://www.winpcap.org/install/bin/WinPcap_4_1_2_mingw_linux.patch</A><BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; \
  MD5's are as follows:<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; 
  6cecf64649cfd4f32553025d2b6daa96 
  *WinPcap_4_1_2_mingw_linux.patch<BR>&gt;&gt;&gt;&gt; 
  8b341ba39bb0b621c81f5c8df7e7536a 
  *WinPcap_4_1_2_mingw_win.patch<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; Due to 
  a big mess with line endings in the source code of WinPcap 
  4.1.2<BR>&gt;&gt;&gt;&gt; (some files have the CR/LF line ending, some have 
  the LF one), the<BR>&gt;&gt;&gt;&gt; patch<BR>&gt;&gt;&gt;&gt; that was 
  working on Windows &nbsp;(with patch.exe coming from cygwin 
  or<BR>&gt;&gt;&gt;&gt; MSYS)<BR>&gt;&gt;&gt;&gt; was<BR>&gt;&gt;&gt;&gt; not 
  working on linux, and viceversa. So I created two patch files 
  for<BR>&gt;&gt;&gt;&gt; WinPcap 4.1.2.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; 
  The resulting patched WinPcap 4.1.2 was tested on<BR>&gt;&gt;&gt;&gt; - Cygwin 
  1.7<BR>&gt;&gt;&gt;&gt; - MSYS+MINGW64 (I used the TDM-GCC one at <A 
  href="http://tdm-gcc.tdragon.net/" 
  target=_blank>http://tdm-gcc.tdragon.net/</A>)<BR>&gt;&gt;&gt;&gt; - 
  MSYS+MINGW32 (I used the TDM-GCC one at <A href="http://tdm-gcc.tdragon.net/" 
  target=_blank>http://tdm-gcc.tdragon.net/</A>)<BR>&gt;&gt;&gt;&gt; - MINGW32 
  on a debian "squeeze" machine<BR>&gt;&gt;&gt;&gt; - MINGW64 on a debian 
  "squeeze" machine<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; Also, the same 
  patches were committed on the WinPcap repository +<BR>&gt;&gt;&gt;&gt; 
  libpcap<BR>&gt;&gt;&gt;&gt; repository (HEAD and libpcap_1.1 
  branch).<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; Have a nice 
  day<BR>&gt;&gt;&gt;&gt; 
  GV<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; 
  --------------------------------------------------<BR>&gt;&gt;&gt;&gt; From: 
  "Gianluca Varenni" &lt;<A 
  href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</A>&gt;<BR>&gt;&gt;&gt;&gt; \
  Sent: Tuesday, October 12, 2010 9:43 AM<BR>&gt;&gt;&gt;&gt; To: &lt;<A 
  href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A>&gt;<BR>&gt;&gt;&gt;&gt; \
  Subject: Re: [Winpcap-users] [PATCH] mingw 
  build<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;<BR>&gt;&gt;&gt;&gt; 
  &gt;<BR>&gt;&gt;&gt;&gt; &gt; 
  --------------------------------------------------<BR>&gt;&gt;&gt;&gt; &gt; 
  From: "Guy Harris" &lt;<A 
  href="mailto:guy@alum.mit.edu">guy@alum.mit.edu</A>&gt;<BR>&gt;&gt;&gt;&gt; 
  &gt; Sent: Wednesday, October 06, 2010 5:02 PM<BR>&gt;&gt;&gt;&gt; &gt; To: 
  &lt;<A 
  href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A>&gt;<BR>&gt;&gt;&gt;&gt; \
  &gt; Subject: Re: [Winpcap-users] [PATCH] mingw build<BR>&gt;&gt;&gt;&gt; 
  &gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; On Sep 14, 
  2010, at 9:17 AM, Alon Bar-Lev wrote:<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt;&gt; 4. grammar.y - any idea why we need 
  pcap_parse if yacc defines it<BR>&gt;&gt;&gt;&gt; &gt;&gt;&gt; anyway instead 
  of yyparse?<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  Because<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; 1) WinPcap 
  is based on libpcap;<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  2) libpcap was originally written back when many UN*Xes had only 
  the<BR>&gt;&gt;&gt;&gt; &gt;&gt; old<BR>&gt;&gt;&gt;&gt; &gt;&gt; AT&amp;T 
  YACC, which only defined yyparse().<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; The current top-of-trunk version of 
  grammar.y, at least, defines<BR>&gt;&gt;&gt;&gt; &gt;&gt; pcap_parse() only if 
  YYBISON is not defined, which presumably means<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  "not<BR>&gt;&gt;&gt;&gt; &gt;&gt; Bison".<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt;&gt; 5. yacc does not accept -y 
  argument.<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; Earlier 
  versions of GNUmakefile mirrored the UN*X Makefile.in, and<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt; had<BR>&gt;&gt;&gt;&gt; &gt;&gt; a<BR>&gt;&gt;&gt;&gt; &gt;&gt; YACC 
  variable that ran Bison, rather than YACC, with the "-y" 
  flag<BR>&gt;&gt;&gt;&gt; &gt;&gt; (which,<BR>&gt;&gt;&gt;&gt; &gt;&gt; for 
  Bison, means "act like YACC and produce y.tab.c and 
  y.tab.h<BR>&gt;&gt;&gt;&gt; &gt;&gt; files").<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; The 4.1.2 version runs whatever make 
  sets YACC to refer to, with the<BR>&gt;&gt;&gt;&gt; &gt;&gt; YFLAGS flag. 
  &nbsp;Is there some reason why that was done?<BR>&gt;&gt;&gt;&gt; 
  &gt;<BR>&gt;&gt;&gt;&gt; &gt; No idea. The original GNUMakefile was 
  contributed by someone and<BR>&gt;&gt;&gt;&gt; &gt; 
  included<BR>&gt;&gt;&gt;&gt; &gt; into the WinPcap 
  sources.<BR>&gt;&gt;&gt;&gt; &gt; I modified GNUMakefile 
  to<BR>&gt;&gt;&gt;&gt; &gt; 1. define "BISON = bison" and "FLEX = 
  flex"<BR>&gt;&gt;&gt;&gt; &gt; 2. use ${BISON} to compile 
  grammar.y<BR>&gt;&gt;&gt;&gt; &gt;<BR>&gt;&gt;&gt;&gt; 
  &gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; Was this to support parser-generators 
  *other* than Bison? &nbsp;Unless<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  there's<BR>&gt;&gt;&gt;&gt; &gt;&gt; a compelling reason not to run Bison, it 
  should probably go back to<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  the<BR>&gt;&gt;&gt;&gt; &gt;&gt; way it was, using Bison - that'll fix that 
  problem *and* the<BR>&gt;&gt;&gt;&gt; &gt;&gt; previous<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt; problem, with no changes required to grammar.y.<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; If there *is* a compelling reason not to 
  run Bison, then<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; 1) 
  it should not include "-y"<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt; and<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; 2) 
  either it should not do "-p pcap_", if whatever version of 
  YACC<BR>&gt;&gt;&gt;&gt; &gt;&gt; is<BR>&gt;&gt;&gt;&gt; &gt;&gt; being used 
  doesn't support "-p", or:<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt; 2a) grammar.y should check for YYBISON *and* some other 
  #define<BR>&gt;&gt;&gt;&gt; &gt;&gt; named<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  appropriately for whatever parser-generator is being used<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; and<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; 2b) it should do "-D{that #define 
  name}".<BR>&gt;&gt;&gt;&gt; &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt;&gt; 7. Minor 
  modification of (char*)A += code.<BR>&gt;&gt;&gt;&gt; 
  &gt;&gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; (I.e., "casting lvalues considered 
  harmful - and possibly rejected<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  by<BR>&gt;&gt;&gt;&gt; &gt;&gt; some<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  compilers.")<BR>&gt;&gt;&gt;&gt; &gt;<BR>&gt;&gt;&gt;&gt; &gt; I will commit 
  it on the libpcap git repository as soon as possible.<BR>&gt;&gt;&gt;&gt; 
  &gt;<BR>&gt;&gt;&gt;&gt; &gt; Have a nice day<BR>&gt;&gt;&gt;&gt; &gt; 
  GV<BR>&gt;&gt;&gt;&gt; &gt;<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  _______________________________________________<BR>&gt;&gt;&gt;&gt; &gt;&gt; 
  Winpcap-users mailing list<BR>&gt;&gt;&gt;&gt; &gt;&gt; <A 
  href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR>&gt;&gt;&gt;&gt; \
  &gt;&gt; <A href="https://www.winpcap.org/mailman/listinfo/winpcap-users" 
  target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>&gt;&gt;&gt;&gt; \
  &gt;<BR>&gt;&gt;&gt;&gt; &gt; 
  _______________________________________________<BR>&gt;&gt;&gt;&gt; &gt; 
  Winpcap-users mailing list<BR>&gt;&gt;&gt;&gt; &gt; <A 
  href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR>&gt;&gt;&gt;&gt; \
  &gt; <A href="https://www.winpcap.org/mailman/listinfo/winpcap-users" 
  target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; \
  _______________________________________________<BR>&gt;&gt;&gt;&gt; 
  Winpcap-users mailing list<BR>&gt;&gt;&gt;&gt; <A 
  href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR>&gt;&gt;&gt;&gt; \
  <A href="https://www.winpcap.org/mailman/listinfo/winpcap-users" 
  target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>&gt;&gt;&gt; \
  _______________________________________________<BR>&gt;&gt;&gt; Winpcap-users 
  mailing list<BR>&gt;&gt;&gt; <A 
  href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR>&gt;&gt;&gt; \
  <A href="https://www.winpcap.org/mailman/listinfo/winpcap-users" 
  target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>&gt;&gt;&gt;<BR>&gt;&gt; \
  _______________________________________________<BR>&gt;&gt; Winpcap-users 
  mailing list<BR>&gt;&gt; <A 
  href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR>&gt;&gt; 
  <A href="https://www.winpcap.org/mailman/listinfo/winpcap-users" 
  target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>&gt;&gt;<BR>&gt; \
  _______________________________________________<BR>&gt; Winpcap-users mailing 
  list<BR>&gt; <A 
  href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR>&gt; 
  <A href="https://www.winpcap.org/mailman/listinfo/winpcap-users" 
  target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>&gt;<BR>_______________________________________________<BR>Winpcap-users \
  mailing list<BR><A 
  href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR><A 
  href="https://www.winpcap.org/mailman/listinfo/winpcap-users" 
  target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV>
 <P>
<HR>

<P></P>_______________________________________________<BR>Winpcap-users mailing 
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BODY></HTML>




_______________________________________________
Winpcap-users mailing list
Winpcap-users@winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic