Posted to tcl by patthoyts at Tue Apr 19 14:40:01 GMT 2011view pretty

? win/starsh.c
? win/vercl.x
? win/versions.vc
Index: win/makefile.vc
===================================================================
RCS file: /cvsroot/tcl/tcl/win/makefile.vc,v
retrieving revision 1.175.2.3
diff -u -r1.175.2.3 makefile.vc
--- win/makefile.vc	11 Aug 2008 21:57:17 -0000	1.175.2.3
+++ win/makefile.vc	12 Aug 2008 08:35:23 -0000
@@ -211,6 +211,14 @@
 TCLTEST		= $(OUT_DIR)\$(PROJECT)test.exe
 CAT32		= $(OUT_DIR)\cat32.exe
 
+!ifndef TCLSH_NATIVE
+!if "$(MACHINE)" == "$(NATIVE_ARCH)"
+TCLSH_NATIVE	= $(TCLSH)
+!else
+!error You must explicitly set TCLSH_NATIVE for cross-compilation
+!endif
+!endif
+
 ### Make sure we use backslash only.
 LIB_INSTALL_DIR		= $(_INSTALLDIR)\lib
 BIN_INSTALL_DIR		= $(_INSTALLDIR)\bin
@@ -407,7 +415,7 @@
 !if !$(DEBUG)
 !if $(OPTIMIZING)
 ### This cranks the optimization level to maximize speed
-cdebug	= -O2 $(OPTIMIZATIONS)
+cdebug	= -Zi -O2 $(OPTIMIZATIONS)
 !else
 cdebug	=
 !endif
@@ -1024,13 +1032,13 @@
 install-tzdata:
 	@echo Installing time zone data
 	@set TCL_LIBRARY=$(ROOT)/library
-	@$(TCLSH) "$(ROOT)/tools/installData.tcl" \
+	@$(TCLSH_NATIVE) "$(ROOT)/tools/installData.tcl" \
 	    "$(ROOT)/library/tzdata" "$(SCRIPT_INSTALL_DIR)/tzdata"
 
 install-msgs:
 	@echo Installing message catalogs
 	@set TCL_LIBRARY=$(ROOT)/library
-	@$(TCLSH) "$(ROOT)/tools/installData.tcl" \
+	@$(TCLSH_NATIVE) "$(ROOT)/tools/installData.tcl" \
 	    "$(ROOT)/library/msgs" "$(SCRIPT_INSTALL_DIR)/msgs"
 
 #---------------------------------------------------------------------
Index: win/rules.vc
===================================================================
RCS file: /cvsroot/tcl/tcl/win/rules.vc,v
retrieving revision 1.35.2.1
diff -u -r1.35.2.1 rules.vc
--- win/rules.vc	25 Jun 2008 10:57:54 -0000	1.35.2.1
+++ win/rules.vc	1 Jul 2008 10:25:03 -0000
@@ -30,7 +30,12 @@
 _INSTALLDIR	= $(INSTALLDIR:/=\)
 !endif
 
+# Test for cross-compilation environment.
 !ifndef MACHINE
+NATIVE_ARCH=$(PROCESSOR_ARCHITECTURE)
+!if "$(NATIVE_ARCH)" == "x86"
+NATIVE_ARCH=IX86
+!endif
 !if "$(CPU)" == "" || "$(CPU)" == "i386"
 MACHINE		= IX86
 !else
@@ -666,6 +671,7 @@
 !message *** Intermediate directory will be '$(TMP_DIR)'
 !message *** Output directory will be '$(OUT_DIR)'
 !message *** Suffix for binaries will be '$(SUFX)'
+!message *** Build arch is $(NATIVE_ARCH). Target is $(MACHINE)
 !message *** Optional defines are '$(OPTDEFINES)'
 !message *** Compiler version $(VCVER). Target machine is $(MACHINE)
 !message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)'