diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-09-23 11:12:12 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-09-23 11:12:12 (GMT) |
commit | 5d9b0d315794199313c41559a91710addd1d4630 (patch) | |
tree | 478435eb2455b42018200d76a61f395aaf5d8076 /win/tcl.m4 | |
parent | 44d124101c6297b356f7de3917c4d0666b8a0e31 (diff) | |
download | tcl-5d9b0d315794199313c41559a91710addd1d4630.zip tcl-5d9b0d315794199313c41559a91710addd1d4630.tar.gz tcl-5d9b0d315794199313c41559a91710addd1d4630.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.m4 | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -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]) |