diff options
| author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-03-29 20:48:04 (GMT) |
|---|---|---|
| committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-03-29 20:48:04 (GMT) |
| commit | 6e64bd3e0f1352cd615788c0bae88f4b2456e88a (patch) | |
| tree | e02063f458d378ea20553cee4407c86c12342500 /unix/tcl.m4 | |
| parent | 9acf9a102ab92333a98898b9a0091b653bf04372 (diff) | |
| parent | 00f4a38dd0da103f67e392fc3bce043064c7e4f9 (diff) | |
| download | tcl-6e64bd3e0f1352cd615788c0bae88f4b2456e88a.zip tcl-6e64bd3e0f1352cd615788c0bae88f4b2456e88a.tar.gz tcl-6e64bd3e0f1352cd615788c0bae88f4b2456e88a.tar.bz2 | |
[Bug 3511806] Compiler checks too early
This change allows to build the cygwin
and mingw32 ports of Tcl/Tk to build
out-of-the-box using a native or cross-
compiler
Diffstat (limited to 'unix/tcl.m4')
| -rw-r--r-- | unix/tcl.m4 | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4 index c248686..8ff420a 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1203,7 +1203,7 @@ dnl AC_CHECK_TOOL(AR, ar) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; - CYGWIN_*) + CYGWIN_*|MINGW32*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" @@ -1212,6 +1212,19 @@ dnl AC_CHECK_TOOL(AR, ar) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" 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" @@ -2166,7 +2179,7 @@ dnl # preprocessing tests use only CPPFLAGS. case $system in AIX-*) ;; BSD/OS*) ;; - CYGWIN_*) ;; + CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; @@ -2210,6 +2223,24 @@ dnl # preprocessing tests use only CPPFLAGS. INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))' 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 AC_SUBST(DL_LIBS) |
