From b5898cc4d07090ca5d742abc116dd57baa086abc Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Feb 2022 13:18:01 +0000 Subject: See [https://patch-diff.githubusercontent.com/raw/tcltk/tcl/pull/12.patch], but slightly better: If cross-compiling for ARM64, we must be on AMD64, so just use a pre-compile nmakehlp executable --- win/rules.vc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/win/rules.vc b/win/rules.vc index f8236f4..372d70a 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -550,9 +550,12 @@ NMAKEHLPC = $(_TCLDIR)\win\nmakehlp.c # We always build nmakehlp even if it exists since we do not know # what source it was built from. -!if "$(MACHINE)" == "$(NATIVE_ARCH)" +!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" !if [$(cc32) -nologo "$(NMAKEHLPC)" -link -subsystem:console > nul] !endif +!else +!if [copy $(NMAKEHLPC:nmakehlp.c=x86_64-w64-mingw32-nmakehlp.exe) nmakehlp.exe >NUL] +!endif !endif ################################################################ @@ -1610,9 +1613,6 @@ DEFAULT_BUILD_TARGET = $(PROJECT) default-target: $(DEFAULT_BUILD_TARGET) -nmakehlp: - $(cc32) -nologo "$(NMAKEHLPC)" -link -subsystem:console - !if $(MULTIPLATFORM_INSTALL) default-pkgindex: @echo if {[package vsatisfies [package provide Tcl] 9.0-]} { > $(OUT_DIR)\pkgIndex.tcl -- cgit v0.12 From dff07b745999cb6df94a2fbe5ef2a22a9f7e24f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Feb 2022 13:51:02 +0000 Subject: Add nmakehlp.exe (for AMD64) to distribution, and make it usable in rules-ext.vc too --- unix/Makefile.in | 3 ++- win/makefile.vc | 1 + win/rules-ext.vc | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 74df6fb..0ab3e9b 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -2141,7 +2141,8 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in gen $(TOP_DIR)/win/tcl.m4 $(TOP_DIR)/win/aclocal.m4 \ $(TOP_DIR)/win/tclsh.exe.manifest.in $(TOP_DIR)/win/tclUuid.h.in \ $(TOP_DIR)/win/gitmanifest.in $(TOP_DIR)/win/svnmanifest.in \ - $(DISTDIR)/win + $(TOP_DIR)/win/x86_64-w64-mingw32-nmakehlp.exe $(DISTDIR)/win + chmod 775 $(DISTDIR)/win/x86_64-w64-mingw32-nmakehlp.exe cp -p $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.ico $(TOP_DIR)/win/*.rc \ $(DISTDIR)/win cp -p $(TOP_DIR)/win/*.bat $(DISTDIR)/win diff --git a/win/makefile.vc b/win/makefile.vc index a4de4c2..395a9ca 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -945,6 +945,7 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @$(CPY) "$(WIN_DIR)\rules.vc" "$(LIB_INSTALL_DIR)\nmake\" @$(CPY) "$(WIN_DIR)\targets.vc" "$(LIB_INSTALL_DIR)\nmake\" @$(CPY) "$(WIN_DIR)\nmakehlp.c" "$(LIB_INSTALL_DIR)\nmake\" + @$(CPY) "$(WIN_DIR)\x86_64-w64-mingw32-nmakehlp.exe" "$(LIB_INSTALL_DIR)\nmake\" @$(CPY) "$(OUT_DIR)\tcl.nmake" "$(LIB_INSTALL_DIR)\nmake\" @echo Installing package http 1.0 (obsolete) @$(CPY) "$(ROOT)\library\http1.0\*.tcl" \ diff --git a/win/rules-ext.vc b/win/rules-ext.vc index 6da5689..6d31a03 100644 --- a/win/rules-ext.vc +++ b/win/rules-ext.vc @@ -31,8 +31,13 @@ macro to the name of the project makefile. # We extract version numbers using the nmakehlp program. For now use # the local copy of nmakehlp. Once we locate Tcl, we will use that # one if it is newer. +!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" !if [$(CC) -nologo -DNDEBUG "nmakehlp.c" -link -subsystem:console > nul] !endif +!else +!if [copy x86_64-w64-mingw32-nmakehlp.exe nmakehlp.exe >NUL] +!endif +!endif # First locate the Tcl directory that we are working with. !if "$(TCLDIR)" != "" -- cgit v0.12 From bf79ff2fca084ddd73434bb646d06f73e0f8380e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Feb 2022 14:09:11 +0000 Subject: update README --- win/README | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/win/README b/win/README index f4cdde4..92cb2c6 100644 --- a/win/README +++ b/win/README @@ -42,6 +42,11 @@ In order to compile Tcl for Windows, you need the following: Msys + MinGW-w64 [https://www.mingw-w64.org/] (win32 or win64) + or + + LLVM MinGW [https://github.com/mstorsjo/llvm-mingw/] + (win32 or win64, IX86, AMD64 or ARM64) + In practice, this release is built with Visual C++ 6.0 and the TEA Makefile. @@ -56,21 +61,15 @@ using it, are in the comments of "makefile.vc". A quick example would be: There is also a Developer Studio workspace and project file, too, if you would like to use them. -If you want to Cross-compile with Visual Studio (e.g. for X86 or ARM64 -targets, but running on AMD64), first set up the environment for -your host machine and compile nmakehlp.exe: - C:\tcl_source\win\>nmake -f makefile.vc nmakehlp -Then go to your cross-compile environment and run the nmake -command again for whatever you want to build. - If you are building with Linux, Cygwin or Msys, you can use the configure script that lives in the win subdirectory. The Linux/Cygwin/Msys based configure/build process works just like the UNIX one, so you will want to refer to ../unix/README for available configure options. If you want 64-bit executables (x86_64), you need to configure using -the --enable-64bit option. Make sure that the x86_64-w64-mingw32 -compiler is present. For Cygwin this compiler can be found in the +the --enable-64bit (or --enable-64bit=arm64) option. Make sure that +the x86_64-w64-mingw32 (or aarch64-w64-mingw32) compiler is present. +For Cygwin the x86_64 compiler can be found in the "mingw64-x86_64-gcc-core" package, which can be installed through the normal Cygwin install process. If you only want 32-bit executables, the "mingw64-i686-gcc-core" package is what you need. For Linux, Darwin -- cgit v0.12