summaryrefslogtreecommitdiffstats
path: root/win/tcl.m4
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-27 15:08:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-27 15:08:37 (GMT)
commitf44caa9971f1cb7930e73e6710d87dfd3559e5cd (patch)
tree5f50c8e56f4123a5e4d7950523183c72961868e9 /win/tcl.m4
parent9dc4d62155a906e3cb7a4d11c2332774d2071d83 (diff)
downloadtcl-f44caa9971f1cb7930e73e6710d87dfd3559e5cd.zip
tcl-f44caa9971f1cb7930e73e6710d87dfd3559e5cd.tar.gz
tcl-f44caa9971f1cb7930e73e6710d87dfd3559e5cd.tar.bz2
bug-3511806 implementation
Diffstat (limited to 'win/tcl.m4')
-rw-r--r--win/tcl.m4114
1 files changed, 112 insertions, 2 deletions
diff --git a/win/tcl.m4 b/win/tcl.m4
index 4761941..3c9b2c2 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -441,6 +441,17 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# set various compiler flags depending on whether we are using gcc or cl
+ AC_CACHE_CHECK(for Cygwin version of gcc,
+ ac_cv_cygwin,
+ AC_TRY_COMPILE([
+ #ifdef __CYGWIN__
+ #error cygwin
+ #endif
+ ], [],
+ ac_cv_cygwin=no,
+ ac_cv_cygwin=yes)
+ )
+
AC_MSG_CHECKING([compiler flags])
if test "${GCC}" = "yes" ; then
SHLIB_LD=""
@@ -476,8 +487,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AR="i686-w64-mingw32-ar"
RANLIB="i686-w64-mingw32-ranlib"
RC="i686-w64-mingw32-windres"
- ;;
- esac
+ ;;
+ esac
fi
if test "${SHARED_BUILD}" = "0" ; then
@@ -784,6 +795,105 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
fi
+ if test "${GCC}" = "yes" ; then
+ AC_CACHE_CHECK(for SEH support in compiler,
+ tcl_cv_seh,
+ AC_TRY_RUN([
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ #undef WIN32_LEAN_AND_MEAN
+
+ int main(int argc, char** argv) {
+ int a, b = 0;
+ __try {
+ a = 666 / b;
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER) {
+ return 0;
+ }
+ return 1;
+ }
+ ],
+ tcl_cv_seh=yes,
+ tcl_cv_seh=no,
+ tcl_cv_seh=no)
+ )
+ if test "$tcl_cv_seh" = "no" ; then
+ AC_DEFINE(HAVE_NO_SEH, 1,
+ [Defined when mingw does not support SEH])
+ fi
+
+ #
+ # Check to see if the excpt.h include file provided contains the
+ # definition for EXCEPTION_DISPOSITION; if not, which is the case
+ # with Cygwin's version as of 2002-04-10, define it to be int,
+ # sufficient for getting the current code to work.
+ #
+ AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
+ tcl_cv_eh_disposition,
+ AC_TRY_COMPILE([
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ #undef WIN32_LEAN_AND_MEAN
+ ],
+ [
+ EXCEPTION_DISPOSITION x;
+ ],
+ tcl_cv_eh_disposition=yes,
+ tcl_cv_eh_disposition=no)
+ )
+ if test "$tcl_cv_eh_disposition" = "no" ; then
+ AC_DEFINE(EXCEPTION_DISPOSITION, int,
+ [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
+ fi
+
+
+ # Check to see if winnt.h defines CHAR, SHORT, and LONG
+ # even if VOID has already been #defined. The win32api
+ # used by mingw and cygwin is known to do this.
+
+ AC_CACHE_CHECK(for winnt.h that ignores VOID define,
+ tcl_cv_winnt_ignore_void,
+ AC_TRY_COMPILE([
+ #define VOID void
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ #undef WIN32_LEAN_AND_MEAN
+ ],
+ [
+ CHAR c;
+ SHORT s;
+ LONG l;
+ ],
+ tcl_cv_winnt_ignore_void=yes,
+ tcl_cv_winnt_ignore_void=no)
+ )
+ if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
+ AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
+ [Defined when cygwin/mingw ignores VOID define in winnt.h])
+ fi
+
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ AC_CACHE_CHECK(for cast to union support,
+ tcl_cv_cast_to_union,
+ AC_TRY_COMPILE([],
+ [
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+ ],
+ tcl_cv_cast_to_union=yes,
+ tcl_cv_cast_to_union=no)
+ )
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+ AC_DEFINE(HAVE_CAST_TO_UNION, 1,
+ [Defined when compiler supports casting to union type.])
+ fi
+ fi
+
+
# DL_LIBS is empty, but then we match the Unix version
AC_SUBST(DL_LIBS)
AC_SUBST(CFLAGS_DEBUG)