Itcl itcl.tcl path, INSTALL_DIR and pkgIndex mismatch
Closed / Fixed3057500fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 15 years ago
Descriptionplain2010-09-01 14:52:02
When building Itcl on WIN32 with MSVC6 or MSVC9 as part of a tcl "nmake release install":
(1) Itcl installs to the wrong folder. It ends up with bin/, include/ and lib/ under $(TCLDIR)/lib rather than under $(TCLDIR).
(2) The name of the lib folder is incorrect. The C logic expects to find it's init script (itcl.tcl) in a lib folder named after the $(ITCL_PATH_LEVEL), but the makefile.vc uses just the major and minor versions.
(3) The pkgIndex.tcl does not work correctly for a build with OPTS=threads. The "add" variable needs to include the "t" suffix in such a case.
(4) The package version in the pkgIndex.tcl file (major + minor) is mismatched with the DLL (ITCL_PATCH_LEVEL), causing "package require" to report errors.
The following patch fixes all these issues:
diff -r1.3 makefile.vc
60c60
< DOTVERSION = $(ITCL_MAJOR_VERSION).$(ITCL_MINOR_VERSION)
---
> DOTVERSION = $(ITCL_PATCH_LEVEL)
70,74c70,74
< BIN_INSTALL_DIR = $(_INSTALLDIR)\bin
< DOC_INSTALL_DIR = $(_INSTALLDIR)\doc
< LIB_INSTALL_DIR = $(_INSTALLDIR)\lib
< SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(DOTVERSION)
< INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include
---
> BIN_INSTALL_DIR = $(_INSTALLDIR)\..\bin
> DOC_INSTALL_DIR = $(_INSTALLDIR)\..\doc
> LIB_INSTALL_DIR = $(_INSTALLDIR)
> SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION)
> INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include
274c274
< echo ^ ^ ^ ^ set add {}>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
---
> echo ^ ^ ^ ^ set add {$(SUFX:g=)}>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
281c281
< echo ^ ^ ^ ^ package ifneeded Itcl $(VERSION) [list load\
---
> echo ^ ^ ^ ^ package ifneeded Itcl $(DOTVERSION) [list load\
dgpplain2010-09-02 20:25:26
Is this issue raised with the upstream Itcl project as well?
twyliteplain2010-09-02 21:26:59
I'm assuming that was a request to do so, so it is now Itcl bug #3058200
dgpplain2010-09-02 21:29:15
Regarding the OPTS=threads issue, I would be surprised if Itcl makes any use of the Tcl routines dealing with threads. So I can't see any reason why a hypothetical --enable-threads build of Itcl would differ from the --disable-threads build. Might be an opportunity for simplification here, rather than maintenance repair of tracking a bunch of letter suffices.
dgpplain2010-09-02 21:30:55
If you have an interest in these nmake-driven builds, it might be best to add you to the projects as a maintainer, since I think few if any of the current crop of active maintainers have any interest in it.
twyliteplain2010-09-02 21:49:27
Re OPTS=threads: the rules.vc (which afaik comes from TEA) defines SUFX based on the compile profile (g for symbols, t for threads, x for static, etc.). The DLL is then built as itcl40$(SUFX).dll . Either the pkgIndex.tcl must be adjusted to compensate for this (my proposed patch should do this automatically), or we must drop the SUFX from the DLL (which has previously been resisted in Tcl and various extensions). Re maintainer: I do builds of Tcl (and bundled pkgs), Tk, Threads every few months. I would be happy to commit changes rather than report bugs & patches, but of course that would bypass any discussions like the above ;/
twyliteplain2011-08-01 00:42:39
This issue and its upstream partner (bug #3058200 filed with Itcl) have been idle for 11 months now. They still prevent an MSVC/nmake build+install of Tcl working correctly on Windows, and they affect the 8.6b2 release candidates.
In addition, the rules.vc for Itcl hasn't been updated to support MSVC10 (VCVERSION 1600), so the package will not build with the latest MS compiler.
Full patch is now:
Index: win/makefile.vc
===================================================================
--- win/makefile.vc
+++ win/makefile.vc
@@ -54,25 +54,25 @@
BINROOT= .
ROOT= ..
STUBPREFIX= $(PROJECT)stub
-DOTVERSION = $(ITCL_MAJOR_VERSION).$(ITCL_MINOR_VERSION)
+DOTVERSION = $(ITCL_PATCH_LEVEL)
VERSION = $(ITCL_MAJOR_VERSION)$(ITCL_MINOR_VERSION)
PKGINDEX= "$(TMP_DIR)\pkgIndex.tcl"
ITCLLIBNAME= $(PROJECT)$(VERSION)$(SUFX).$(EXT)
ITCLLIB= "$(OUT_DIR)\$(ITCLLIBNAME)"
ITCLIMPLIB= "$(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib"
ITCLSTUBLIBNAME= $(STUBPREFIX)$(VERSION).lib
ITCLSTUBLIB= "$(OUT_DIR)\$(ITCLSTUBLIBNAME)"
-BIN_INSTALL_DIR= $(_INSTALLDIR)\bin
-DOC_INSTALL_DIR= $(_INSTALLDIR)\doc
-LIB_INSTALL_DIR= $(_INSTALLDIR)\lib
-SCRIPT_INSTALL_DIR= $(_INSTALLDIR)\lib\$(PROJECT)$(DOTVERSION)
-INCLUDE_INSTALL_DIR= $(_INSTALLDIR)\include
+BIN_INSTALL_DIR= $(_INSTALLDIR)\..\bin
+DOC_INSTALL_DIR= $(_INSTALLDIR)\..\doc
+LIB_INSTALL_DIR= $(_INSTALLDIR)
+SCRIPT_INSTALL_DIR= $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION)
+INCLUDE_INSTALL_DIR= $(_INSTALLDIR)\..\include
ITCLOBJS = \
$(TMP_DIR)\itcl2TclOO.obj \
$(TMP_DIR)\itclBase.obj \
$(TMP_DIR)\itclBuiltin.obj \
@@ -268,18 +268,18 @@
copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)"
echo if {[package vsatisfies 8.0 [package provide Tcl]]} {\
> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
echo ^ ^ ^ ^ set add 80>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
echo } else {>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
-echo ^ ^ ^ ^ set add {}>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
+ echo ^ ^ ^ ^ set add {$(SUFX:g=)}>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
echo }>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
echo if {[info exists ::tcl_platform(debug)] ^&^&\
$$::tcl_platform(debug)^&^& \>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
echo ^ ^ ^ ^ ^ ^ ^ ^ [file exists [file join $$dir\
$(PROJECT)$(VERSION)$${add}g.dll]]}\
{>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
-echo ^ ^ ^ ^ package ifneeded Itcl $(VERSION) [list load\
+ echo ^ ^ ^ ^ package ifneeded Itcl $(DOTVERSION) [list load\
[file join $$dir $(PROJECT)$(VERSION)$${add}g.dll]\
Itcl]>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
echo } else {>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
echo ^ ^ ^ ^ package ifneeded Itcl $(DOTVERSION) [list load\
[file join $$dir $(PROJECT)$(VERSION)$${add}.dll]\
@@ -439,12 +439,17 @@
-del $(TMP_DIR)\*.pch
-del $(TMP_DIR)\*.obj
-del $(TMP_DIR)\*.res
clean : tidy
+ @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
+ @if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc
+ @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i
+ @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x
+ @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch
-del $(OUT_DIR)\*.exp
-del $(OUT_DIR)\*.lib
-del $(OUT_DIR)\*.dll
hose : clean
-rmdir $(OUT_DIR)
-rmdir $(TMP_DIR)
Index: win/rules.vc
===================================================================
--- win/rules.vc
+++ win/rules.vc
@@ -184,11 +184,13 @@
_VC_MANIFEST_EMBED_DLL=
VCVER=0
!if ![echo VCVERSION=_MSC_VER > vercl.x] \
&& ![cl -nologo -TC -P vercl.x $(ERRNULL)]
!include vercl.i
-!if $(VCVERSION) >= 1500
+!if $(VCVERSION) >= 1600
+VCVER=10
+!elseif $(VCVERSION) >= 1500
VCVER=9
!elseif $(VCVERSION) >= 1400
VCVER=8
!elseif $(VCVERSION) >= 1300
VCVER=7
dgpplain2011-08-01 22:18:41
allow_comments - 1
Log in (anonymous is fine) to add a comment.