From 8e18ff8193c1f45e2c8b0ef4a94f4ff314c1b8b6 Mon Sep 17 00:00:00 2001
From: Mikko Koppanen <mkoppanen@php.net>
Date: Tue, 16 Nov 2010 13:55:10 +0000
Subject: [PATCH 1/5] Fix mingw32 build

Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
---
 configure.in      |    3 ++-
 tests/Makefile.am |    9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/configure.in b/configure.in
index 76a0ec6..700a9d1 100644
--- a/configure.in
+++ b/configure.in
@@ -191,7 +191,8 @@ case "${host_os}" in
             [AC_MSG_ERROR([cannot link with rpcrt4.dll.])])
         AC_CHECK_LIB(iphlpapi, main, ,
             [AC_MSG_ERROR([cannot link with iphlpapi.dll.])])
-        CFLAGS="${CFLAGS} -std=c99"
+        # mingw32 defines __int64_t as long long
+        CPPFLAGS="-Wno-long-long ${CPPFLAGS} "
         on_mingw32="yes"
         ;;
     *cygwin*)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e580802..bdc55d2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,8 +6,11 @@ noinst_PROGRAMS = test_pair_inproc \
                   test_pair_tcp \
                   test_reqrep_inproc \
                   test_reqrep_ipc \
-                  test_reqrep_tcp \
-                  test_shutdown_stress
+                  test_reqrep_tcp
+
+if !ON_MINGW
+noinst_PROGRAMS += test_shutdown_stress
+endif
 
 test_pair_inproc_SOURCES = test_pair_inproc.cpp testutil.hpp
 test_pair_ipc_SOURCES = test_pair_ipc.cpp testutil.hpp
@@ -17,6 +20,8 @@ test_reqrep_inproc_SOURCES = test_reqrep_inproc.cpp testutil.hpp
 test_reqrep_ipc_SOURCES = test_reqrep_ipc.cpp testutil.hpp
 test_reqrep_tcp_SOURCES = test_reqrep_tcp.cpp testutil.hpp
 
+if !ON_MINGW
 test_shutdown_stress_SOURCES = test_shutdown_stress.cpp
+endif
 
 TESTS = $(noinst_PROGRAMS)
-- 
1.7.1

