diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2006-10-18 08:56:21 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2006-10-18 08:56:21 (GMT) |
commit | 0316c17f397c3ac76b701a6241a05fea2e57b64d (patch) | |
tree | dcefe6334ff1101d026a8b15ab5bb79d419a103c | |
parent | 0bfe7a95f6e20c7fbe6d5fbbb400fc6127642082 (diff) | |
download | tk-0316c17f397c3ac76b701a6241a05fea2e57b64d.zip tk-0316c17f397c3ac76b701a6241a05fea2e57b64d.tar.gz tk-0316c17f397c3ac76b701a6241a05fea2e57b64d.tar.bz2 |
Ensure builds with VC6 without Platform SDK and pickup MACHINE from environment
to make life easier on Windows non-x86 platforms.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win/nmakehlp.c | 24 | ||||
-rw-r--r-- | win/rules.vc | 9 |
3 files changed, 25 insertions, 13 deletions
@@ -1,3 +1,8 @@ +2006-10-18 Pat Thoyts <patthoyts@users.sourceforge.net> + + * win/nmakehlp.c: Ensure builds with VC6 without Platform SDK. + * win/rules.vc: Pickup MACHINE from environment. + 2006-10-17 Don Porter <dgp@users.sourceforge.net> * generic/tkPanedWindow.c: Cleaned up some code flagged by a diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 5f0d464..91a77fc 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -10,22 +10,26 @@ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * ---------------------------------------------------------------------------- - * RCS: @(#) $Id: nmakehlp.c,v 1.1.6.4 2006/10/06 18:10:41 patthoyts Exp $ + * RCS: @(#) $Id: nmakehlp.c,v 1.1.6.5 2006/10/18 08:56:21 patthoyts Exp $ * ---------------------------------------------------------------------------- */ #define _CRT_SECURE_NO_DEPRECATE #include <windows.h> -#include <shlwapi.h> #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") -#pragma comment (lib, "shlwapi.lib") #include <stdio.h> #include <math.h> #if defined(_M_IA64) || defined(_M_AMD64) #pragma comment(lib, "bufferoverflowU") #endif +/* ISO hack for dumb VC++ */ +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + + /* protos */ @@ -77,7 +81,7 @@ main( switch (*(argv[1]+1)) { case 'c': if (argc != 3) { - chars = wnsprintf(msg, sizeof(msg)-1, + chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c <compiler option>\n" "Tests for whether cl.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); @@ -88,7 +92,7 @@ main( return CheckForCompilerFeature(argv[2]); case 'l': if (argc != 3) { - chars = wnsprintf(msg, sizeof(msg) - 1, + chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -l <linker option>\n" "Tests for whether link.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); @@ -99,7 +103,7 @@ main( return CheckForLinkerFeature(argv[2]); case 'f': if (argc == 2) { - chars = wnsprintf(msg, sizeof(msg) - 1, + chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -f <string> <substring>\n" "Find a substring within another\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); @@ -117,7 +121,7 @@ main( } case 'g': if (argc == 2) { - chars = wnsprintf(msg, sizeof(msg) - 1, + chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -g <file> <string>\n" "grep for a #define\n" "exitcodes: integer of the found string (no decimals)\n", @@ -129,7 +133,7 @@ main( return GrepForDefine(argv[2], argv[3]); } } - chars = wnsprintf(msg, sizeof(msg) - 1, + chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c|-l|-f ...\n" "This is a little helper app to equalize shell differences between WinNT and\n" "Win9x and get nmake.exe to accomplish its job.\n", @@ -217,7 +221,7 @@ CheckForCompilerFeature( if (!ok) { DWORD err = GetLastError(); - int chars = wsprintf(msg, + int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| @@ -343,7 +347,7 @@ CheckForLinkerFeature( if (!ok) { DWORD err = GetLastError(); - int chars = wnsprintf(msg, sizeof(msg) - 1, + int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| diff --git a/win/rules.vc b/win/rules.vc index 46e0ec5..bfe285e 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -11,7 +11,7 @@ # Copyright (c) 2003-2006 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.5.2.6 2006/10/06 18:10:41 patthoyts Exp $ +# RCS: @(#) $Id: rules.vc,v 1.5.2.7 2006/10/18 08:56:21 patthoyts Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -31,7 +31,11 @@ _INSTALLDIR = $(INSTALLDIR:/=\) !endif !ifndef MACHINE +!if "$(CPU)" == "" MACHINE = IX86 +!else +MACHINE = $(CPU) +!endif !endif !ifndef CFG_ENCODING @@ -460,7 +464,6 @@ Failed to find tcl.h. The TCLDIR macro does not appear correct. #!endif TCL_DOTVERSION = 8.4 -TCL_PATCHLEVEL = .14 TCL_VERSION = $(TCL_DOTVERSION:.=) !if $(TCLINSTALL) @@ -494,7 +497,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) +!message *** Compiler version $(VCVER), arch is $(MACHINE) !message *** Compiler options '$(OPTIMIZATIONS) $(DEBUGFLAGS)' !message *** Link options '$(LINKERFLAGS)' |