summaryrefslogtreecommitdiffstats
path: root/win/rules.vc
diff options
context:
space:
mode:
Diffstat (limited to 'win/rules.vc')
-rw-r--r--win/rules.vc204
1 files changed, 102 insertions, 102 deletions
diff --git a/win/rules.vc b/win/rules.vc
index deb75bd..2a5b0c7 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -7,10 +7,11 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# Copyright (c) 2001-2003 David Gravereaux.
+# Copyright (c) 2001-2002 David Gravereaux.
+# Copyright (c) 2003 Patrick Thoyts
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.5.2.2 2004/10/27 00:36:34 davygrvy Exp $
+# RCS: @(#) $Id: rules.vc,v 1.5.2.3 2006/06/14 23:52:01 patthoyts Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -25,7 +26,7 @@ rc32 = $(RC) # built-in default.
### Assume the normal default.
_INSTALLDIR = C:\Program Files\Tcl
!else
-### Fix the path seperators.
+### Fix the path separators.
_INSTALLDIR = $(INSTALLDIR:/=\)
!endif
@@ -33,9 +34,6 @@ _INSTALLDIR = $(INSTALLDIR:/=\)
MACHINE = IX86
!endif
-!ifndef CFG_ENCODING
-CFG_ENCODING = \"cp1252\"
-!endif
#----------------------------------------------------------
# Set the proper copy method to avoid overwrite questions
@@ -64,7 +62,7 @@ RMDIR = deltree /Y
#----------------------------------------------------------
!if !exist(nmakehlp.exe)
-!if [$(cc32) -nologo -ML nmakehlp.c -link -subsystem:console > nul]
+!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul]
!endif
!endif
@@ -73,7 +71,7 @@ RMDIR = deltree /Y
#----------------------------------------------------------
### test for optimizations
-!if [nmakehlp -c -Otip]
+!if [nmakehlp -c -Ot]
!message *** Compiler has 'Optimizations'
OPTIMIZING = 1
!else
@@ -81,15 +79,71 @@ OPTIMIZING = 1
OPTIMIZING = 0
!endif
+OPTIMIZATIONS =
+
+!if [nmakehlp -c -Ot]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot
+!endif
+
+!if [nmakehlp -c -Oi]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi
+!endif
+
+!if [nmakehlp -c -Op]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -Op
+!endif
+
+!if [nmakehlp -c -fp:precise]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:precise
+!endif
+
+!if [nmakehlp -c -fp:except]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:except
+!endif
+
+!if [nmakehlp -c -Gs]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs
+!endif
+
+!if [nmakehlp -c -GS]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -GS
+!endif
+
+DEBUGFLAGS =
+
+!if [nmakehlp -c -RTC1]
+DEBUGFLAGS = $(DEBUGFLAGS) -RTC1
+!elseif [nmakehlp -c -GZ]
+DEBUGFLAGS = $(DEBUGFLAGS) -GZ
+!endif
+
+COMPILERFLAGS =-W3
+
+!if [nmakehlp -c -YX]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -YX
+!endif
+
!if "$(MACHINE)" == "IX86"
### test for pentium errata
!if [nmakehlp -c -QI0f]
!message *** Compiler has 'Pentium 0x0f fix'
-PENT_0F_ERRATA = 1
+COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f
!else
!message *** Compiler doesn't have 'Pentium 0x0f fix'
-PENT_0F_ERRATA = 0
!endif
+!endif
+
+!if "$(MACHINE)" == "IA64"
+### test for Itanium errata
+!if [nmakehlp -c -QIA64_Bx]
+!message *** Compiler has 'B-stepping errata workarounds'
+COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx
+!else
+!message *** Compiler does not have 'B-stepping errata workarounds'
+!endif
+!endif
+
+!if "$(MACHINE)" == "IX86"
### test for -align:4096, when align:512 will do.
!if [nmakehlp -l -opt:nowin98]
!message *** Linker has 'Win98 alignment problem'
@@ -99,21 +153,26 @@ ALIGN98_HACK = 1
ALIGN98_HACK = 0
!endif
!else
-PENT_0F_ERRATA = 0
ALIGN98_HACK = 0
!endif
-!if "$(MACHINE)" == "IA64"
-### test for Itanium errata
-!if [nmakehlp -c -QIA64_Bx]
-!message *** Compiler has 'B-stepping errata workarounds'
-ITAN_B_ERRATA = 1
-!else
-!message *** Compiler doesn't have 'B-stepping errata workarounds'
-ITAN_B_ERRATA = 0
-!endif
+#----------------------------------------------------------
+# MSVC8 (ships with Visual Studio 2005) generates a manifest
+# file that we should link into the binaries. This is how.
+#----------------------------------------------------------
+
+_VC_MANIFEST_EMBED_EXE=
+_VC_MANIFEST_EMBED_DLL=
+!if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL]
+VCVER=6
+!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL]
+VCVER=7
+!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL]
+VCVER=8
+_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
+_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
!else
-ITAN_B_ERRATA = 0
+VCVER=0
!endif
#----------------------------------------------------------
@@ -202,28 +261,21 @@ TCL_USE_STATIC_PACKAGES = 0
# by accident.
#----------------------------------------------------------
-#----------------------------------------
-# Naming convention:
-# t = full thread support.
-# s = static library (as opposed to an
-# import library)
-# g = linked to the debug enabled C
-# run-time.
-# x = special static build when it
-# links to the dynamic C run-time.
-#----------------------------------------
SUFX = tsgx
!if $(DEBUG)
BUILDDIRTOP = Debug
+DBGX = g
!else
BUILDDIRTOP = Release
-!endif
-
-!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)
+DBGX =
SUFX = $(SUFX:g=)
!endif
+#!if $(VCVER) > 6
+#BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
+#!endif
+
TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX
!if !$(STATIC_BUILD)
@@ -284,36 +336,12 @@ TCL_COMPILE_DEBUG = 0
#----------------------------------------------------------
-# Decode the checks requested.
-#----------------------------------------------------------
-
-!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
-TCL_NO_DEPRECATED = 0
-FULLWARNINGS = 0
-!else
-!if [nmakehlp -f $(CHECKS) "nodep"]
-!message *** Doing nodep check
-TCL_NO_DEPRECATED = 1
-!else
-TCL_NO_DEPRECATED = 0
-!endif
-!if [nmakehlp -f $(CHECKS) "fullwarn"]
-!message *** Doing full warnings check
-FULLWARNINGS = 1
-!else
-FULLWARNINGS = 0
-!endif
-!endif
-
-
-#----------------------------------------------------------
# Set our defines now armed with our options.
#----------------------------------------------------------
-OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING)
-
+OPTDEFINES =
!if $(TCL_MEM_DEBUG)
-OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG
+OPTDEFINES = -DTCL_MEM_DEBUG
!endif
!if $(TCL_COMPILE_DEBUG)
OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
@@ -327,9 +355,6 @@ OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
!if $(STATIC_BUILD)
OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
!endif
-!if $(TCL_NO_DEPRECATED)
-OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED
-!endif
!if $(DEBUG)
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG
@@ -339,7 +364,7 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
!if $(PROFILE)
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED
!endif
-!if "$(MACHINE)" == "IA64"
+!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif
@@ -352,66 +377,39 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
!if !defined(TCLDIR)
!if exist("$(_INSTALLDIR)\include\tcl.h")
-TCLH = "$(_INSTALLDIR)\include\tcl.h"
TCLINSTALL = 1
_TCLDIR = $(_INSTALLDIR)
!else
MSG=^
-Don't know where tcl.h is. Set the TCLDIR macro.
+Failed to find tcl.h. Set the TCLDIR macro.
!error $(MSG)
!endif
!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 =^
-Don't know where tcl.h is. The TCLDIR macro doesn't appear correct.
+Failed to find tcl.h. The TCLDIR macro does not appear correct.
!error $(MSG)
!endif
!endif
-#----------------------------------------------------------
-# Get the version from the header file. Try all possibles
-# even though some aren't fully valid.
-#----------------------------------------------------------
+### 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
-!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"
@@ -443,5 +441,7 @@ TCLTOOLSDIR = $(_TCLDIR)\tools
!message *** Output directory will be '$(OUT_DIR)'
!message *** Suffix for binaries will be '$(SUFX)'
!message *** Optional defines are '$(OPTDEFINES)'
+!message *** Compiler version $(VCVER) options are\
+ '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS)'
!endif