[mingw-wpcap: 18/22] Added a patch to fix compatibility with the mingw-w64 toolchain

Kalev Lember kalev at fedoraproject.org
Wed Mar 7 18:13:32 UTC 2012


commit 117795dae3ad2d9c0b52330a5275b2f65c416fc0
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Mon Feb 27 21:03:17 2012 +0100

    Added a patch to fix compatibility with the mingw-w64 toolchain

 mingw32-wpcap.spec                    |   11 +++++++++--
 winpcap-mingw-w64-compatibility.patch |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/mingw32-wpcap.spec b/mingw32-wpcap.spec
index 0e9684f..e989f42 100644
--- a/mingw32-wpcap.spec
+++ b/mingw32-wpcap.spec
@@ -17,6 +17,7 @@ Source0:        http://www.winpcap.org/install/bin/WpcapSrc_%{versionmajor}_%{ve
 Source1:        wpcap.pc
 Patch0:         wpcap.patch
 Patch1:         wpcap-w2k.patch
+Patch2:         winpcap-mingw-w64-compatibility.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
@@ -64,6 +65,7 @@ This package contains the Windows pcap library documentation.
 %setup -q -n winpcap
 
 %patch0 -p0 -b .build
+%patch2 -p0 -b .mingw-w64
 
 find . -type f -print0 |xargs -0 dos2unix
 pushd wpcap/libpcap/Win32/Include/
@@ -76,10 +78,14 @@ find . -name GNUmakefile |xargs perl -i -pe 's,-mno-cygwin,,'
 
 %build
 pushd packetNtx/Dll/Project
-make -f GNUmakefile CC=i686-pc-mingw32-gcc YACC=bison %{?_smp_mflags} 
+make -f GNUmakefile CC=i686-w64-mingw32-gcc YACC=bison %{?_smp_mflags} 
 popd
+
+# Prevent a conflict between getaddrinfo.c and ws2_32
+sed -i s at ../libpcap/Win32/Src/getaddrinfo.o@@ wpcap/PRJ/GNUmakefile
+
 pushd wpcap/PRJ
-make -f GNUmakefile CC=i686-pc-mingw32-gcc YACC=bison %{?_smp_mflags} 
+make -f GNUmakefile CC=i686-w64-mingw32-gcc YACC=bison %{?_smp_mflags} 
 popd
 pushd dox/prj
 doxygen winpcap_noc.dox
@@ -153,6 +159,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Mon Feb 27 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.1.final2-5
 - Rebuild against the mingw-w64 toolchain
+- Added a patch to fix compatibility with the mingw-w64 toolchain
 
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4.1.final2-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
diff --git a/winpcap-mingw-w64-compatibility.patch b/winpcap-mingw-w64-compatibility.patch
new file mode 100644
index 0000000..038a13f
--- /dev/null
+++ b/winpcap-mingw-w64-compatibility.patch
@@ -0,0 +1,32 @@
+--- packetNtx/Dll/Packet32-Int.h.mingw-w64	2008-11-18 12:17:42.000000000 +0100
++++ packetNtx/Dll/Packet32-Int.h	2010-10-13 16:28:41.871425773 +0200
+@@ -42,7 +42,7 @@
+ #include "NpfImExt.h"
+ #endif //HAVE_NPFIM_API
+ 
+-#ifdef __MINGW32__
++#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
+ #include <ddk/ntddndis.h>
+ #else
+ #pragma warning( push )
+--- wpcap/libpcap/pcap-win32.c.orig	2010-10-13 16:42:02.372549515 +0200
++++ wpcap/libpcap/pcap-win32.c	2010-10-13 16:43:28.138601005 +0200
+@@ -38,7 +38,7 @@
+ 
+ #include <pcap-int.h>
+ #include <Packet32.h>
+-#ifdef __MINGW32__
++#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
+ #include <ddk/ndis.h>
+ #else /*__MINGW32__*/
+ #include <ntddndis.h>
+--- wpcap/PRJ/GNUmakefile.mingw-w64	2011-07-12 16:49:46.000000000 +0200
++++ wpcap/PRJ/GNUmakefile	2011-07-12 16:51:07.362061939 +0200
+@@ -32,6 +32,7 @@
+ 	-DHAVE_REMOTE \
+ 	-DHAVE_TC_API \
+ 	-DHAVE_ADDRINFO \
++	-DHAVE___ATTRIBUTE__ \
+ 	-mno-cygwin -shared ${OPTFLAGS}
+ LDFLAGS = -Wl,--out-implib,../lib/libwpcap.a
+ LIBS = -L ../../${PACKET_DIR}/Dll/Project -lPacket -lws2_32


More information about the scm-commits mailing list