Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b976d441d6abe9e3ccdf43dfd1dfa05949dbbe85
Ticket: 1643367fffffffffffffffffffffffffffffffff
Thread extension cannot compile with VC8
User & Date: twylite on 2007-03-28 00:09:41
Changes

  1. icomment:
    Logged In: YES 
    user_id=91629
    Originator: NO
    
    And that's only the start of your problems ...
    
    I have just got the latest thread module from CVS, and am getting errors building it with VC6 or VC8 (on Windows 2000).
    
      c:\build\thread\win\vc>nmake /f makefile.vc all OPTS=threads TCLDIR=..\..\..\tcl
      ...<snip>
      LINK : fatal error LNK1181: cannot open input file "..\..\..\tcl\win\Release\tclstub84.lib"
      NMAKE : fatal error U1077: 'link' : return code '0x49d'
      Stop.
    
    I am, of course, building this extension for use with Tcl 8.5.  The problem can be solved by adding a TCL_DOTVERSION argument to nmake, but this should be detected via tcl.h (and TCLDIR).
    
      nmake /f makefile.vc all OPTS=threads TCLDIR=..\..\..\tcl TCL_DOTVERSION=8.5
      
    --
    
    Next, the tests fail to run.
    
      c:\build\thread\win\vc>nmake /f makefile.vc test OPTS=threads TCLDIR=..\..\..\tcl TCL_DOTVERSION=8.5
      ...<snip>
      thread.test
      can't read "::tcl_PatchLevel": no such variable
      ...<snip>
      Tests ended at Tue Mar 27 17:16:53 +0200 2007
      all.tcl:        Total   0       Passed  0       Skipped 0       Failed  0
    
    Capatalisation problem with patchLevel.  Easily solved -- but it's been that way since January 2005?!  
    
    --
    
    Third, "make install" only copies the DLL; it doesn't create pkgIndex.tcl.
    
    This can be solved by manually creating a pkgIndex.tcl based on pkgIndex.tcl.in, or modifying the makefile.vc to create the pkgIndex.tcl using its variables.
    
    The install also doesn't name the lib folder correctly (thread instead of thread2.6), and doesn't copy other thread lib files (ttrace.tcl).
    
    --
    
    Forth, pkg.vc reflects an old version (2.6.3) which is not in sync with configure.in.
    
    --
    
    And then you can't even build at all with VC8.
    
    --
    
    The attached patch updates the makefile.vc and rules.vc to be in line with the sampleextension in CVS (plus the changes I have submitted in bug [ 1689286 ] nmakehlp not building on Win32 with VC).
    
    Tested with VC6 and VC8 on Windows 2000.  Builds, installs and runs correctly (including running all tests), so far as I can tell ;)
    
    There are a number of changes:
      - configure.in: note to change DOTVERSION in makefile.vc when you update the version
      - win/thread.rc: the sampleextension makefile.vc provides different variables/defines to rc
      - tests/thread.test: tcl_PatchLevel ==> tcl_patchLevel
      - win/makefile.vc, win/nmakehlp.c and win/rules.vc: added, based on sampleextension with minimal changes needed to make it work with threads extension
    
    The files win/vc/makefile.vc, win/vc/nmakehlp.c, win/vc/pkg.vc and win/vc/rules.vc are no longer required and should be deleted.  They have effectively been moved to win/ and replaced with updates based on sampleextension.  If these files stay in win/vc and get modified to be in a "non-standard" location, then we ensure this pain every time they need to be updated (otherwise we just copy from sampleextension).
    
    
    
  2. login: "twylite"
  3. mimetype: "text/plain"
  4. username: "twylite"