diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-12-19 09:40:32 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-12-19 09:40:32 (GMT) |
| commit | e413e5d552a42a1edd57c40afebd58c915db5027 (patch) | |
| tree | 8c84165469fdc405c8c7214596bb02f79483863d | |
| parent | fa7d789b6763108c6acf4fe6d98d6faa072a5a5b (diff) | |
| download | tcl-core-bug-632710f6b7.zip tcl-core-bug-632710f6b7.tar.gz tcl-core-bug-632710f6b7.tar.bz2 | |
Proposed fix for [632710f6b7]: Check for -municode doesn't work on WSL. Also add /HIGHENTROPYVA:NO to NMAKE buildcore-bug-632710f6b7
| -rwxr-xr-x | win/configure | 137 | ||||
| -rw-r--r-- | win/rules.vc | 18 | ||||
| -rw-r--r-- | win/tcl.m4 | 16 |
3 files changed, 59 insertions, 112 deletions
diff --git a/win/configure b/win/configure index 42d272f..e560a15 100755 --- a/win/configure +++ b/win/configure @@ -1539,6 +1539,54 @@ fi } # ac_fn_c_try_compile +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -4094,7 +4142,7 @@ printf "%s\n" "yes" >&6; } if test "${GCC}" = "yes" ; then extra_cflags="-pipe" - extra_ldflags="-pipe -static-libgcc" + extra_ldflags="-pipe -static-libgcc -municode" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mingw32 version of gcc" >&5 printf %s "checking for mingw32 version of gcc... " >&6; } if test ${ac_cv_win32+y} @@ -4136,93 +4184,6 @@ printf "%s\n" "$ac_cv_win32" >&6; } extra_cflags="$extra_cflags -DHAVE_CPUID=1" fi - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -municode linker flag" >&5 -printf %s "checking for working -municode linker flag... " >&6; } -if test ${ac_cv_municode+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 ;; -esac -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <windows.h> - int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_municode=yes -else case e in #( - e) ac_cv_municode=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_municode" >&5 -printf "%s\n" "$ac_cv_municode" >&6; } - CFLAGS=$hold_cflags - if test "$ac_cv_municode" = "yes" ; then - extra_ldflags="$extra_ldflags -municode" - fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5 printf %s "checking for working -fno-lto... " >&6; } diff --git a/win/rules.vc b/win/rules.vc index 15ae8a0..48667db 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -24,7 +24,7 @@ _RULES_VC = 1 # For modifications that are not backward-compatible, you *must* change
# the major version.
RULES_VERSION_MAJOR = 1
-RULES_VERSION_MINOR = 15
+RULES_VERSION_MINOR = 16
# The PROJECT macro must be defined by parent makefile.
!if "$(PROJECT)" == ""
@@ -1079,7 +1079,7 @@ BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
!endif
-!if !$(DEBUG) || $(TCL_VERSION) > 86 || $(DEBUG) && $(UNCHECKED)
+!if !$(DEBUG) || $(TCL_VERSION) >= 90 || $(DEBUG) && $(UNCHECKED)
SUFX = $(SUFX:g=)
!endif
@@ -1094,13 +1094,13 @@ SUFX = $(SUFX:x=) !else
TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)
EXT = lib
-!if $(MSVCRT) && $(TCL_VERSION) > 86 || !$(MSVCRT) && $(TCL_VERSION) < 87
+!if $(MSVCRT) && $(TCL_VERSION) >= 90 || !$(MSVCRT) && $(TCL_VERSION) < 90
TMP_DIRFULL = $(TMP_DIRFULL:X=)
SUFX = $(SUFX:x=)
!endif
!endif
-!if !$(TCL_THREADS) || $(TCL_VERSION) > 86
+!if !$(TCL_THREADS) || $(TCL_VERSION) >= 90
TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)
SUFX = $(SUFX:t=)
!endif
@@ -1383,7 +1383,7 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include # baselibs - minimum Windows libraries required. Parent makefile can
# define PRJ_LIBS before including rules.rc if additional libs are needed
-OPTDEFINES = /DSTDC_HEADERS /DUSE_NMAKE=1
+OPTDEFINES = /DSTDC_HEADERS /DUSE_NMAKE=1 /HIGHENTROPYVA:NO
!if $(VCVERSION) > 1600
OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1
!else
@@ -1399,15 +1399,15 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_MEM_DEBUG !if $(TCL_COMPILE_DEBUG)
OPTDEFINES = $(OPTDEFINES) /DTCL_COMPILE_DEBUG /DTCL_COMPILE_STATS
!endif
-!if $(TCL_THREADS) && $(TCL_VERSION) < 87
+!if $(TCL_THREADS) && $(TCL_VERSION) < 90
OPTDEFINES = $(OPTDEFINES) /DTCL_THREADS=1
-!if $(USE_THREAD_ALLOC) && $(TCL_VERSION) < 87
+!if $(USE_THREAD_ALLOC) && $(TCL_VERSION) < 90
OPTDEFINES = $(OPTDEFINES) /DUSE_THREAD_ALLOC=1
!endif
!endif
!if $(STATIC_BUILD)
OPTDEFINES = $(OPTDEFINES) /DSTATIC_BUILD
-!elseif $(TCL_VERSION) > 86
+!elseif $(TCL_VERSION) >= 90
OPTDEFINES = $(OPTDEFINES) /DTCL_WITH_EXTERNAL_TOMMATH
!if "$(MACHINE)" == "AMD64" || "$(MACHINE)" == "ARM64"
OPTDEFINES = $(OPTDEFINES) /DMP_64BIT
@@ -1883,7 +1883,7 @@ TCLNMAKECONFIG = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake" !if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)"
!error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)).
!endif
-!if $(TCL_VERSION) < 87 && defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC)
+!if $(TCL_VERSION) < 90 && defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC)
!message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)).
!endif
!if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG)
@@ -579,7 +579,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ if test "${GCC}" = "yes" ; then extra_cflags="-pipe" - extra_ldflags="-pipe -static-libgcc" + extra_ldflags="-pipe -static-libgcc -municode" AC_CACHE_CHECK(for mingw32 version of gcc, ac_cv_win32, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -597,20 +597,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ extra_cflags="$extra_cflags -DHAVE_CPUID=1" fi - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" - AC_CACHE_CHECK(for working -municode linker flag, - ac_cv_municode, - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #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" = "yes" ; then - extra_ldflags="$extra_ldflags -municode" - fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" AC_CACHE_CHECK(for working -fno-lto, ac_cv_nolto, |
