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