THRIFT-1462 add more strict compiler flags
FIX: check for MINGW and use reduced compiler flag set for mingw

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1213523 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am
index 1787656..28813dc 100644
--- a/compiler/cpp/Makefile.am
+++ b/compiler/cpp/Makefile.am
@@ -86,7 +86,13 @@
                   src/generate/t_go_generator.cc
 
 thrift_CPPFLAGS = -I$(srcdir)/src
+
+if MINGW
+thrift_CXXFLAGS = -Wall
+else
 thrift_CXXFLAGS = -Wall -Wextra -std=c++0x -pedantic
+endif
+
 thrift_LDADD = @LEXLIB@ libparse.a
 
 libparse_a_CPPFLAGS = -I$(srcdir)/src
diff --git a/configure.ac b/configure.ac
index 37d9d75..aa8a16e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -283,6 +283,18 @@
 fi
 AM_CONDITIONAL(WITH_TESTS, [test "$have_tests" = "yes"])
 
+AM_CONDITIONAL(MINGW, false)
+case "${host_os}" in
+*mingw*)
+  mingw32_support="yes"
+  AC_CHECK_HEADER(windows.h)
+  AM_CONDITIONAL(MINGW, true)
+  ;;
+*)
+  AC_ISC_POSIX
+  ;;
+esac
+
 AC_C_CONST
 AC_C_INLINE
 AC_C_VOLATILE