diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-30 09:49:25 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-30 09:49:25 (GMT) |
commit | 59c52ee2fb7fcc819a92861101a8dd4b77c9f606 (patch) | |
tree | ae1366468409076e10cf9e8952fe77bd51012e4e /unix/tcl.m4 | |
parent | e4e0688230bab9b433d43f26f6a9e36b0a32b083 (diff) | |
parent | 3a73c145323d7a85af7f9e5ad7de9e601cbaf903 (diff) | |
download | tcl-59c52ee2fb7fcc819a92861101a8dd4b77c9f606.zip tcl-59c52ee2fb7fcc819a92861101a8dd4b77c9f606.tar.gz tcl-59c52ee2fb7fcc819a92861101a8dd4b77c9f606.tar.bz2 |
[Bug 3511806] Compiler checks too early
(autoconf still to be run!)
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r-- | unix/tcl.m4 | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4 index fe9b136..ca77586 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1237,7 +1237,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; - CYGWIN_*) + CYGWIN_*|MINGW32*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" @@ -1248,6 +1248,19 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' TCL_SHLIB_LD_EXTRAS='-Wl,--out-implib,$[@].a' + 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) + ) + if test "$ac_cv_cygwin" = "no"; then + AC_MSG_ERROR([${CC} is not a cygwin compiler.]) + fi ;; dgux*) SHLIB_CFLAGS="-K PIC" @@ -2069,7 +2082,7 @@ dnl # preprocessing tests use only CPPFLAGS. case $system in AIX-*) ;; BSD/OS*) ;; - CYGWIN_*) ;; + CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; @@ -2114,6 +2127,25 @@ dnl # preprocessing tests use only CPPFLAGS. TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"]) AC_SUBST(TCL_LIBS) + # 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 + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. |