From: Anton K. <an...@sw...> - 2010-02-21 13:15:42
|
Hello Tcl developers, There is a couple of issues with Tcl autoconf script for Windows, that I routinely run across when doing cross-builds with mingw from Linux. After posting a message about SEH, concerning the changes that require autoconf modifications, I decided to initiate discussion on these issues as well. Cross-compilation is obviously _not_ what the tcl.m4 author(s) had in mind. But, fortunately, this script works reasonbly well even in this case, for building across different-CPU linuxes and for windwos as well, with the following two exceptions: 1. System threading implementation selection seems to depend on `uname` output unconditionally. When running on Linux, I can cross-compile non-threaded Tcl/win32 and non-threaded extensions successfully, but when attempting the threaded build, it tries to use pthread and resorts to a non-threaded one. Overriding the uname command by something that comes earlier in the $PATH and echoes MINGW32_NT-5.1_WIN32 solves this issue, but this solution is unobvious and probably causes many people to abandon the idea of cross-compiling Tcl. It should be solved in the script instead, but, again, I don't have enough autoconf experience to provide a _reliable_ solution (probably the build system uname should not be used at all). 2. When installing message catalogs and timezone data, Makefile insists on running the freshly-built tclsh (that isn't generally runnable in case of cross-compiling). For windows builds, I usually leave it alone and let wine provide the transparent execution. For cross-linux builds, I sometimes let qemu do the same. Before these solutions started to work nicely (like they do now) I had to separate out install-binaries, install-libraries and (install-tzdata install-msgs), running the last pair of targets with overridden TCLSH. I propose a fix: let Makefile use $RUNNABLE_TCLSH in the installation process, with $RUNNABLE_TCLSH defaulting to the freshly built $TCLSH, as it was before. That is, it should _install_ $TCLSH into $(prefix)/bin, but _run_ (when needed) $(RUNNABLE_TCLSH), which defaults to $(TCLSH) but can be overridden separately. This way, Tcl's configure script doesn't have to support finding the appropriate build-system runnable tclsh. The modification is two lines long. But when I build an automatically cross-compiled tree, it would save much time to just "make install RUNNABLE_TCLSH=/usr/bin/tclsh INSTALL_ROOT=zzzz" instead of fiddling with Makefile internals (and merging the changes when they happen). I realize that the cross-compilation support is probably not a high-priority goal for Tcl team. But this target is almost reached anyway, so it'd be nice to take a minor additional step :) -- Regards, Anton Kovalenko +7(916)345-34-02 Elektrostal' MO, Russia |