diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-28 20:03:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-28 20:03:35 (GMT) |
commit | 399c41a0f08c867677ef3030a98c6ba9f3a0503f (patch) | |
tree | 0f2cba81933bc106defc0e536088f83161115528 /win/tcl.m4 | |
parent | 5e6a22713afacc4d0c67e3530137d9be104fd12d (diff) | |
download | tcl-399c41a0f08c867677ef3030a98c6ba9f3a0503f.zip tcl-399c41a0f08c867677ef3030a98c6ba9f3a0503f.tar.gz tcl-399c41a0f08c867677ef3030a98c6ba9f3a0503f.tar.bz2 |
some better checks
Diffstat (limited to 'win/tcl.m4')
-rw-r--r-- | win/tcl.m4 | 73 |
1 files changed, 45 insertions, 28 deletions
@@ -433,7 +433,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ cyg_conftest= fi - if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then + if test "$CYGPATH" = "echo"; then DEPARG='"$<"' else DEPARG='"$(shell $(CYGPATH) $<)"' @@ -441,16 +441,52 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # set various compiler flags depending on whether we are using gcc or cl - AC_CACHE_CHECK(for Cygwin version of gcc, - ac_cv_cygwin, + 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" = "yes"; then + case "$do64bit" in + amd64|x64|yes) + CC="x86_64-w64-mingw32-gcc" + LD="x86_64-w64-mingw32-ld" + AR="x86_64-w64-mingw32-ar" + RANLIB="x86_64-w64-mingw32-ranlib" + RC="x86_64-w64-mingw32-windres" + ;; + *) + CC="i686-w64-mingw32-gcc" + LD="i686-w64-mingw32-ld" + AR="i686-w64-mingw32-ar" + RANLIB="i686-w64-mingw32-ranlib" + RC="i686-w64-mingw32-windres" + ;; + esac + fi + + if test "${GCC}" = "yes" ; then + AC_CACHE_CHECK(for mingw32 version of gcc, + ac_cv_win32, AC_TRY_COMPILE([ - #ifdef __CYGWIN__ - #error cygwin + #ifdef __WIN32__ + #error win32 #endif ], [], - ac_cv_cygwin=no, - ac_cv_cygwin=yes) + ac_cv_win32=no, + ac_cv_win32=yes) ) + if test "ac_cv_win32" != "yes"; then + AC_MSG_ERROR([${CC} cannot produce win32 executables.]) + fi + fi + AC_MSG_CHECKING([compiler flags]) if test "${GCC}" = "yes" ; then @@ -472,25 +508,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ extra_cflags="-pipe" extra_ldflags="-pipe" - if test "$ac_cv_cygwin" = "yes"; then - case "$do64bit" in - amd64|x64|yes) - CC="x86_64-w64-mingw32-gcc" - LD="x86_64-w64-mingw32-ld" - AR="x86_64-w64-mingw32-ar" - RANLIB="x86_64-w64-mingw32-ranlib" - RC="x86_64-w64-mingw32-windres" - ;; - *) - CC="i686-w64-mingw32-gcc" - LD="i686-w64-mingw32-ld" - AR="i686-w64-mingw32-ar" - RANLIB="i686-w64-mingw32-ranlib" - RC="i686-w64-mingw32-windres" - ;; - esac - fi - if test "${SHARED_BUILD}" = "0" ; then # static AC_MSG_RESULT([using static flags]) @@ -570,9 +587,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) AC_TRY_COMPILE([ - #ifdef _WIN64 + #ifdef _WIN64 #error 64-bit - #endif + #endif ], [], tcl_win_64bit=no, tcl_win_64bit=yes |