summaryrefslogtreecommitdiffstats
path: root/win/rules.vc
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2003-12-23 02:19:13 (GMT)
committerdavygrvy <davygrvy@pobox.com>2003-12-23 02:19:13 (GMT)
commit0c65818d79305e541929ca935669c1db63a3ae3f (patch)
tree7264cc0edcef7b140f1ac4eee34515fff01cae1b /win/rules.vc
parent5a29d2faebb0f38298e959acd984a7190307118f (diff)
downloadtcl-0c65818d79305e541929ca935669c1db63a3ae3f.zip
tcl-0c65818d79305e541929ca935669c1db63a3ae3f.tar.gz
tcl-0c65818d79305e541929ca935669c1db63a3ae3f.tar.bz2
New feature for extensions that use rules.vc. Now reads header files for
version strings. No more hard coding TCL_VERSION = 8.5 and having to edit it when you swap cores.
Diffstat (limited to 'win/rules.vc')
-rw-r--r--win/rules.vc49
1 files changed, 38 insertions, 11 deletions
diff --git a/win/rules.vc b/win/rules.vc
index 5ae93d5..e0917f3 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -7,10 +7,10 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# Copyright (c) 2001-2002 David Gravereaux.
+# Copyright (c) 2001-2003 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.14 2003/07/15 16:11:58 kennykb Exp $
+# RCS: @(#) $Id: rules.vc,v 1.15 2003/12/23 02:19:13 davygrvy Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -308,6 +308,7 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
!if !defined(TCLDIR)
!if exist("$(_INSTALLDIR)\include\tcl.h")
+TCLH = "$(_INSTALLDIR)\include\tcl.h"
TCLINSTALL = 1
_TCLDIR = $(_INSTALLDIR)
!else
@@ -318,8 +319,10 @@ Don't know where tcl.h is. Set the TCLDIR macro.
!else
_TCLDIR = $(TCLDIR:/=\)
!if exist("$(_TCLDIR)\include\tcl.h")
+TCLH = "$(_TCLDIR)\include\tcl.h"
TCLINSTALL = 1
!elseif exist("$(_TCLDIR)\generic\tcl.h")
+TCLH = "$(_TCLDIR)\generic\tcl.h"
TCLINSTALL = 0
!else
MSG =^
@@ -328,19 +331,43 @@ Don't know where tcl.h is. The TCLDIR macro doesn't appear correct.
!endif
!endif
-### TODO: add a command to nmakehlp.c to grep for Tcl's version from tcl.h.
-### Because nmake can't return a string, we'll need to play games with return
-### codes. It might look something like this:
-#!if [nmakehlp -g $(TCL.H)] == 81
-#TCL_DOTVERSION = 8.1
-#!elseif [nmakehlp -g $(TCL.H)] == 82
-#TCL_DOTVERSION = 8.2
-#...
-#!endif
+#----------------------------------------------------------
+# Get the version from the header file. Try all possibles
+# even though some aren't fully valid.
+#----------------------------------------------------------
+!if [nmakehlp -g $(TCLH) TCL_VERSION] == 76
+TCL_DOTVERSION = 7.6
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 80
+TCL_DOTVERSION = 8.0
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 81
+TCL_DOTVERSION = 8.1
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 82
+TCL_DOTVERSION = 8.2
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 83
+TCL_DOTVERSION = 8.3
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 84
+TCL_DOTVERSION = 8.4
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 85
TCL_DOTVERSION = 8.5
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 86
+TCL_DOTVERSION = 8.6
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 90
+TCL_DOTVERSION = 9.0
+!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 0
+MSG =^
+Can't get version string from $(TCLH)
+!error $(MSG)
+!endif
+
TCL_VERSION = $(TCL_DOTVERSION:.=)
+!if $(TCL_VERSION) < 81
+TCL_DOES_STUBS = 0
+!else
+TCL_DOES_STUBS = 1
+!endif
+
!if $(TCLINSTALL)
TCLSH = "$(_INSTALLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
TCLSTUBLIB = "$(_INSTALLDIR)\lib\tclstub$(TCL_VERSION).lib"