From: Pat Thoyts Date: Sun, 24 Sep 2006 23:48:52 +0000 (+0000) Subject: Updated windows build files X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=f67d5a9f5aabe9711a507637857971a165d45c5e;p=filemonitor Updated windows build files --- diff --git a/win/makefile.vc b/win/makefile.vc index 88d5449..c0d5df0 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -21,10 +21,14 @@ # RCS: @(#)$Id$ #------------------------------------------------------------------------- -!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCToolkitInstallDir) +# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) +# or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define +# VCINSTALLDIR instead. +!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) MSG = ^ -You will need to run vcvars32.bat from Developer Studio, first, to setup^ -the environment. Jump to this line to read the new instructions. +You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ +Platform SDK first to setup the environment. Jump to this line to read^ +the build instructions. !error $(MSG) !endif @@ -54,7 +58,6 @@ the environment. Jump to this line to read the new instructions. # clean/realclean/distclean -- varying levels of cleaning. # # 4) Macros usable on the commandline: -# # INSTALLDIR= # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. @@ -154,7 +157,7 @@ Please `cd` to its location first. # #------------------------------------------------------------------------- -PROJECT = filemonitor +PROJECT = Filemonitor !include "rules.vc" DOTVERSION = 0.6 @@ -204,26 +207,22 @@ COMPATDIR = $(ROOT)\compat !if !$(DEBUG) !if $(OPTIMIZING) ### This cranks the optimization level to maximize speed -cdebug = -O2 -Op -Gs +cdebug = -O2 $(OPTIMIZATIONS) !else cdebug = !endif !else if "$(MACHINE)" == "IA64" ### Warnings are too many, can't support warnings into errors. -cdebug = -Z7 -Od -GZ +cdebug = -Z7 -Od $(DEBUGFLAGS) !else -cdebug = -Z7 -Od -GZ -WX +cdebug = -Z7 -WX $(DEBUGFLAGS) !endif ### Declarations common to all compiler options -cflags = -nologo -c -W3 -YX -Fp$(TMP_DIR)^\ - -!if $(PENT_0F_ERRATA) -cflags = $(cflags) -QI0f -!endif +cflags = -nologo -c $(COMPILERFLAGS) -Fp$(TMP_DIR)^\ -!if $(ITAN_B_ERRATA) -cflags = $(cflags) -QIA64_Bx +!if $(VCVER) > 7 +cflags =$(cflags) -D_CRT_SECURE_NO_DEPRECATE !endif !if $(MSVCRT) @@ -240,8 +239,7 @@ crt = -MT !endif !endif -INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) \ - -I"$(WINDIR)" -I"$(GENERICDIR)" +INCLUDES = $(TCL_INCLUDES) -I"$(WINDIR)" -I"$(GENERICDIR)" BASE_CFLAGS = $(cflags) $(cdebug) $(crt) $(INCLUDES) CON_CFLAGS = $(cflags) $(cdebug) $(crt) -DCONSOLE TCL_CFLAGS = -DUSE_TCL_STUBS -DPACKAGE_NAME="$(PROJECT)" \ @@ -254,6 +252,9 @@ TCL_CFLAGS = -DUSE_TCL_STUBS -DPACKAGE_NAME="$(PROJECT)" \ !if $(DEBUG) ldebug = -debug:full -debugtype:cv +!if $(MSVCRT) +ldebug = $(ldebug) -nodefaultlib:msvcrt +!endif !else ldebug = -release -opt:ref -opt:icf,3 !endif @@ -287,7 +288,7 @@ baselibs = $(TCLSTUBLIB) #--------------------------------------------------------------------- !IF "$(TESTPAT)" != "" -TESTFLAGS = -file $(TESTPAT) +TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) !ENDIF #--------------------------------------------------------------------- @@ -298,7 +299,6 @@ all: setup $(PROJECT) $(PROJECT): setup $(PRJLIB) install: install-binaries install-libraries install-docs - # Tests need to ensure we load the right dll file we # have to handle the output differently on Win9x. # @@ -327,10 +327,17 @@ setup: @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) $(PRJLIB): $(DLLOBJS) +!if $(STATIC_BUILD) + $(lib32) -nologo -out:$@ @<< +$** +<< +!else $(link32) $(dlllflags) -out:$@ $(baselibs) @<< $** << + $(_VC_MANIFEST_EMBED_DLL) -@del $*.exp +!endif $(PRJSTUBLIB): $(PRJSTUBOBJS) $(lib32) -nologo -out:$@ $(PRJSTUBOBJS) @@ -388,12 +395,13 @@ $< install-binaries: @echo Installing binaries to '$(SCRIPT_INSTALL_DIR)' - @if not exist $(SCRIPT_INSTALL_DIR)\nul mkdir "$(SCRIPT_INSTALL_DIR)" + @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" @$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL install-libraries: - @echo Installing to '$(SCRIPT_INSTALL_DIR)' - @if exist $(LIBDIR)\nul $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" + @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' + @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" + @echo Installing package index int '$(SCRIPT_INSTALL_DIR)' @type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" if {[info exists ::tcl_platform(debug)]} { package ifneeded $(PROJECT) $(DOTVERSION) [list load [file join $$dir $(PROJECT)$(VERSION)g.$(EXT)]] @@ -403,6 +411,8 @@ if {[info exists ::tcl_platform(debug)]} { << install-docs: + @echo Installing documentation files to '$(DOC_INSTALL_DIR)' + @if exist $(DOCDIR) $(CPY) $(DOCDIR)\*.n "$(DOC_INSTALL_DIR)" #--------------------------------------------------------------------- # Clean up diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 30f81bf..5d8ca6f 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -13,30 +13,37 @@ * RCS: @(#) $Id$ * ---------------------------------------------------------------------------- */ + +#define _CRT_SECURE_NO_DEPRECATE #include -#include #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") +#include /* protos */ -int CheckForCompilerFeature (const char *option); -int CheckForLinkerFeature (const char *option); -int IsIn (const char *string, const char *substring); -DWORD WINAPI ReadFromPipe (LPVOID args); -int GetVersionFromHeader(const char *tclh, const char *tkh); + +int CheckForCompilerFeature(const char *option); +int CheckForLinkerFeature(const char *option); +int IsIn(const char *string, const char *substring); +int GetVersionFromHeader(const char *tclh, const char *tkh); +DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ + +#define CHUNK 25 +#define STATICBUFFERSIZE 1000 typedef struct { HANDLE pipe; - char buffer[1000]; + char buffer[STATICBUFFERSIZE]; } pipeinfo; pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'}; pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'}; + +/* + * exitcodes: 0 == no, 1 == yes, 2 == error + */ - - -/* exitcodes: 0 == no, 1 == yes, 2 == error */ int main (int argc, char *argv[]) { @@ -44,6 +51,19 @@ main (int argc, char *argv[]) DWORD dwWritten; int chars; + /* + * Make sure children (cl.exe and link.exe) are kept quiet. + */ + + SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); + + /* + * Make sure the compiler and linker aren't effected by the outside world. + */ + + SetEnvironmentVariable("CL", ""); + SetEnvironmentVariable("LINK", ""); + if (argc > 1 && *argv[1] == '-') { switch (*(argv[1]+1)) { case 'c': @@ -72,7 +92,10 @@ main (int argc, char *argv[]) WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } else if (argc == 3) { - /* if the string is blank, there is no match */ + /* + * If the string is blank, there is no match. + */ + return 0; } else { return IsIn(argv[2], argv[3]); @@ -95,18 +118,19 @@ main (int argc, char *argv[]) WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } - + int -CheckForCompilerFeature (const char *option) +CheckForCompilerFeature( + const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; - DWORD threadID; + DWORD threadID, n; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; - char cmdline[100]; + char cmdline[256]; hProcess = GetCurrentProcess(); @@ -121,24 +145,49 @@ CheckForCompilerFeature (const char *option) sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = FALSE; - /* create a non-inheritible pipe. */ + /* + * Create a non-inheritible pipe. + */ + CreatePipe(&Out.pipe, &h, &sa, 0); - /* dupe the write side, make it inheritible, and close the original. */ - DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, - 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + /* + * Dupe the write side, make it inheritible, and close the original. + */ + + DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + + /* + * Same as above, but for the error side. + */ - /* Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); - DuplicateHandle(hProcess, h, hProcess, &si.hStdError, - 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + + /* + * Base command line (use nmake environment) + */ + + n = GetEnvironmentVariable("CC", cmdline, 255); + cmdline[n] = 0; + if (n == 0) + strcpy(cmdline, "cl.exe"); + + strncat(cmdline, " -nologo -c -TC -Zs -X ", 255); + + /* + * Append our option for testing + */ - /* base command line */ - strcpy(cmdline, "cl.exe -nologo -c -TC -Fdtemp "); - /* append our option for testing */ strcat(cmdline, option); - /* filename to compile, which exists, but is nothing and empty. */ - strcat(cmdline, " nul"); + + /* + * Filename to compile, which exists, but is nothing and empty. + */ + + strcat(cmdline, " .\\nul"); ok = CreateProcess( NULL, /* Module name. */ @@ -154,45 +203,75 @@ CheckForCompilerFeature (const char *option) if (!ok) { DWORD err = GetLastError(); - int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); + int chars = wsprintf(msg, + "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars], + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| + FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err,NULL); return 2; } - /* close our references to the write handles that have now been inherited. */ + /* + * Close our references to the write handles that have now been inherited. + */ + CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); - /* start the pipe reader threads. */ + /* + * Start the pipe reader threads. + */ + pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); - /* block waiting for the process to end. */ + /* + * Block waiting for the process to end. + */ + WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); - /* clean up temporary files before returning */ - DeleteFile("temp.idb"); - DeleteFile("temp.pdb"); + /* + * Wait for our pipe to get done reading, should it be a little slow. + */ - /* wait for our pipe to get done reading, should it be a little slow. */ - WaitForMultipleObjects(2, pipeThreads, TRUE, 500); + WaitForMultipleObjects(2, pipeThreads, TRUE, INFINITE); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); - /* look for the commandline warning code in both streams. */ - return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL); -} +#ifdef _DEBUG + { + DWORD err = 0; + strcat(cmdline, "\n"); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), cmdline, + strlen(cmdline), &err, NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), Out.buffer, + strlen(Out.buffer), &err,NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), Err.buffer, + strlen(Err.buffer), &err,NULL); + } +#endif + /* + * Look for the commandline warning code in both streams. + * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. + */ + + return !(strstr(Out.buffer, "D4002") != NULL + || strstr(Err.buffer, "D4002") != NULL + || strstr(Out.buffer, "D9002") != NULL + || strstr(Err.buffer, "D9002") != NULL); +} + int -CheckForLinkerFeature (const char *option) +CheckForLinkerFeature( + const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; @@ -216,24 +295,38 @@ CheckForLinkerFeature (const char *option) sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; - /* create a non-inheritible pipe. */ + /* + * Create a non-inheritible pipe. + */ + CreatePipe(&Out.pipe, &h, &sa, 0); - /* dupe the write side, make it inheritible, and close the original. */ - DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, - 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + /* + * Dupe the write side, make it inheritible, and close the original. + */ + + DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + + /* + * Same as above, but for the error side. + */ - /* Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); - DuplicateHandle(hProcess, h, hProcess, &si.hStdError, - 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + + /* + * Base command line. + */ - /* base command line */ strcpy(cmdline, "link.exe -nologo "); - /* append our option for testing */ + + /* + * Append our option for testing. + */ + strcat(cmdline, option); - /* filename to compile, which exists, but is nothing and empty. */ -// strcat(cmdline, " nul"); ok = CreateProcess( NULL, /* Module name. */ @@ -249,39 +342,82 @@ CheckForLinkerFeature (const char *option) if (!ok) { DWORD err = GetLastError(); - int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); + int chars = wsprintf(msg, + "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars], + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| + FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err,NULL); return 2; } - /* close our references to the write handles that have now been inherited. */ + /* + * Close our references to the write handles that have now been inherited. + */ + CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); - /* start the pipe reader threads. */ + /* + * Start the pipe reader threads. + */ + pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); - /* block waiting for the process to end. */ + /* + * Block waiting for the process to end. + */ + WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); - /* wait for our pipe to get done reading, should it be a little slow. */ + /* + * Wait for our pipe to get done reading, should it be a little slow. + */ + WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); - /* look for the commandline warning code in the stderr stream. */ - return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL); + /* + * Look for the commandline warning code in the stderr stream. + */ + + return !(strstr(Out.buffer, "LNK1117") != NULL || + strstr(Err.buffer, "LNK1117") != NULL); } + +#if 1 +DWORD WINAPI +ReadFromPipe( + LPVOID args) +{ + pipeinfo *pi = (pipeinfo *) args; + char *lastBuf = pi->buffer; + DWORD dwRead; + BOOL ok; + again: + if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) { + CloseHandle(pi->pipe); + return -1; + } + ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L); + if (!ok || dwRead == 0) { + CloseHandle(pi->pipe); + return 0; + } + lastBuf += dwRead; + goto again; + + return 0; /* makes the compiler happy */ +} +#else DWORD WINAPI ReadFromPipe (LPVOID args) { @@ -293,22 +429,22 @@ ReadFromPipe (LPVOID args) again: ok = ReadFile(pi->pipe, lastBuf, 25, &dwRead, 0L); if (!ok || dwRead == 0) { - CloseHandle(pi->pipe); - return 0; + CloseHandle(pi->pipe); + return 0; } lastBuf += dwRead; goto again; return 0; /* makes the compiler happy */ } - +#endif + int IsIn (const char *string, const char *substring) { return (strstr(string, substring) != NULL); } - - + static double ReadVersionFromHeader(const char *file, const char *macro) { @@ -329,7 +465,7 @@ ReadVersionFromHeader(const char *file, const char *macro) } return d; } - + int GetVersionFromHeader(const char *tclh, const char *tkh) { diff --git a/win/rules.vc b/win/rules.vc index ba4b828..e1f7d19 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -68,7 +68,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 @@ -77,7 +77,7 @@ RMDIR = deltree /Y #---------------------------------------------------------- ### test for optimizations -!if [nmakehlp -c -Otip] +!if [nmakehlp -c -Ot] !message *** Compiler has 'Optimizations' OPTIMIZING = 1 !else @@ -85,15 +85,67 @@ 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:strict] +OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict +!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 doesn't 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' @@ -103,21 +155,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 #---------------------------------------------------------- @@ -133,6 +190,7 @@ MSVCRT = 0 LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 0 +UNCHECKED = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -182,6 +240,12 @@ USE_THREAD_ALLOC = 1 !else USE_THREAD_ALLOC = 0 !endif +!if [nmakehlp -f $(OPTS) "unchecked"] +!message *** Doing unchecked +UNCHECKED = 1 +!else +UNCHECKED = 0 +!endif !endif @@ -210,6 +274,13 @@ DBGX = SUFX = $(SUFX:g=) !endif +!if "$(MACHINE)" != "IX86" +BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) +!endif +!if $(VCVER) > 6 +BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) +!endif + TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX !if !$(STATIC_BUILD) @@ -299,7 +370,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 @@ -432,5 +503,5 @@ TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" !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 '$(OPTIMIZATIONS) $(DEBUGFLAGS)' !endif