summaryrefslogtreecommitdiffstats
path: root/win/tcl.m4
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-09-23 12:38:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-09-23 12:38:31 (GMT)
commitcd619dfd1b22f4313a03f048399fa4981ae43f83 (patch)
treeb606d90a35310bf0a173c908d24fea14b0fefe2b /win/tcl.m4
parentb29a9e93d7a427829ab0ffc56962200ba6d963b7 (diff)
downloadtk-cd619dfd1b22f4313a03f048399fa4981ae43f83.zip
tk-cd619dfd1b22f4313a03f048399fa4981ae43f83.tar.gz
tk-cd619dfd1b22f4313a03f048399fa4981ae43f83.tar.bz2
workaround for mingw bug [http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724]
Diffstat (limited to 'win/tcl.m4')
-rw-r--r--win/tcl.m421
1 files changed, 18 insertions, 3 deletions
diff --git a/win/tcl.m4 b/win/tcl.m4
index 5696366..589a8c0 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -632,6 +632,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# set various compiler flags depending on whether we are using gcc or cl
if test "${GCC}" = "yes" ; then
+ extra_cflags="-pipe"
+ extra_ldflags="-pipe"
AC_CACHE_CHECK(for mingw32 version of gcc,
ac_cv_win32,
AC_TRY_COMPILE([
@@ -645,6 +647,22 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
if test "$ac_cv_win32" != "yes"; then
AC_MSG_ERROR([${CC} cannot produce win32 executables.])
fi
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain"
+ AC_CACHE_CHECK(for working -municode linker flag,
+ ac_cv_municode,
+ AC_TRY_LINK([
+ #include <windows.h>
+ int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;}
+ ],
+ [],
+ ac_cv_municode=yes,
+ ac_cv_municode=no)
+ )
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_municode" = "no" ; then
+ extra_ldflags="$extra_ldflags -static-libgcc"
+ fi
fi
AC_MSG_CHECKING([compiler flags])
@@ -665,9 +683,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
MAKE_EXE="\${CC} -o \[$]@"
LIBPREFIX="lib"
- extra_cflags="-pipe"
- extra_ldflags="-pipe"
-
if test "${SHARED_BUILD}" = "0" ; then
# static
AC_MSG_RESULT([using static flags])