summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-02 09:48:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-02 09:48:06 (GMT)
commit6fb70434886c81f401e6941b84adcfa80454dc39 (patch)
treec1c388415687a10fe7e876469402a54d53ff3939 /unix/tcl.m4
parentf5388f87a1561b44ad0b3ceaefa06ba58125adbe (diff)
parent33bde427645f8931d8634cdba1819b5e66a69bd0 (diff)
downloadtk-6fb70434886c81f401e6941b84adcfa80454dc39.zip
tk-6fb70434886c81f401e6941b84adcfa80454dc39.tar.gz
tk-6fb70434886c81f401e6941b84adcfa80454dc39.tar.bz2
[Bug 3511806] Compiler checks too early
(autoconf still to be run!)
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m441
1 files changed, 37 insertions, 4 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index cb6c842..74a577d 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1220,17 +1220,30 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
- CYGWIN_*)
+ CYGWIN_*|MINGW32*)
SHLIB_CFLAGS=""
SHLIB_LD='${CC} -shared'
SHLIB_SUFFIX=".dll"
- DL_OBJS="tclLoadDl.o"
+ DL_OBJS="tclLoadDl.o tclWinError.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
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"
@@ -2058,7 +2071,7 @@ dnl # preprocessing tests use only CPPFLAGS.
case $system in
AIX-*) ;;
BSD/OS*) ;;
- CYGWIN_*) ;;
+ CYGWIN_*|MINGW32_*) ;;
IRIX*) ;;
NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
@@ -2115,6 +2128,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.
@@ -3264,7 +3296,8 @@ AC_DEFUN([SC_TCL_IPV6],[
#include <netdb.h>
]])
if test "x$NEED_FAKE_RFC2553" = "x1"; then
- AC_DEFINE(NEED_FAKE_RFC2553)
+ AC_DEFINE([NEED_FAKE_RFC2553], 1,
+ [Use compat implementation of getaddrinfo() and friends])
AC_LIBOBJ([fake-rfc2553])
AC_CHECK_FUNC(strlcpy)
fi