From 7a16c4ecf67b9294f4e677a5d6cfb995eb9b6cd6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 22 Nov 2012 21:12:45 +0000 Subject: [Bug 3588824]: bug in image index handling for weird image names --- ChangeLog | 5 +++++ generic/tkTextIndex.c | 15 ++++++++++++--- tests/textIndex.test | 12 ++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b95588b..8365fc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-11-?? Francois Vogel + + * generic/tkTextIndex.c: [Bug 3588824]: bug in image index handling + * tests/textIndex.test: for weird image names + 2012-11-13 Jan Nijtmans * win/tkWinTest.c: [Bug 3585396]: winDialog.test requires user diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 7cfeaea..714a47d 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -328,9 +328,10 @@ TkTextGetIndex(interp, textPtr, string, indexPtr) /* *--------------------------------------------------------------------- * Stage 1: check to see if the index consists of nothing but a mark - * name. We do this check now even though it's also done later, in - * order to allow mark names that include funny characters such as - * spaces or "+1c". + * name, an embedded window or an embedded image. We do this check + * now even though it's also done later, in order to allow mark names, + * embedded window names or image names that include funny characters + * such as spaces or "+1c". *--------------------------------------------------------------------- */ @@ -338,6 +339,14 @@ TkTextGetIndex(interp, textPtr, string, indexPtr) return TCL_OK; } + if (TkTextWindowIndex(textPtr, string, indexPtr) != 0) { + return TCL_OK; + } + + if (TkTextImageIndex(textPtr, string, indexPtr) != 0) { + return TCL_OK; + } + /* *------------------------------------------------ * Stage 2: start again by parsing the base index. diff --git a/tests/textIndex.test b/tests/textIndex.test index 0337fca..1837e7d 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -219,9 +219,21 @@ set weirdTag "funny . +- 22.1\n\t{" set weirdMark "asdf \n{-+ 66.2\t" .t mark set $weirdMark 4.0 .t tag config y -relief raised +set weirdImage "foo-1" +.t image create 2.0 -image [image create photo $weirdImage] test textIndex-3.1 {TkTextGetIndex, weird mark names} { list [catch {.t index $weirdMark} msg] $msg } {0 4.0} +test textIndex-3.2 {TkTextGetIndex, weird mark names} knownBug { + list [catch {.t index "$weirdMark -1char"} msg] $msg +} {0 4.0} +test textIndex-3.3 {TkTextGetIndex, weird image names} { + list [catch {.t index $weirdImage} msg] $msg +} {0 2.0} +test textIndex-3.4 {TkTextGetIndex, weird image names} knownBug { + list [catch {.t index "$weirdImage -1char"} msg] $msg +} {0 2.0} +.t delete 2.0 ; # remove the weirdImage test textIndex-4.1 {TkTextGetIndex, tags} { list [catch {.t index x.first} msg] $msg -- cgit v0.12 From 19fbc8aec9cd206f6df2611aa7a553599f3e5931 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 24 Nov 2012 08:23:27 +0000 Subject: Added tests for weird embedded windows names --- tests/textIndex.test | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/textIndex.test b/tests/textIndex.test index 1837e7d..885ed8e 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -220,20 +220,30 @@ set weirdMark "asdf \n{-+ 66.2\t" .t mark set $weirdMark 4.0 .t tag config y -relief raised set weirdImage "foo-1" -.t image create 2.0 -image [image create photo $weirdImage] +.t image create 2.1 -image [image create photo $weirdImage] +set weirdEmbWin ".t.bar-1" +entry $weirdEmbWin +.t window create 3.1 -window $weirdEmbWin test textIndex-3.1 {TkTextGetIndex, weird mark names} { list [catch {.t index $weirdMark} msg] $msg } {0 4.0} test textIndex-3.2 {TkTextGetIndex, weird mark names} knownBug { list [catch {.t index "$weirdMark -1char"} msg] $msg } {0 4.0} -test textIndex-3.3 {TkTextGetIndex, weird image names} { +test textIndex-3.3 {TkTextGetIndex, weird embedded window names} { + list [catch {.t index $weirdEmbWin} msg] $msg +} {0 3.1} +test textIndex-3.4 {TkTextGetIndex, weird embedded window names} knownBug { + list [catch {.t index "$weirdEmbWin -1char"} msg] $msg +} {0 3.0} +test textIndex-3.5 {TkTextGetIndex, weird image names} { list [catch {.t index $weirdImage} msg] $msg -} {0 2.0} -test textIndex-3.4 {TkTextGetIndex, weird image names} knownBug { +} {0 2.1} +test textIndex-3.6 {TkTextGetIndex, weird image names} knownBug { list [catch {.t index "$weirdImage -1char"} msg] $msg } {0 2.0} -.t delete 2.0 ; # remove the weirdImage +.t delete 3.1 ; # remove the weirdEmbWin +.t delete 2.1 ; # remove the weirdImage test textIndex-4.1 {TkTextGetIndex, tags} { list [catch {.t index x.first} msg] $msg -- cgit v0.12 From ebdb1af200a5bdf041a872601852a6b93ae20900 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Dec 2012 01:24:12 +0000 Subject: Fixed commit date --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8365fc5..a963224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2012-11-?? Francois Vogel +2012-12-03 Francois Vogel * generic/tkTextIndex.c: [Bug 3588824]: bug in image index handling * tests/textIndex.test: for weird image names -- cgit v0.12 From 4e7c225d8801b69a2507ccaaabe617528a63bd38 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 6 Dec 2012 10:49:51 +0000 Subject: Force the use of the correct internal function for parsing hex colors rather than leaving it to the vagaries of the system library (buggy on some versions of MinGW apparently). --- xlib/xcolors.c | 149 +++++++++++++++++++++++++-------------------------------- 1 file changed, 64 insertions(+), 85 deletions(-) diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 70ab3cb..2c99c5d 100755 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -14,11 +14,14 @@ #include "tkInt.h" /* - * Index array. For each of the characters 'a'-'y', this table gives the first color - * starting with that character in the xColors table. + * Index array. For each of the characters 'a'-'y', this table gives the first + * color starting with that character in the xColors table. */ -static const unsigned char az[] = {0, 5, 13, 21, 45, 46, 50, 60, 62, 65, 66, - 67, 91, 106, 109, 115, 126, 127, 130, 144, 149, 150, 152, 155, 156, 158}; + +static const unsigned char az[] = { + 0, 5, 13, 21, 45, 46, 50, 60, 62, 65, 66, + 67, 91, 106, 109, 115, 126, 127, 130, 144, 149, 150, 152, 155, 156, 158 +}; /* * Define an array that defines the mapping from color names to RGB values. @@ -241,15 +244,18 @@ static const elem xColors[] = { * None. * *---------------------------------------------------------------------- + * + * This only handles hex-strings without 0x prefix. Luckily, that's just what + * we need. */ -#if defined(__WIN32__) && !defined(__CYGWIN__) -# ifdef NO_STRTOI64 -/* This version only handles hex-strings without 0x prefix */ -static __int64 -_strtoi64(const char *spec, char **p, int base) +static Tcl_WideInt +parseHex64bit( + const char *spec, + char **p, + int base) { - __int64 result = 0; + Tcl_WideInt result = 0; char c; while ((c = *spec)) { if ((c >= '0') && (c <= '9')) { @@ -267,16 +273,18 @@ _strtoi64(const char *spec, char **p, int base) *p = (char *) spec; return result; } -# endif -#else -# define _strtoi64 strtoll -#endif -static int colorcmp(const char *spec, const char *pname, int *special) { +static int +colorcmp( + const char *spec, + const char *pname, + int *special) +{ int r; int c, d; int notequal = 0; int num = 0; + do { d = *pname++; c = (*spec == ' '); @@ -286,9 +294,12 @@ static int colorcmp(const char *spec, const char *pname, int *special) { if ((unsigned)(d - 'A') <= (unsigned)('Z' - 'A')) { d += 'a' - 'A'; } else if (c) { - /* A space doesn't match a lowercase, but we don't know - * yet whether we should return a negative or positive - * number. That depends on what follows. */ + /* + * A space doesn't match a lowercase, but we don't know yet + * whether we should return a negative or positive number. That + * depends on what follows. + */ + notequal = 1; } c = *spec++; @@ -305,19 +316,24 @@ static int colorcmp(const char *spec, const char *pname, int *special) { } } r = c - d; - } while(!r && d); + } while (!r && d); + if (!r && notequal) { - /* Strings are equal, but difference in spacings only. We should still - * report not-equal, so "burly wood" is not a valid color */ + /* + * Strings are equal, but difference in spacings only. We should still + * report not-equal, so "burly wood" is not a valid color. + */ + r = 1; } *special = num; return r; } -#define RED(p) ((unsigned char)(p)[0]) -#define GREEN(p) ((unsigned char)(p)[1]) -#define BLUE(p) ((unsigned char)(p)[2]) +#define RED(p) ((unsigned char) (p)[0]) +#define GREEN(p) ((unsigned char) (p)[1]) +#define BLUE(p) ((unsigned char) (p)[2]) +#define US(expr) ((unsigned short) (expr)) Status XParseColor( @@ -328,42 +344,44 @@ XParseColor( { if (spec[0] == '#') { char *p; - Tcl_WideInt value = _strtoi64(++spec, &p, 16); + Tcl_WideInt value = parseHex64bit(++spec, &p, 16); switch ((int)(p-spec)) { case 3: - colorPtr->red = (unsigned short) (((value >> 8) & 0xf) * 0x1111); - colorPtr->green = (unsigned short) (((value >> 4) & 0xf) * 0x1111); - colorPtr->blue = (unsigned short) ((value & 0xf) * 0x1111); + colorPtr->red = US(((value >> 8) & 0xf) * 0x1111); + colorPtr->green = US(((value >> 4) & 0xf) * 0x1111); + colorPtr->blue = US((value & 0xf) * 0x1111); break; case 6: - colorPtr->red = (unsigned short) (((value >> 16) & 0xff) | ((value >> 8) & 0xff00)); - colorPtr->green = (unsigned short) (((value >> 8) & 0xff) | (value & 0xff00)); - colorPtr->blue = (unsigned short) ((value & 0xff) | (value << 8)); + colorPtr->red = US(((value >> 16) & 0xff) | ((value >> 8) & 0xff00)); + colorPtr->green = US(((value >> 8) & 0xff) | (value & 0xff00)); + colorPtr->blue = US((value & 0xff) | (value << 8)); break; case 9: - colorPtr->red = (unsigned short) (((value >> 32) & 0xf) | ((value >> 20) & 0xfff0)); - colorPtr->green = (unsigned short) (((value >> 20) & 0xf) | ((value >> 8) & 0xfff0)); - colorPtr->blue = (unsigned short) (((value >> 8) & 0xf) | (value << 4)); + colorPtr->red = US(((value >> 32) & 0xf) | ((value >> 20) & 0xfff0)); + colorPtr->green = US(((value >> 20) & 0xf) | ((value >> 8) & 0xfff0)); + colorPtr->blue = US(((value >> 8) & 0xf) | (value << 4)); break; case 12: - colorPtr->red = (unsigned short) (value >> 32); - colorPtr->green = (unsigned short) (value >> 16); - colorPtr->blue = (unsigned short) value; + colorPtr->red = US(value >> 32); + colorPtr->green = US(value >> 16); + colorPtr->blue = US(value); break; default: return 0; } } else { - int size, num; - const elem *p; - const char *q; /* * Perform a binary search on the sorted array of colors. * size = current size of search range * p = pointer to current element being considered. */ + + int size, num; + const elem *p; + const char *q; int r = (spec[0] - 'A') & 0xdf; + if (r >= (int) sizeof(az) - 1) { return 0; } @@ -386,11 +404,15 @@ XParseColor( r = colorcmp(spec + 1, *p, &num); } if (num > (*p)[31]) { - if (((*p)[31] != 8) || num > 100) + if (((*p)[31] != 8) || num > 100) { return 0; + } num = (num * 255 + 50) / 100; if ((num == 230) || (num == 128)) { - /* Those two entries have a deviation i.r.t the table */ + /* + * Those two entries have a deviation i.r.t the table. + */ + num--; } num |= (num << 8); @@ -408,49 +430,6 @@ XParseColor( return 1; } - -#if 0 -int main() { - XColor color; - char buf[32]; - int charindex; - int i, result; - int repeat = 1; - int num, maxnum; - char *end; - - while (repeat--) { - buf[0] = 'a'; - charindex = 1; - for (i = 0; i < sizeof(xColors)/sizeof(xColors[0]); ++i) { - while (i >= az[charindex]) { - ++charindex; - ++(buf[0]); - } - strcpy(buf + 1, xColors[i]); - end = buf + strlen(buf); - num = 0; - result = XParseColor(0, 0, buf, &color); - printf("%3d %3d %3d\t\t%s\n", color.red >> 8, color.green >> 8, color.blue >> 8, buf); - maxnum = xColors[i][31]; - if (maxnum == 8) maxnum = 100; - while (result && ++num <= maxnum) { - sprintf(end, "%d", num); - result = XParseColor(0, 0, buf, &color); - printf("%3d %3d %3d\t\t%s\n", color.red >> 8, color.green >> 8, color.blue >> 8, buf); - } - if (!result) { - break; - } - } - } - if (!result) { - printf("NOT OK: %s\n", buf); - } else { - printf("OK\n"); - } -} -#endif /* * Local Variables: * mode: c -- cgit v0.12 From 1f5824f717cf3e918442c64afe2b9eb9e8c88fd6 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 6 Dec 2012 13:59:29 +0000 Subject: Minor improvements now that we're no longer tracking a standard API. --- xlib/xcolors.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 2c99c5d..66591c7 100755 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -252,8 +252,7 @@ static const elem xColors[] = { static Tcl_WideInt parseHex64bit( const char *spec, - char **p, - int base) + char **p) { Tcl_WideInt result = 0; char c; @@ -344,7 +343,7 @@ XParseColor( { if (spec[0] == '#') { char *p; - Tcl_WideInt value = parseHex64bit(++spec, &p, 16); + Tcl_WideInt value = parseHex64bit(++spec, &p); switch ((int)(p-spec)) { case 3: -- cgit v0.12 From 1d53b374aa101c0a5fe079f6e1ead45b64204af9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Jan 2013 12:57:26 +0000 Subject: Restructure Tk's stub library: No longer use Tcl_SetResult() for setting the error message, but Tcl_ResetResult/Tcl_AppendResult, as all other stub libraries do. This will allow us to remove Tcl_SetResult() in Tcl 9.0, eventually. More structural improvements, taken over from Tcl 8.6's tclOOStubLib.c/tclTomMathStubLib.c and from Tk 8.6's tclStubLib.c --- generic/tkStubLib.c | 145 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 59 deletions(-) diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index 6f19aa8..f803e49 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -1,34 +1,16 @@ -/* +/* * tkStubLib.c -- * - * Stub object that will be statically linked into extensions that wish + * Stub object that will be statically linked into extensions that want * to access Tk. * - * Copyright (c) 1998 Paul Duffin. * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998 Paul Duffin. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - - -/* - * We need to ensure that we use the stub macros so that this file contains - * no references to any of the stub functions. This will make it possible - * to build an extension that references Tk_InitStubs but doesn't end up - * including the rest of the stub functions. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#ifndef USE_TCL_STUBS -#define USE_TCL_STUBS -#endif -#undef USE_TCL_STUB_PROCS - -#ifndef USE_TK_STUBS -#define USE_TK_STUBS -#endif -#undef USE_TK_STUB_PROCS - #include "tkPort.h" #include "tkInt.h" @@ -46,68 +28,113 @@ #include "tkIntPlatDecls.h" #include "tkIntXlibDecls.h" +TkStubs *tkStubsPtr = NULL; +TkPlatStubs *tkPlatStubsPtr = NULL; +TkIntStubs *tkIntStubsPtr = NULL; +TkIntPlatStubs *tkIntPlatStubsPtr = NULL; +TkIntXlibStubs *tkIntXlibStubsPtr = NULL; + /* - * Ensure that Tk_InitStubs is built as an exported symbol. The other stub - * functions should be built as non-exported symbols. + * Use our own isdigit to avoid linking to libc on windows */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -TkStubs *tkStubsPtr; -TkPlatStubs *tkPlatStubsPtr; -TkIntStubs *tkIntStubsPtr; -TkIntPlatStubs *tkIntPlatStubsPtr; -TkIntXlibStubs *tkIntXlibStubsPtr; - +static int +isDigit(c) + CONST int c; +{ + return (c >= '0' && c <= '9'); +} /* *---------------------------------------------------------------------- * * Tk_InitStubs -- * - * Checks that the correct version of Tk is loaded and that it - * supports stubs. It then initialises the stub table pointers. + * Checks that the correct version of Tk is loaded and that it supports + * stubs. It then initialises the stub table pointers. * * Results: - * The actual version of Tk that satisfies the request, or - * NULL to indicate that an error occurred. + * The actual version of Tk that satisfies the request, or NULL to + * indicate that an error occurred. * * Side effects: * Sets the stub table pointers. * *---------------------------------------------------------------------- */ - -#ifdef Tk_InitStubs #undef Tk_InitStubs -#endif - CONST char * Tk_InitStubs(interp, version, exact) Tcl_Interp *interp; char *version; int exact; { - CONST char *actualVersion; - - actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact, - (ClientData *) &tkStubsPtr); - if (!actualVersion) { + CONST char *packageName = "Tk"; + CONST char *errMsg = NULL; + ClientData clientData = NULL; + CONST char *actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp, + packageName, version, 0, &clientData); + TkStubs *stubsPtr = (TkStubs *)clientData; + + if (actualVersion == NULL) { return NULL; } - if (!tkStubsPtr) { - Tcl_SetResult(interp, - "This implementation of Tk does not support stubs", - TCL_STATIC); - return NULL; + if (exact) { + CONST char *p = version; + int count = 0; + + while (*p) { + count += !isDigit(*p++); + } + if (count == 1) { + CONST char *q = actualVersion; + + p = version; + while (*p && (*p == *q)) { + p++; q++; + } + if (*p || isDigit(*q)) { + /* Construct error message */ + tclStubsPtr->tcl_PkgRequireEx(interp, packageName, version, 1, NULL); + return NULL; + } + } else { + actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp, packageName, + version, 1, NULL); + if (actualVersion == NULL) { + return NULL; + } + } + } + if (stubsPtr == NULL) { + errMsg = "missing stub table pointer"; + } else { + tkStubsPtr = stubsPtr; + if (stubsPtr->hooks) { + tkPlatStubsPtr = stubsPtr->hooks->tkPlatStubs; + tkIntStubsPtr = stubsPtr->hooks->tkIntStubs; + tkIntPlatStubsPtr = stubsPtr->hooks->tkIntPlatStubs; + tkIntXlibStubsPtr = stubsPtr->hooks->tkIntXlibStubs; + } else { + tkPlatStubsPtr = NULL; + tkIntStubsPtr = NULL; + tkIntPlatStubsPtr = NULL; + tkIntXlibStubsPtr = NULL; + } + return actualVersion; } - - tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs; - tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs; - tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs; - tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs; - - return actualVersion; + tclStubsPtr->tcl_ResetResult(interp); + tclStubsPtr->tcl_AppendResult(interp, "Error loading ", packageName, + " (requested version ", version, ", actual version ", + actualVersion, "): ", errMsg, NULL); + return NULL; } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ -- cgit v0.12 From 0e5b62601e1b369ad78f4eee43d473e74702cbd6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Jan 2013 09:51:01 +0000 Subject: Eliminate all usage of deprecated Tcl_EvalObj, Tcl_GlobalEval and Tcl_GlobalEvalObj functions. Add [file normalize] to pkgIndex.tcl, in order to prevent '..' in file paths. Remove unused TCLPATCHL, it should be ".0" for all final releases. --- generic/tkConsole.c | 10 +++++----- generic/tkTest.c | 4 ++-- generic/tkTextWind.c | 2 +- macosx/tkMacOSXHLEvents.c | 10 +++++----- macosx/tkMacOSXWindowEvent.c | 6 +++--- unix/Makefile.in | 7 +++---- unix/tkUnixSend.c | 6 +++--- unix/tkUnixWm.c | 2 +- win/Makefile.in | 13 ++++++------- win/tkWinScrlbr.c | 2 +- win/tkWinWm.c | 2 +- 11 files changed, 31 insertions(+), 33 deletions(-) diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 7d9da77..e93c0fc 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -444,7 +444,7 @@ Tk_CreateConsoleWindow(interp) } Tcl_Preserve((ClientData) consoleInterp); - result = Tcl_GlobalEval(consoleInterp, initCmd); + result = Tcl_EvalEx(consoleInterp, initCmd, -1, TCL_EVAL_GLOBAL); if (result == TCL_ERROR) { Tcl_Obj *objPtr = Tcl_GetVar2Ex(consoleInterp, "errorCode", NULL, TCL_GLOBAL_ONLY); @@ -548,7 +548,7 @@ ConsoleOutput(instanceData, buf, toWrite, errorCode) Tcl_DStringFree(&ds); Tcl_IncrRefCount(cmd); - Tcl_GlobalEvalObj(consoleInterp, cmd); + Tcl_EvalObjEx(consoleInterp, cmd, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(cmd); } } @@ -754,7 +754,7 @@ ConsoleObjCmd(clientData, interp, objc, objv) Tcl_IncrRefCount(cmd); if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { Tcl_Preserve((ClientData) consoleInterp); - result = Tcl_GlobalEvalObj(consoleInterp, cmd); + result = Tcl_EvalObjEx(consoleInterp, cmd, TCL_EVAL_GLOBAL); if (result == TCL_ERROR) { Tcl_Obj *objPtr = Tcl_GetVar2Ex(consoleInterp, "errorCode", NULL, TCL_GLOBAL_ONLY); @@ -830,7 +830,7 @@ InterpreterObjCmd(clientData, interp, objc, objv) Tcl_Preserve((ClientData) otherInterp); switch ((enum option) index) { case OTHER_EVAL: - result = Tcl_GlobalEvalObj(otherInterp, objv[2]); + result = Tcl_EvalObjEx(otherInterp, objv[2], TCL_EVAL_GLOBAL); /* * TODO: Should exceptions be filtered here? */ @@ -973,7 +973,7 @@ ConsoleEventProc(clientData, eventPtr) Tcl_Interp *consoleInterp = info->consoleInterp; if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { - Tcl_GlobalEval(consoleInterp, "tk::ConsoleExit"); + Tcl_EvalEx(consoleInterp, "tk::ConsoleExit", -1, TCL_EVAL_GLOBAL); } if (--info->refCount <= 0) { diff --git a/generic/tkTest.c b/generic/tkTest.c index 78496e6..e8d8d88 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -410,7 +410,7 @@ CBindingEvalProc(clientData, interp, eventPtr, tkwin, keySym) cbindPtr = (CBinding *) clientData; - return Tcl_GlobalEval(interp, cbindPtr->command); + return Tcl_EvalEx(interp, cbindPtr->command, -1, TCL_EVAL_GLOBAL); } static void @@ -420,7 +420,7 @@ CBindingFreeProc(clientData) CBinding *cbindPtr = (CBinding *) clientData; if (cbindPtr->delete != NULL) { - Tcl_GlobalEval(cbindPtr->interp, cbindPtr->delete); + Tcl_EvalEx(cbindPtr->interp, cbindPtr->delete, -1, TCL_EVAL_GLOBAL); ckfree((char *) cbindPtr->delete); } ckfree((char *) cbindPtr->command); diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 9f2582e..999febe 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -769,7 +769,7 @@ EmbWinLayoutProc(textPtr, indexPtr, ewPtr, offset, maxX, maxChars, * the window. */ - code = Tcl_GlobalEval(textPtr->interp, ewPtr->body.ew.create); + code = Tcl_EvalEx(textPtr->interp, ewPtr->body.ew.create, -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { createError: Tcl_BackgroundError(textPtr->interp); diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 985c85f..3c6ffd0 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -204,7 +204,7 @@ OappHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::OpenApplication"); + Tcl_EvalEx(interp, "::tk::mac::OpenApplication", -1, TCL_EVAL_GLOBAL); } return noErr; } @@ -238,7 +238,7 @@ RappHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::ReopenApplication", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication"); + Tcl_EvalEx(interp, "::tk::mac::ReopenApplication", -1, TCL_EVAL_GLOBAL); } return err; } @@ -271,7 +271,7 @@ PrefsHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences"); + Tcl_EvalEx(interp, "::tk::mac::ShowPreferences", -1, TCL_EVAL_GLOBAL); } return noErr; } @@ -590,9 +590,9 @@ ReallyKillMe( Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp; Tcl_CmdInfo dummy; if (Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::Quit"); + Tcl_EvalEx(interp, "::tk::mac::Quit", -1, TCL_EVAL_GLOBAL); } else { - Tcl_GlobalEval(interp, "exit"); + Tcl_EvalEx(interp, "exit", -1, TCL_EVAL_GLOBAL); } return 1; } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 369932c..4d2f477 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -125,7 +125,7 @@ TkMacOSXProcessApplicationEvent( toggleHide = 1; if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp, "::tk::mac::OnHide", &dummy)) { - Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnHide"); + Tcl_EvalEx(eventPtr->interp, "::tk::mac::OnHide", -1, TCL_EVAL_GLOBAL); } } statusPtr->stopProcessing = 1; @@ -135,7 +135,7 @@ TkMacOSXProcessApplicationEvent( toggleHide = 0; if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp, "::tk::mac::OnShow", &dummy)) { - Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnShow"); + Tcl_EvalEx(eventPtr->interp, "::tk::mac::OnShow", -1, TCL_EVAL_GLOBAL); } } statusPtr->stopProcessing = 1; @@ -896,7 +896,7 @@ TkWmProtocolEventProc( Tcl_Preserve((ClientData) protPtr); interp = protPtr->interp; Tcl_Preserve((ClientData) interp); - result = Tcl_GlobalEval(interp, protPtr->command); + result = Tcl_EvalEx(interp, protPtr->command, -1, TCL_EVAL_GLOBAL); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command for \""); Tcl_AddErrorInfo(interp, diff --git a/unix/Makefile.in b/unix/Makefile.in index e2c0289..3748571 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -8,7 +8,6 @@ # Current Tk version; used in various names. TCLVERSION = @TCL_VERSION@ -TCLPATCHL = @TCL_PATCH_LEVEL@ VERSION = @TK_VERSION@ MAJOR_VERSION = @TK_MAJOR_VERSION@ MINOR_VERSION = @TK_MINOR_VERSION@ @@ -662,15 +661,15 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) ${WISH rm -f "$(PKG_INDEX)"; \ (\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ - echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ + echo "if {[package vcompare [package provide Tcl] 8.4] != 0} return";\ if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ else \ echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ echo " || ([info exists ::argv] && [lsearch -exact \$$::argv -display] > -1))} {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file normalize [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]]";\ echo "} else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file normalize [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll]] Tk]";\ echo "}";\ fi \ ) > "$(PKG_INDEX)"; \ diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index f6ad7b5..089d6a4 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -982,7 +982,7 @@ Tk_SendCmd(clientData, interp, argc, argv) localInterp = riPtr->interp; Tcl_Preserve((ClientData) localInterp); if (firstArg == (argc-1)) { - result = Tcl_GlobalEval(localInterp, argv[firstArg]); + result = Tcl_EvalEx(localInterp, argv[firstArg], -1, TCL_EVAL_GLOBAL); } else { Tcl_DStringInit(&request); Tcl_DStringAppend(&request, argv[firstArg], -1); @@ -990,7 +990,7 @@ Tk_SendCmd(clientData, interp, argc, argv) Tcl_DStringAppend(&request, " ", 1); Tcl_DStringAppend(&request, argv[i], -1); } - result = Tcl_GlobalEval(localInterp, Tcl_DStringValue(&request)); + result = Tcl_EvalEx(localInterp, Tcl_DStringValue(&request), -1, TCL_EVAL_GLOBAL); Tcl_DStringFree(&request); } if (interp != localInterp) { @@ -1523,7 +1523,7 @@ SendEventProc(clientData, eventPtr) remoteInterp = riPtr->interp; Tcl_Preserve((ClientData) remoteInterp); - result = Tcl_GlobalEval(remoteInterp, script); + result = Tcl_EvalEx(remoteInterp, script, -1, TCL_EVAL_GLOBAL); /* * The call to Tcl_Release may have released the interpreter diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 1fe1174..233c881 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -5721,7 +5721,7 @@ TkWmProtocolEventProc(winPtr, eventPtr) Tcl_Preserve((ClientData) protPtr); interp = protPtr->interp; Tcl_Preserve((ClientData) interp); - result = Tcl_GlobalEval(interp, protPtr->command); + result = Tcl_EvalEx(interp, protPtr->command, -1, TCL_EVAL_GLOBAL); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command for \""); Tcl_AddErrorInfo(interp, protocolName); diff --git a/win/Makefile.in b/win/Makefile.in index b4a06a0..1c47ad2 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -5,7 +5,6 @@ # actual Makefile. TCLVERSION = @TCL_VERSION@ -TCLPATCHL = @TCL_PATCH_LEVEL@ VERSION = @TK_VERSION@ #---------------------------------------------------------------- @@ -143,7 +142,7 @@ MAN2TCL = man2tcl$(EXEEXT) @SET_MAKE@ -# Setting the VPATH variable to a list of paths will cause the +# Setting the VPATH variable to a list of paths will cause the # makefile to look into these paths when resolving .c to .obj # dependencies. @@ -366,7 +365,7 @@ SHELL_ENV = \ TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; -# Main targets. The default target -- all -- builds the binaries, +# Main targets. The default target -- all -- builds the binaries, # performs any post processing on libraries or documents. all: binaries libraries doc @@ -437,15 +436,15 @@ install-binaries: binaries $(COPY) $$i "$(BIN_INSTALL_DIR)"; \ fi; \ done - @echo "Creating package index $(PKG_INDEX)"; + @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ + echo "if {[package vcompare [package provide Tcl] 8.4] != 0} return";\ echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ echo " || ([info exists ::argv] && [lsearch -exact \$$::argv -display] > -1))} {";\ - echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ + echo " package ifneeded Tk $(VERSION) [list load [file normalize [file join \$$dir .. .. bin libtk$(VERSION).dll]] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo " package ifneeded Tk $(VERSION) [list load [file normalize [file join \$$dir .. .. bin $(TK_DLL_FILE)]] Tk]";\ echo "}";\ ) > $(PKG_INDEX); @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \ diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 130daa6..2145ff0 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -582,7 +582,7 @@ ScrollbarProc(hwnd, message, wParam, lParam) } interp = scrollPtr->info.interp; - code = Tcl_GlobalEval(interp, cmdString.string); + code = Tcl_EvalEx(interp, cmdString.string, -1, TCL_EVAL_GLOBAL); if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(interp, "\n (scrollbar command)"); Tcl_BackgroundError(interp); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 32768cf..b8dfd8d 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -6123,7 +6123,7 @@ TkWmProtocolEventProc(winPtr, eventPtr) Tcl_Preserve((ClientData) protPtr); interp = protPtr->interp; Tcl_Preserve((ClientData) interp); - result = Tcl_GlobalEval(interp, protPtr->command); + result = Tcl_EvalEx(interp, protPtr->command, -1, TCL_EVAL_GLOBAL); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command for \""); Tcl_AddErrorInfo(interp, name); -- cgit v0.12 From cc3054648b226f5a00a89e60df98ec33cd0c3bb4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Jan 2013 10:28:39 +0000 Subject: wrong end brace location --- unix/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 3748571..1c5c42a 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -667,7 +667,7 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) ${WISH else \ echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ echo " || ([info exists ::argv] && [lsearch -exact \$$::argv -display] > -1))} {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file normalize [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file normalize [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)]] Tk]";\ echo "} else {";\ echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file normalize [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll]] Tk]";\ echo "}";\ -- cgit v0.12 From e64bb74c70d8f231c8e599823f28ee88aa60dcb3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Jan 2013 10:32:45 +0000 Subject: add [file normalize] to UNIX pkgIndex.tcl too --- unix/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 1c5c42a..3f99fd8 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -663,7 +663,7 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) ${WISH relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ echo "if {[package vcompare [package provide Tcl] 8.4] != 0} return";\ if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ - echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file normalize [file join \$$dir $${relative}$(TK_LIB_FILE)]] Tk]";\ else \ echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ echo " || ([info exists ::argv] && [lsearch -exact \$$::argv -display] > -1))} {";\ -- cgit v0.12 From e2b504bf3a2dc5aabd16dd640f75e87553dcf25a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Jan 2013 16:48:13 +0000 Subject: Don't use deprecated "case" any more. Don't do unnecessary Tcl_PkgRequire(..., "Tcl", ...), the preceding Tcl_InitStubs() call already does that, both for dynamic loaded as wel as the static case. --- generic/tkWindow.c | 8 +------- tests/font.test | 9 ++++++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 2bccbb9..40b2fed 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -3017,8 +3017,7 @@ Initialize(interp) ThreadSpecificData *tsdPtr; /* - * Ensure that we are getting the matching version of Tcl. This is - * really only an issue when Tk is loaded dynamically. + * Ensure that we are getting the matching version of Tcl. */ if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { @@ -3242,11 +3241,6 @@ Initialize(interp) geometry = NULL; } - if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 1) == NULL) { - code = TCL_ERROR; - goto done; - } - /* * Provide Tk and its stub table. */ diff --git a/tests/font.test b/tests/font.test index 94953b1..2479334 100644 --- a/tests/font.test +++ b/tests/font.test @@ -49,10 +49,13 @@ proc csetup {{str ""}} { setup -case $tcl_platform(platform) { - unix {set fixed "fixed"} - windows {set fixed "courier 12"} +switch [tk windowingsystem] { + x11 {set fixed "fixed"} + win32 {set fixed "courier 12"} + aqua {set fixed "monaco 9"} } + + set times [font actual {times 0} -family] test font-1.1 {TkFontPkgInit} { -- cgit v0.12 From dae178c6fb5d174b35f7b985caf0d8669349aeb3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 16 Jan 2013 15:33:44 +0000 Subject: Don't compile Tk with -DTCL_NO_DEPRECATED by default any more, it might hurt when we compile Tk 8.x against Tcl 8.y with y > x, because new deprecated constructs might be added in higher Tcl versions (except for Tk 8.6, for now, because there is no higher 8.x yet) --- ChangeLog | 14 +++++++++++--- unix/Makefile.in | 8 ++++---- win/Makefile.in | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a963224..be00743 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,12 @@ -2012-12-03 Francois Vogel +2013-01-16 Jan Nijtmans + + * win/Makefile.in: Don't compile Tk with -DTCL_NO_DEPRECATED by default + * unix/Makefile.in: any more, it might hurt when we compile Tk 8.x + against Tcl 8.y with y > x, because new deprecated constructs might be + added in higher Tcl versions (except for Tk 8.6, for now, because there + is no higher 8.x yet) + +2012-12-03 François Vogel * generic/tkTextIndex.c: [Bug 3588824]: bug in image index handling * tests/textIndex.test: for weird image names @@ -44,7 +52,7 @@ * win/nmakehlp.c: Add "-V" option, in order to be able to detect partial version numbers. -2012-08-03 Francois Vogel +2012-08-03 François Vogel * tests/bind.test: [Bug 3554081]: Test bind-22.10 failed @@ -59,7 +67,7 @@ * win/nmakehlp.c: Backport from Tcl 8.6, but add -Q option from sampleextension. -2012-07-19 Francois Vogel +2012-07-19 François Vogel * unix/tkUnixMenuBu.c: [Bug 3545457]: Crash on packing a menubutton diff --git a/unix/Makefile.in b/unix/Makefile.in index 3f99fd8..53579f9 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -189,7 +189,7 @@ KEYSYM_FLAGS = # Tk does not used deprecated Tcl constructs so it should # compile fine with -DTCL_NO_DEPRECATED. To remove its own # set of deprecated code uncomment the second line. -NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED +NO_DEPRECATED_FLAGS = #NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED -DTK_NO_DEPRECATED # Some versions of make, like SGI's, use the following variable to @@ -329,7 +329,7 @@ CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} \ ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@ -CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) ${TCL_STUB_FLAGS} +CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) ${TCL_STUB_FLAGS} APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@ @@ -1500,7 +1500,7 @@ BUILD_HTML = \ # # Targets to build Solaris package of the distribution for the current # architecture. To build stream packages for both sun4 and i86pc -# architectures: +# architectures: # # On the sun4 machine, execute the following: # make distclean; ./configure @@ -1556,7 +1556,7 @@ package-common: # Build and install the architecture specific files in the dist directory. # -package-binaries: +package-binaries: cd $(DISTDIR)/unix/`arch`; \ $(MAKE); \ $(MAKE) install-binaries prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION) \ diff --git a/win/Makefile.in b/win/Makefile.in index 1c47ad2..1c62dfc 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -162,7 +162,7 @@ LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ # Tk does not used deprecated Tcl constructs so it should # compile fine with -DTCL_NO_DEPRECATED. To remove its own # set of deprecated code uncomment the second line. -NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED +NO_DEPRECATED_FLAGS = #NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED -DTK_NO_DEPRECATED # To change the compiler switches, for example to change from optimization to -- cgit v0.12 From 3983643839c9f6b6bfd02dc6f4d1ea1e8e8b3c78 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Jan 2013 21:12:27 +0000 Subject: Bug [3601782]: Produce a nice error-message when the first Tcl_InitStubs() fails, in stead of simply abort() --- generic/tkConsole.c | 3 +-- generic/tkMain.c | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/generic/tkConsole.c b/generic/tkConsole.c index e93c0fc..cbbd260 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -226,8 +226,7 @@ Tk_InitConsoleChannels(interp) Tcl_Channel consoleChannel; /* - * Ensure that we are getting the matching version of Tcl. This is - * really only an issue when Tk is loaded dynamically. + * Ensure that we are getting the matching version of Tcl. */ if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { diff --git a/generic/tkMain.c b/generic/tkMain.c index 5e5ddb7..e88a26f 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -144,12 +144,15 @@ Tk_MainEx(argc, argv, appInitProc, interp) ThreadSpecificData *tsdPtr; /* - * Ensure that we are getting the matching version of Tcl. This is - * really only an issue when Tk is loaded dynamically. + * Ensure that we are getting the matching version of Tcl. */ if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { - abort(); + if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { + abort(); + } else { + Tcl_Panic("%s", Tcl_GetStringResult(interp)); + } } #if defined(__WIN32__) && !defined(__WIN64__) && !defined(STATIC_BUILD) -- cgit v0.12 From 885d9aaa70bdf9cae9a6d3b61451205c85e69101 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 12 Feb 2013 23:17:52 +0000 Subject: Backport various improvements from Tcl 8.5 --- unix/configure | 14 ++-- unix/tcl.m4 | 16 ++-- win/configure | 229 +++++++++++++++++++++++++++++++++----------------- win/tcl.m4 | 258 ++++++++++++++++++++++++++++++++++++++++++++------------- 4 files changed, 366 insertions(+), 151 deletions(-) diff --git a/unix/configure b/unix/configure index d7c3805..4adfb24 100755 --- a/unix/configure +++ b/unix/configure @@ -14,18 +14,18 @@ ac_default_prefix=/usr/local ac_help="$ac_help --with-tcl directory containing tcl configuration (tclConfig.sh)" ac_help="$ac_help - --enable-man-symlinks use symlinks for the manpages" + --enable-man-symlinks use symlinks for the manpages (default: off)" ac_help="$ac_help --enable-man-compression=PROG - compress the manpages with PROG" + compress the manpages with PROG (default: off)" ac_help="$ac_help --enable-man-suffix=STRING use STRING as a suffix to manpage file names (default: tk)" ac_help="$ac_help - --enable-threads build with threads" + --enable-threads build with threads (default: off)" ac_help="$ac_help - --enable-shared build and link with shared libraries [--enable-shared]" + --enable-shared build and link with shared libraries (default: on)" ac_help="$ac_help --enable-64bit enable 64bit support (where applicable)" ac_help="$ac_help @@ -37,13 +37,13 @@ ac_help="$ac_help ac_help="$ac_help --disable-load disallow dynamic loading and "load" command" ac_help="$ac_help - --enable-symbols build with debugging symbols [--disable-symbols]" + --enable-symbols build with debugging symbols (default: off)" ac_help="$ac_help --enable-aqua enable Aqua windowingsystem on Mac OS X [--disable-aqua]" ac_help="$ac_help --with-x use the X Window System" ac_help="$ac_help - --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]" + --enable-framework package shared libraries in MacOSX frameworks (default: off)" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -1777,7 +1777,7 @@ EOF echo "$ac_t""yes" 1>&6 fi else - echo "$ac_t""no" 1>&6 + echo "$ac_t""no (default)" 1>&6 fi diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 2dc6576..889d817 100755 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -517,7 +517,7 @@ AC_DEFUN([SC_BUILD_TCLSH], [ AC_DEFUN([SC_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, - [ --enable-shared build and link with shared libraries [--enable-shared]], + [ --enable-shared build and link with shared libraries (default: on)], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then @@ -558,7 +558,7 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [ if test "`uname -s`" = "Darwin" ; then AC_MSG_CHECKING([how to package libraries]) AC_ARG_ENABLE(framework, - [ --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]], + [ --enable-framework package shared libraries in MacOSX frameworks (default: off)], [enable_framework=$enableval], [enable_framework=no]) if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then @@ -610,7 +610,7 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [ #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_THREADS], [ - AC_ARG_ENABLE(threads, [ --enable-threads build with threads], + AC_ARG_ENABLE(threads, [ --enable-threads build with threads (default: off)], [tcl_ok=$enableval], [tcl_ok=no]) if test "${TCL_THREADS}" = 1; then @@ -687,7 +687,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [ AC_MSG_RESULT([yes]) fi else - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no (default)]) fi AC_SUBST(TCL_THREADS) @@ -725,7 +725,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) + AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols (default: off)], [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' @@ -784,7 +784,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_DEFUN([SC_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, [ --enable-langinfo use nl_langinfo if possible to determine - encoding at startup, otherwise use old heuristic], + encoding at startup, otherwise use old heuristic (default: on)], [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 @@ -835,7 +835,7 @@ AC_DEFUN([SC_ENABLE_LANGINFO], [ AC_DEFUN([SC_CONFIG_MANPAGES], [ AC_MSG_CHECKING([whether to use symlinks for manpages]) AC_ARG_ENABLE(man-symlinks, - [ --enable-man-symlinks use symlinks for the manpages], + [ --enable-man-symlinks use symlinks for the manpages (default: off)], test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks", enableval="no") AC_MSG_RESULT([$enableval]) @@ -843,7 +843,7 @@ AC_DEFUN([SC_CONFIG_MANPAGES], [ AC_MSG_CHECKING([whether to compress the manpages]) AC_ARG_ENABLE(man-compression, [ --enable-man-compression=PROG - compress the manpages with PROG], + compress the manpages with PROG (default: off)], [case $enableval in yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);; no) ;; diff --git a/win/configure b/win/configure index 824a754..4964a3d 100755 --- a/win/configure +++ b/win/configure @@ -12,11 +12,11 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --enable-threads build with threads" + --enable-threads build with threads (default: off)" ac_help="$ac_help - --enable-shared build and link with shared libraries [--enable-shared]" + --enable-shared build and link with shared libraries (default: on)" ac_help="$ac_help - --with-tcl=DIR use Tcl 8.4 binaries from DIR" + --with-tcl directory containing tcl configuration (tclConfig.sh)" ac_help="$ac_help --enable-64bit enable 64bit support (where applicable)" ac_help="$ac_help @@ -24,7 +24,7 @@ ac_help="$ac_help ac_help="$ac_help --with-celib=DIR use Windows/CE support library from DIR" ac_help="$ac_help - --enable-symbols build with debugging symbols [--disable-symbols]" + --enable-symbols build with debugging symbols (default: off)" ac_help="$ac_help --enable-embedded-manifest embed manifest if possible (default: yes)" @@ -1135,45 +1135,117 @@ EOF #-------------------------------------------------------------------- - echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1140: checking the location of tclConfig.sh" >&5 - - if test -d ../../tcl8.4$TK_PATCH_LEVEL/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.4$TK_PATCH_LEVEL/win - elif test -d ../../tcl8.4/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.4/win - else - TCL_BIN_DIR_DEFAULT=../../tcl/win - fi + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # - # Check whether --with-tcl or --without-tcl was given. + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" - TCL_BIN_DIR=$withval + with_tclconfig=${withval} +fi + + echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 +echo "configure:1155: checking for Tcl configuration" >&5 + if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd` + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case "${with_tclconfig}" in + */tclConfig.sh ) + if test -f "${with_tclconfig}"; then + echo "configure: warning: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" 1>&2 + with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" + else + { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd $i/win; pwd)`" + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd $i; pwd)`" + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd $i/win; pwd)`" + break + fi + done + fi + fi - if test ! -d $TCL_BIN_DIR; then - { echo "configure: error: Tcl directory $TCL_BIN_DIR does not exist" 1>&2; exit 1; } - fi - if test ! -f $TCL_BIN_DIR/tclConfig.sh; then - if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then - { echo "configure: error: There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" 1>&2; exit 1; } + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { echo "configure: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" 1>&2; exit 1; } + else + no_tcl= + TCL_BIN_DIR="${ac_cv_c_tclconfig}" + echo "$ac_t""found ${TCL_BIN_DIR}/tclConfig.sh" 1>&6 fi - TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd` fi - echo "$ac_t""$TCL_BIN_DIR/tclConfig.sh" 1>&6 - echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1171: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 + echo $ac_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh""... $ac_c" 1>&6 +echo "configure:1243: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then echo "$ac_t""loading" 1>&6 - . $TCL_BIN_DIR/tclConfig.sh + . "${TCL_BIN_DIR}/tclConfig.sh" else - echo "$ac_t""file not found" 1>&6 + echo "$ac_t""could not find ${TCL_BIN_DIR}/tclConfig.sh" 1>&6 fi # @@ -1229,7 +1301,7 @@ echo "configure:1171: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 # Step 0: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:1233: checking if 64bit support is requested" >&5 +echo "configure:1305: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -1243,7 +1315,7 @@ fi # Cross-compiling options for Windows/CE builds echo $ac_n "checking if Windows/CE build is requested""... $ac_c" 1>&6 -echo "configure:1247: checking if Windows/CE build is requested" >&5 +echo "configure:1319: checking if Windows/CE build is requested" >&5 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" @@ -1255,7 +1327,7 @@ fi echo "$ac_t""$doWince" 1>&6 echo $ac_n "checking for Windows/CE celib directory""... $ac_c" 1>&6 -echo "configure:1259: checking for Windows/CE celib directory" >&5 +echo "configure:1331: checking for Windows/CE celib directory" >&5 # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" @@ -1272,7 +1344,7 @@ fi # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1276: checking for $ac_word" >&5 +echo "configure:1348: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1309,12 +1381,12 @@ fi if test "$GCC" = "yes"; then echo $ac_n "checking for cross-compile version of gcc""... $ac_c" 1>&6 -echo "configure:1313: checking for cross-compile version of gcc" >&5 +echo "configure:1385: checking for cross-compile version of gcc" >&5 if eval "test \"`echo '$''{'ac_cv_cross'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cross=no else @@ -1374,9 +1446,9 @@ echo "$ac_t""$ac_cv_cross" 1>&6 echo "END" >> $conftest echo $ac_n "checking for Windows native path bug in windres""... $ac_c" 1>&6 -echo "configure:1378: checking for Windows native path bug in windres" >&5 +echo "configure:1450: checking for Windows native path bug in windres" >&5 cyg_conftest=`$CYGPATH $conftest` - if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then + if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 @@ -1396,12 +1468,12 @@ echo "configure:1378: checking for Windows native path bug in windres" >&5 if test "${GCC}" = "yes" ; then echo $ac_n "checking for mingw32 version of gcc""... $ac_c" 1>&6 -echo "configure:1400: checking for mingw32 version of gcc" >&5 +echo "configure:1472: checking for mingw32 version of gcc" >&5 if eval "test \"`echo '$''{'ac_cv_win32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_win32=no else @@ -1432,7 +1504,7 @@ echo "$ac_t""$ac_cv_win32" 1>&6 fi echo $ac_n "checking compiler flags""... $ac_c" 1>&6 -echo "configure:1436: checking compiler flags" >&5 +echo "configure:1508: checking compiler flags" >&5 if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS="" @@ -1531,7 +1603,7 @@ echo "configure:1436: checking compiler flags" >&5 ;; *) cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_win_64bit=yes else @@ -1782,7 +1854,7 @@ EOF if test "${GCC}" = "yes" ; then echo $ac_n "checking for SEH support in compiler""... $ac_c" 1>&6 -echo "configure:1786: checking for SEH support in compiler" >&5 +echo "configure:1858: checking for SEH support in compiler" >&5 if eval "test \"`echo '$''{'tcl_cv_seh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1790,7 +1862,7 @@ else tcl_cv_seh=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_seh=yes else @@ -1839,12 +1911,12 @@ EOF # sufficient for getting the current code to work. # echo $ac_n "checking for EXCEPTION_DISPOSITION support in include files""... $ac_c" 1>&6 -echo "configure:1843: checking for EXCEPTION_DISPOSITION support in include files" >&5 +echo "configure:1915: checking for EXCEPTION_DISPOSITION support in include files" >&5 if eval "test \"`echo '$''{'tcl_cv_eh_disposition'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_eh_disposition=yes else @@ -1883,12 +1955,12 @@ EOF # used by mingw and cygwin is known to do this. echo $ac_n "checking for winnt.h that ignores VOID define""... $ac_c" 1>&6 -echo "configure:1887: checking for winnt.h that ignores VOID define" >&5 +echo "configure:1959: checking for winnt.h that ignores VOID define" >&5 if eval "test \"`echo '$''{'tcl_cv_winnt_ignore_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_winnt_ignore_void=yes else @@ -1930,12 +2002,12 @@ EOF # warning when initializing a union member. echo $ac_n "checking for cast to union support""... $ac_c" 1>&6 -echo "configure:1934: checking for cast to union support" >&5 +echo "configure:2006: checking for cast to union support" >&5 if eval "test \"`echo '$''{'tcl_cv_cast_to_union'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_cast_to_union=yes else @@ -1979,7 +2051,7 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1983: checking how to run the C preprocessor" >&5 +echo "configure:2055: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1994,13 +2066,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2011,13 +2083,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2028,13 +2100,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2060,17 +2132,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:2064: checking for errno.h" >&5 +echo "configure:2136: checking for errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2100,20 +2172,20 @@ fi if test "${MACHINE}" = "X86" ; then echo $ac_n "checking availability of _strtoi64""... $ac_c" 1>&6 -echo "configure:2104: checking availability of _strtoi64" >&5 +echo "configure:2176: checking availability of _strtoi64" >&5 if eval "test \"`echo '$''{'tcl_have_strtoi64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { _strtoi64(0,0,0) ; return 0; } EOF -if { (eval echo configure:2117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_have_strtoi64=yes else @@ -2142,7 +2214,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:2146: checking for build with symbols" >&5 +echo "configure:2218: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -2207,7 +2279,7 @@ TK_DBGX=${DBGX} echo $ac_n "checking whether to embed manifest""... $ac_c" 1>&6 -echo "configure:2211: checking whether to embed manifest" >&5 +echo "configure:2283: checking whether to embed manifest" >&5 # Check whether --enable-embedded-manifest or --disable-embedded-manifest was given. if test "${enable_embedded_manifest+set}" = set; then enableval="$enable_embedded_manifest" @@ -2224,7 +2296,7 @@ fi -a "$GCC" != "yes" ; then # Add the magic to embed the manifest into the dll/exe cat > conftest.$ac_ext <= 1400 @@ -2239,8 +2311,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | # Could do a CHECK_PROG for mt, but should always be with MSVC8+ # Could add 'if test -f' check, but manifest should be created # in this compiler case - VC_MANIFEST_EMBED_DLL="mt.exe -nologo -manifest \$@.manifest wish.exe.manifest -outputresource:\$@\;2" - VC_MANIFEST_EMBED_EXE="mt.exe -nologo -manifest \$@.manifest wish.exe.manifest -outputresource:\$@\;1" + # Add in a manifest argument that may be specified + # XXX Needs improvement so that the test for existence accounts + # XXX for a provided (known) manifest + VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest wish.exe.manifest -outputresource:\$@\;2 ; fi" + VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest wish.exe.manifest -outputresource:\$@\;1 ; fi" result=yes if test "xwish.exe.manifest" != x ; then result="yes (wish.exe.manifest)" @@ -2257,14 +2332,14 @@ rm -f conftest* echo $ac_n "checking for tclsh in Tcl build directory""... $ac_c" 1>&6 -echo "configure:2261: checking for tclsh in Tcl build directory" >&5 +echo "configure:2336: checking for tclsh in Tcl build directory" >&5 BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT} echo "$ac_t""$BUILD_TCLSH" 1>&6 echo $ac_n "checking for tclsh""... $ac_c" 1>&6 -echo "configure:2268: checking for tclsh" >&5 +echo "configure:2343: checking for tclsh" >&5 if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 diff --git a/win/tcl.m4 b/win/tcl.m4 index 708efc4..d33bb48 100755 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -3,50 +3,117 @@ # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags -# Currently a no-op for Windows # # Arguments: -# PATCH_LEVEL The patch level for Tcl if any. +# none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # -# Sets the following vars: -# TCL_BIN_DIR Full path to the tclConfig.sh file +# Defines the following vars: +# TCL_BIN_DIR Full path to the directory containing +# the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TCLCONFIG], [ - AC_MSG_CHECKING([the location of tclConfig.sh]) + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # - if test -d ../../tcl8.4$1/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.4$1/win - elif test -d ../../tcl8.4/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.4/win - else - TCL_BIN_DIR_DEFAULT=../../tcl/win - fi + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tcl, [ --with-tcl directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case "${with_tclconfig}" in + */tclConfig.sh ) + if test -f "${with_tclconfig}"; then + AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) + with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR], - TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`) - if test ! -d $TCL_BIN_DIR; then - AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) - fi - if test ! -f $TCL_BIN_DIR/tclConfig.sh; then - if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then - AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd $i/win; pwd)`" + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd $i; pwd)`" + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig="`(cd $i/win; pwd)`" + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh]) + else + no_tcl= + TCL_BIN_DIR="${ac_cv_c_tclconfig}" + AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi - TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd` fi - AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh) ]) #------------------------------------------------------------------------ # SC_PATH_TKCONFIG -- # # Locate the tkConfig.sh file -# Currently a no-op for Windows # # Arguments: # none @@ -56,31 +123,102 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ # Adds the following arguments to configure: # --with-tk=... # -# Sets the following vars: -# TK_BIN_DIR Full path to the tkConfig.sh file +# Defines the following vars: +# TK_BIN_DIR Full path to the directory containing +# the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TKCONFIG], [ - AC_MSG_CHECKING([the location of tkConfig.sh]) + # + # Ok, lets find the tk configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tk + # - if test -d ../../tk8.4$1/win; then - TK_BIN_DIR_DEFAULT=../../tk8.4$1/win - elif test -d ../../tk8.4/win; then - TK_BIN_DIR_DEFAULT=../../tk8.4/win - else - TK_BIN_DIR_DEFAULT=../../tk/win - fi + if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tk, [ --with-tk directory containing tk configuration (tkConfig.sh)], with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + case "${with_tkconfig}" in + */tkConfig.sh ) + if test -f "${with_tkconfig}"; then + AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) + with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`" + fi ;; + esac + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi - AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.4 binaries from DIR], - TK_BIN_DIR=$withval, TK_BIN_DIR=`cd $TK_BIN_DIR_DEFAULT; pwd`) - if test ! -d $TK_BIN_DIR; then - AC_MSG_ERROR(Tk directory $TK_BIN_DIR does not exist) - fi - if test ! -f $TK_BIN_DIR/tkConfig.sh; then - AC_MSG_ERROR(There is no tkConfig.sh in $TK_BIN_DIR: perhaps you did not specify the Tk *build* directory (not the toplevel Tk directory) or you forgot to configure Tk?) - fi + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/win/tkConfig.sh" ; then + ac_cv_c_tkconfig="`(cd $i/win; pwd)`" + break + fi + done + fi - AC_MSG_RESULT([$TK_BIN_DIR/tkConfig.sh]) + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig="`(cd $i; pwd)`" + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/win/tkConfig.sh" ; then + ac_cv_c_tkconfig="`(cd $i/win; pwd)`" + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tkconfig}" = x ; then + TK_BIN_DIR="# no Tk configs found" + AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh]) + else + no_tk= + TK_BIN_DIR="${ac_cv_c_tkconfig}" + AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) + fi + fi ]) #------------------------------------------------------------------------ @@ -103,13 +241,13 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TCLCONFIG], [ - AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) + AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) - . $TCL_BIN_DIR/tclConfig.sh + . "${TCL_BIN_DIR}/tclConfig.sh" else - AC_MSG_RESULT([file not found]) + AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # @@ -158,7 +296,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ # SC_LOAD_TKCONFIG -- # # Load the tkConfig.sh file -# Currently a no-op for Windows # # Arguments: # @@ -172,13 +309,13 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TKCONFIG], [ - AC_MSG_CHECKING([for existence of $TK_BIN_DIR/tkConfig.sh]) + AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) - if test -f "$TK_BIN_DIR/tkConfig.sh" ; then + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) - . $TK_BIN_DIR/tkConfig.sh + . "${TK_BIN_DIR}/tkConfig.sh" else - AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh]) + AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi @@ -211,8 +348,8 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ AC_DEFUN([SC_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, - [ --enable-shared build and link with shared libraries [--enable-shared]], - [tcl_ok=$enableval], [tcl_ok=yes]) + [ --enable-shared build and link with shared libraries (default: on)], + [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -227,7 +364,7 @@ AC_DEFUN([SC_ENABLE_SHARED], [ else AC_MSG_RESULT([static]) SHARED_BUILD=0 - AC_DEFINE(STATIC_BUILD) + AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) fi ]) @@ -250,7 +387,7 @@ AC_DEFUN([SC_ENABLE_SHARED], [ AC_DEFUN([SC_ENABLE_THREADS], [ AC_MSG_CHECKING(for building with threads) - AC_ARG_ENABLE(threads, [ --enable-threads build with threads], + AC_ARG_ENABLE(threads, [ --enable-threads build with threads (default: off)], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes"; then @@ -270,7 +407,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [ #------------------------------------------------------------------------ # SC_ENABLE_SYMBOLS -- # -# Specify if debugging symbols should be used +# Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging # can also be enabled. # @@ -297,7 +434,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) + AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols (default: off)], [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' @@ -1065,8 +1202,11 @@ print("manifest needed") # Could do a CHECK_PROG for mt, but should always be with MSVC8+ # Could add 'if test -f' check, but manifest should be created # in this compiler case - VC_MANIFEST_EMBED_DLL="mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;2" - VC_MANIFEST_EMBED_EXE="mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;1" + # Add in a manifest argument that may be specified + # XXX Needs improvement so that the test for existence accounts + # XXX for a provided (known) manifest + VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;2 ; fi" + VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;1 ; fi" result=yes if test "x$1" != x ; then result="yes ($1)" -- cgit v0.12 From ce9b49e334d7eb958daf84f7322467f4a67919e6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 14 Feb 2013 06:25:09 +0000 Subject: Add some extra paths on Windows for finding tclConfig.sh, for mSys and Cygwin shell. --- win/configure | 96 +++++++++++++++++++++++++++++++---------------------------- win/tcl.m4 | 8 +++++ 2 files changed, 58 insertions(+), 46 deletions(-) diff --git a/win/configure b/win/configure index 4964a3d..5911554 100755 --- a/win/configure +++ b/win/configure @@ -1200,6 +1200,10 @@ else for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /cygdrive/c/Tcl/lib 2>/dev/null` \ + `ls -d /cygdrive/c/Progra~1/Tcl/lib 2>/dev/null` \ + `ls -d /c/Tcl/lib 2>/dev/null` \ + `ls -d /c/Progra~1/Tcl/lib 2>/dev/null` \ `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do @@ -1239,7 +1243,7 @@ fi echo $ac_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1243: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "configure:1247: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then echo "$ac_t""loading" 1>&6 @@ -1301,7 +1305,7 @@ echo "configure:1243: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 # Step 0: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:1305: checking if 64bit support is requested" >&5 +echo "configure:1309: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -1315,7 +1319,7 @@ fi # Cross-compiling options for Windows/CE builds echo $ac_n "checking if Windows/CE build is requested""... $ac_c" 1>&6 -echo "configure:1319: checking if Windows/CE build is requested" >&5 +echo "configure:1323: checking if Windows/CE build is requested" >&5 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" @@ -1327,7 +1331,7 @@ fi echo "$ac_t""$doWince" 1>&6 echo $ac_n "checking for Windows/CE celib directory""... $ac_c" 1>&6 -echo "configure:1331: checking for Windows/CE celib directory" >&5 +echo "configure:1335: checking for Windows/CE celib directory" >&5 # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" @@ -1344,7 +1348,7 @@ fi # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1348: checking for $ac_word" >&5 +echo "configure:1352: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1381,12 +1385,12 @@ fi if test "$GCC" = "yes"; then echo $ac_n "checking for cross-compile version of gcc""... $ac_c" 1>&6 -echo "configure:1385: checking for cross-compile version of gcc" >&5 +echo "configure:1389: checking for cross-compile version of gcc" >&5 if eval "test \"`echo '$''{'ac_cv_cross'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cross=no else @@ -1446,9 +1450,9 @@ echo "$ac_t""$ac_cv_cross" 1>&6 echo "END" >> $conftest echo $ac_n "checking for Windows native path bug in windres""... $ac_c" 1>&6 -echo "configure:1450: checking for Windows native path bug in windres" >&5 +echo "configure:1454: checking for Windows native path bug in windres" >&5 cyg_conftest=`$CYGPATH $conftest` - if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then + if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 @@ -1468,12 +1472,12 @@ echo "configure:1450: checking for Windows native path bug in windres" >&5 if test "${GCC}" = "yes" ; then echo $ac_n "checking for mingw32 version of gcc""... $ac_c" 1>&6 -echo "configure:1472: checking for mingw32 version of gcc" >&5 +echo "configure:1476: checking for mingw32 version of gcc" >&5 if eval "test \"`echo '$''{'ac_cv_win32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_win32=no else @@ -1504,7 +1508,7 @@ echo "$ac_t""$ac_cv_win32" 1>&6 fi echo $ac_n "checking compiler flags""... $ac_c" 1>&6 -echo "configure:1508: checking compiler flags" >&5 +echo "configure:1512: checking compiler flags" >&5 if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS="" @@ -1603,7 +1607,7 @@ echo "configure:1508: checking compiler flags" >&5 ;; *) cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_win_64bit=yes else @@ -1854,7 +1858,7 @@ EOF if test "${GCC}" = "yes" ; then echo $ac_n "checking for SEH support in compiler""... $ac_c" 1>&6 -echo "configure:1858: checking for SEH support in compiler" >&5 +echo "configure:1862: checking for SEH support in compiler" >&5 if eval "test \"`echo '$''{'tcl_cv_seh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1862,7 +1866,7 @@ else tcl_cv_seh=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_seh=yes else @@ -1911,12 +1915,12 @@ EOF # sufficient for getting the current code to work. # echo $ac_n "checking for EXCEPTION_DISPOSITION support in include files""... $ac_c" 1>&6 -echo "configure:1915: checking for EXCEPTION_DISPOSITION support in include files" >&5 +echo "configure:1919: checking for EXCEPTION_DISPOSITION support in include files" >&5 if eval "test \"`echo '$''{'tcl_cv_eh_disposition'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_eh_disposition=yes else @@ -1955,12 +1959,12 @@ EOF # used by mingw and cygwin is known to do this. echo $ac_n "checking for winnt.h that ignores VOID define""... $ac_c" 1>&6 -echo "configure:1959: checking for winnt.h that ignores VOID define" >&5 +echo "configure:1963: checking for winnt.h that ignores VOID define" >&5 if eval "test \"`echo '$''{'tcl_cv_winnt_ignore_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_winnt_ignore_void=yes else @@ -2002,12 +2006,12 @@ EOF # warning when initializing a union member. echo $ac_n "checking for cast to union support""... $ac_c" 1>&6 -echo "configure:2006: checking for cast to union support" >&5 +echo "configure:2010: checking for cast to union support" >&5 if eval "test \"`echo '$''{'tcl_cv_cast_to_union'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_cast_to_union=yes else @@ -2051,7 +2055,7 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2055: checking how to run the C preprocessor" >&5 +echo "configure:2059: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2066,13 +2070,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2083,13 +2087,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2100,13 +2104,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2132,17 +2136,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:2136: checking for errno.h" >&5 +echo "configure:2140: checking for errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2172,20 +2176,20 @@ fi if test "${MACHINE}" = "X86" ; then echo $ac_n "checking availability of _strtoi64""... $ac_c" 1>&6 -echo "configure:2176: checking availability of _strtoi64" >&5 +echo "configure:2180: checking availability of _strtoi64" >&5 if eval "test \"`echo '$''{'tcl_have_strtoi64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { _strtoi64(0,0,0) ; return 0; } EOF -if { (eval echo configure:2189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_have_strtoi64=yes else @@ -2214,7 +2218,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:2218: checking for build with symbols" >&5 +echo "configure:2222: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -2279,7 +2283,7 @@ TK_DBGX=${DBGX} echo $ac_n "checking whether to embed manifest""... $ac_c" 1>&6 -echo "configure:2283: checking whether to embed manifest" >&5 +echo "configure:2287: checking whether to embed manifest" >&5 # Check whether --enable-embedded-manifest or --disable-embedded-manifest was given. if test "${enable_embedded_manifest+set}" = set; then enableval="$enable_embedded_manifest" @@ -2296,7 +2300,7 @@ fi -a "$GCC" != "yes" ; then # Add the magic to embed the manifest into the dll/exe cat > conftest.$ac_ext <= 1400 @@ -2332,14 +2336,14 @@ rm -f conftest* echo $ac_n "checking for tclsh in Tcl build directory""... $ac_c" 1>&6 -echo "configure:2336: checking for tclsh in Tcl build directory" >&5 +echo "configure:2340: checking for tclsh in Tcl build directory" >&5 BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT} echo "$ac_t""$BUILD_TCLSH" 1>&6 echo $ac_n "checking for tclsh""... $ac_c" 1>&6 -echo "configure:2343: checking for tclsh" >&5 +echo "configure:2347: checking for tclsh" >&5 if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 diff --git a/win/tcl.m4 b/win/tcl.m4 index d33bb48..7c55fc9 100755 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -74,6 +74,10 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /cygdrive/c/Tcl/lib 2>/dev/null` \ + `ls -d /cygdrive/c/Progra~1/Tcl/lib 2>/dev/null` \ + `ls -d /c/Tcl/lib 2>/dev/null` \ + `ls -d /c/Progra~1/Tcl/lib 2>/dev/null` \ `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do @@ -185,6 +189,10 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /cygdrive/c/Tcl/lib 2>/dev/null` \ + `ls -d /cygdrive/c/Progra~1/Tcl/lib 2>/dev/null` \ + `ls -d /c/Tcl/lib 2>/dev/null` \ + `ls -d /c/Progra~1/Tcl/lib 2>/dev/null` \ `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do -- cgit v0.12 From d0ab2bd83ddf58e52fc7f6043e701f62d539797e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 15 Feb 2013 15:42:16 +0000 Subject: Extend the public and private stub tables with dummy NULL entries, up to the size of the Tk 8.6 stub tables. This makes it easier to debug Tk extensions which use Tk 8.5/8.6 features but (erroneously) are attempted to be loaded in wish8.4 --- generic/tk.decls | 4 +- generic/tkDecls.h | 39 ++++++++++++++++++ generic/tkInt.decls | 13 ++++++ generic/tkIntDecls.h | 101 +++++++++++++++++++++++++++++++++++++++++++++++ generic/tkIntPlatDecls.h | 22 +++++++++++ generic/tkStubInit.c | 48 ++++++++++++++++++++++ 6 files changed, 226 insertions(+), 1 deletion(-) diff --git a/generic/tk.decls b/generic/tk.decls index b64cc43..032320d 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1017,7 +1017,9 @@ declare 264 { char *recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state) } - +declare 275 { + void TkUnusedStubEntry(void) +} # Define the platform specific public Tk interface. These functions are # only available on the designated platform. diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 81871a2..3c92ffb 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -905,6 +905,18 @@ EXTERN void Tk_DrawElement _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); +/* Slot 265 is reserved */ +/* Slot 266 is reserved */ +/* Slot 267 is reserved */ +/* Slot 268 is reserved */ +/* Slot 269 is reserved */ +/* Slot 270 is reserved */ +/* Slot 271 is reserved */ +/* Slot 272 is reserved */ +/* Slot 273 is reserved */ +/* Slot 274 is reserved */ +/* 275 */ +EXTERN void TkUnusedStubEntry _ANSI_ARGS_((void)); typedef struct TkStubHooks { struct TkPlatStubs *tkPlatStubs; @@ -1182,6 +1194,17 @@ typedef struct TkStubs { void (*tk_GetElementBox) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)); /* 262 */ int (*tk_GetElementBorderWidth) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin)); /* 263 */ void (*tk_DrawElement) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); /* 264 */ + VOID *reserved265; + VOID *reserved266; + VOID *reserved267; + VOID *reserved268; + VOID *reserved269; + VOID *reserved270; + VOID *reserved271; + VOID *reserved272; + VOID *reserved273; + VOID *reserved274; + void (*tkUnusedStubEntry) _ANSI_ARGS_((void)); /* 275 */ } TkStubs; #ifdef __cplusplus @@ -2252,6 +2275,20 @@ extern TkStubs *tkStubsPtr; #define Tk_DrawElement \ (tkStubsPtr->tk_DrawElement) /* 264 */ #endif +/* Slot 265 is reserved */ +/* Slot 266 is reserved */ +/* Slot 267 is reserved */ +/* Slot 268 is reserved */ +/* Slot 269 is reserved */ +/* Slot 270 is reserved */ +/* Slot 271 is reserved */ +/* Slot 272 is reserved */ +/* Slot 273 is reserved */ +/* Slot 274 is reserved */ +#ifndef TkUnusedStubEntry +#define TkUnusedStubEntry \ + (tkStubsPtr->tkUnusedStubEntry) /* 275 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ @@ -2260,5 +2297,7 @@ extern TkStubs *tkStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkUnusedStubEntry + #endif /* _TKDECLS */ diff --git a/generic/tkInt.decls b/generic/tkInt.decls index a37f986..107223b 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -489,6 +489,9 @@ declare 152 { void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief) } +declare 184 { + void TkUnusedStubEntry(void) +} ############################################################################## @@ -539,6 +542,9 @@ declare 11 x11 { declare 12 x11 { int TkpWmSetState(TkWindow *winPtr, int state) } +declare 13 x11 { + void TkUnusedStubEntry(void) +} ################################ # Windows specific functions @@ -691,6 +697,10 @@ declare 43 win { declare 44 win { void TkSendCleanup(TkDisplay *dispPtr) } +declare 45 win { + void TkUnusedStubEntry(void) +} + ################################ # Aqua specific functions @@ -873,6 +883,9 @@ declare 51 aqua { declare 53 aqua { unsigned long TkpGetMS(void) } +declare 54 aqua { + void TkUnusedStubEntry(void) +} ############################################################################## diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index a590cf2..66ae129 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -454,6 +454,39 @@ EXTERN CONST Tk_OptionSpec * TkGetOptionSpec _ANSI_ARGS_((CONST char *name, EXTERN void TkpDrawFrame _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief)); +/* Slot 153 is reserved */ +/* Slot 154 is reserved */ +/* Slot 155 is reserved */ +/* Slot 156 is reserved */ +/* Slot 157 is reserved */ +/* Slot 158 is reserved */ +/* Slot 159 is reserved */ +/* Slot 160 is reserved */ +/* Slot 161 is reserved */ +/* Slot 162 is reserved */ +/* Slot 163 is reserved */ +/* Slot 164 is reserved */ +/* Slot 165 is reserved */ +/* Slot 166 is reserved */ +/* Slot 167 is reserved */ +/* Slot 168 is reserved */ +/* Slot 169 is reserved */ +/* Slot 170 is reserved */ +/* Slot 171 is reserved */ +/* Slot 172 is reserved */ +/* Slot 173 is reserved */ +/* Slot 174 is reserved */ +/* Slot 175 is reserved */ +/* Slot 176 is reserved */ +/* Slot 177 is reserved */ +/* Slot 178 is reserved */ +/* Slot 179 is reserved */ +/* Slot 180 is reserved */ +/* Slot 181 is reserved */ +/* Slot 182 is reserved */ +/* Slot 183 is reserved */ +/* 184 */ +EXTERN void TkUnusedStubEntry _ANSI_ARGS_((void)); typedef struct TkIntStubs { int magic; @@ -639,6 +672,38 @@ typedef struct TkIntStubs { VOID *reserved150; VOID *reserved151; void (*tkpDrawFrame) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief)); /* 152 */ + VOID *reserved153; + VOID *reserved154; + VOID *reserved155; + VOID *reserved156; + VOID *reserved157; + VOID *reserved158; + VOID *reserved159; + VOID *reserved160; + VOID *reserved161; + VOID *reserved162; + VOID *reserved163; + VOID *reserved164; + VOID *reserved165; + VOID *reserved166; + VOID *reserved167; + VOID *reserved168; + VOID *reserved169; + VOID *reserved170; + VOID *reserved171; + VOID *reserved172; + VOID *reserved173; + VOID *reserved174; + VOID *reserved175; + VOID *reserved176; + VOID *reserved177; + VOID *reserved178; + VOID *reserved179; + VOID *reserved180; + VOID *reserved181; + VOID *reserved182; + VOID *reserved183; + void (*tkUnusedStubEntry) _ANSI_ARGS_((void)); /* 184 */ } TkIntStubs; #ifdef __cplusplus @@ -1228,6 +1293,41 @@ extern TkIntStubs *tkIntStubsPtr; #define TkpDrawFrame \ (tkIntStubsPtr->tkpDrawFrame) /* 152 */ #endif +/* Slot 153 is reserved */ +/* Slot 154 is reserved */ +/* Slot 155 is reserved */ +/* Slot 156 is reserved */ +/* Slot 157 is reserved */ +/* Slot 158 is reserved */ +/* Slot 159 is reserved */ +/* Slot 160 is reserved */ +/* Slot 161 is reserved */ +/* Slot 162 is reserved */ +/* Slot 163 is reserved */ +/* Slot 164 is reserved */ +/* Slot 165 is reserved */ +/* Slot 166 is reserved */ +/* Slot 167 is reserved */ +/* Slot 168 is reserved */ +/* Slot 169 is reserved */ +/* Slot 170 is reserved */ +/* Slot 171 is reserved */ +/* Slot 172 is reserved */ +/* Slot 173 is reserved */ +/* Slot 174 is reserved */ +/* Slot 175 is reserved */ +/* Slot 176 is reserved */ +/* Slot 177 is reserved */ +/* Slot 178 is reserved */ +/* Slot 179 is reserved */ +/* Slot 180 is reserved */ +/* Slot 181 is reserved */ +/* Slot 182 is reserved */ +/* Slot 183 is reserved */ +#ifndef TkUnusedStubEntry +#define TkUnusedStubEntry \ + (tkIntStubsPtr->tkUnusedStubEntry) /* 184 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ @@ -1236,6 +1336,7 @@ extern TkIntStubs *tkIntStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkUnusedStubEntry #if defined(__CYGWIN__) && defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) # undef TkBindDeadWindow # define TkBindDeadWindow(winPtr) /* Removed from Cygwins stub table, just do nothing */ diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index eb05c02..c8917e2 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -144,6 +144,8 @@ EXTERN void TkUnixSetMenubar _ANSI_ARGS_((Tk_Window tkwin, EXTERN void TkWmCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); /* 44 */ EXTERN void TkSendCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); +/* 45 */ +EXTERN void TkUnusedStubEntry _ANSI_ARGS_((void)); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ @@ -269,6 +271,8 @@ EXTERN void TkGenWMDestroyEvent _ANSI_ARGS_((Tk_Window tkwin)); /* Slot 52 is reserved */ /* 53 */ EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void)); +/* 54 */ +EXTERN void TkUnusedStubEntry _ANSI_ARGS_((void)); #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ @@ -302,6 +306,8 @@ EXTERN void TkFreeXId _ANSI_ARGS_((TkDisplay *dispPtr)); /* 12 */ EXTERN int TkpWmSetState _ANSI_ARGS_((TkWindow *winPtr, int state)); +/* 13 */ +EXTERN void TkUnusedStubEntry _ANSI_ARGS_((void)); #endif /* X11 */ typedef struct TkIntPlatStubs { @@ -354,6 +360,7 @@ typedef struct TkIntPlatStubs { void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 42 */ void (*tkWmCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 43 */ void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 44 */ + void (*tkUnusedStubEntry) _ANSI_ARGS_((void)); /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow *winPtr, int active)); /* 0 */ @@ -410,6 +417,7 @@ typedef struct TkIntPlatStubs { void (*tkGenWMDestroyEvent) _ANSI_ARGS_((Tk_Window tkwin)); /* 51 */ VOID *reserved52; unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 53 */ + void (*tkUnusedStubEntry) _ANSI_ARGS_((void)); /* 54 */ #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 0 */ @@ -425,6 +433,7 @@ typedef struct TkIntPlatStubs { void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 10 */ void (*tkFreeXId) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 11 */ int (*tkpWmSetState) _ANSI_ARGS_((TkWindow *winPtr, int state)); /* 12 */ + void (*tkUnusedStubEntry) _ANSI_ARGS_((void)); /* 13 */ #endif /* X11 */ } TkIntPlatStubs; @@ -620,6 +629,10 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkSendCleanup \ (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ #endif +#ifndef TkUnusedStubEntry +#define TkUnusedStubEntry \ + (tkIntPlatStubsPtr->tkUnusedStubEntry) /* 45 */ +#endif #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #ifndef TkGenerateActivateEvents @@ -814,6 +827,10 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ #endif +#ifndef TkUnusedStubEntry +#define TkUnusedStubEntry \ + (tkIntPlatStubsPtr->tkUnusedStubEntry) /* 54 */ +#endif #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #ifndef TkCreateXEventSource @@ -868,6 +885,10 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkpWmSetState \ (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ #endif +#ifndef TkUnusedStubEntry +#define TkUnusedStubEntry \ + (tkIntPlatStubsPtr->tkUnusedStubEntry) /* 13 */ +#endif #endif /* X11 */ #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ @@ -877,6 +898,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkUnusedStubEntry #ifdef __CYGWIN__ void TkFreeXId(TkDisplay *dispPtr); void TkFreeWindowId(TkDisplay *dispPtr, Window w); diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index dc22008..1a30908 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -32,6 +32,8 @@ #include "tkIntPlatDecls.h" #include "tkIntXlibDecls.h" +#define TkUnusedStubEntry NULL + #ifdef __WIN32__ static int @@ -449,6 +451,38 @@ TkIntStubs tkIntStubs = { NULL, /* 150 */ NULL, /* 151 */ TkpDrawFrame, /* 152 */ + NULL, /* 153 */ + NULL, /* 154 */ + NULL, /* 155 */ + NULL, /* 156 */ + NULL, /* 157 */ + NULL, /* 158 */ + NULL, /* 159 */ + NULL, /* 160 */ + NULL, /* 161 */ + NULL, /* 162 */ + NULL, /* 163 */ + NULL, /* 164 */ + NULL, /* 165 */ + NULL, /* 166 */ + NULL, /* 167 */ + NULL, /* 168 */ + NULL, /* 169 */ + NULL, /* 170 */ + NULL, /* 171 */ + NULL, /* 172 */ + NULL, /* 173 */ + NULL, /* 174 */ + NULL, /* 175 */ + NULL, /* 176 */ + NULL, /* 177 */ + NULL, /* 178 */ + NULL, /* 179 */ + NULL, /* 180 */ + NULL, /* 181 */ + NULL, /* 182 */ + NULL, /* 183 */ + TkUnusedStubEntry, /* 184 */ }; TkIntPlatStubs tkIntPlatStubs = { @@ -500,6 +534,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkUnixSetMenubar, /* 42 */ TkWmCleanup, /* 43 */ TkSendCleanup, /* 44 */ + TkUnusedStubEntry, /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ TkGenerateActivateEvents, /* 0 */ @@ -556,6 +591,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkGenWMDestroyEvent, /* 51 */ NULL, /* 52 */ TkpGetMS, /* 53 */ + TkUnusedStubEntry, /* 54 */ #endif /* AQUA */ #if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ @@ -571,6 +607,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkSendCleanup, /* 10 */ TkFreeXId, /* 11 */ TkpWmSetState, /* 12 */ + TkUnusedStubEntry, /* 13 */ #endif /* X11 */ }; @@ -1091,6 +1128,17 @@ TkStubs tkStubs = { Tk_GetElementBox, /* 262 */ Tk_GetElementBorderWidth, /* 263 */ Tk_DrawElement, /* 264 */ + NULL, /* 265 */ + NULL, /* 266 */ + NULL, /* 267 */ + NULL, /* 268 */ + NULL, /* 269 */ + NULL, /* 270 */ + NULL, /* 271 */ + NULL, /* 272 */ + NULL, /* 273 */ + NULL, /* 274 */ + TkUnusedStubEntry, /* 275 */ }; /* !END!: Do not edit above this line. */ -- cgit v0.12 From e4a806f57cf76fe3fc789dafd98b46ac11d7e68d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 13 Mar 2013 15:31:01 +0000 Subject: Patch by Andrew Shadura, providing better support for three architectures they have in Debian. --- ChangeLog | 5 +++++ unix/configure | 57 +-------------------------------------------------------- unix/tcl.m4 | 25 +------------------------ 3 files changed, 7 insertions(+), 80 deletions(-) diff --git a/ChangeLog b/ChangeLog index be00743..54fb87b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-03-13 Jan Nijtmans + + * unix/tcl.m4: Patch by Andrew Shadura, providing better support for + three architectures they have in Debian. + 2013-01-16 Jan Nijtmans * win/Makefile.in: Don't compile Tk with -DTCL_NO_DEPRECATED by default diff --git a/unix/configure b/unix/configure index 4adfb24..8e323ec 100755 --- a/unix/configure +++ b/unix/configure @@ -2674,7 +2674,7 @@ fi fi fi ;; - Linux*) + Linux*|GNU*|NetBSD-Debian) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" @@ -2790,61 +2790,6 @@ EOF ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_SUFFIX=".so" - - if test "$have_dl" = yes; then - SHLIB_LD='${CC} -shared' - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - else - ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2808: checking for dld.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - SHLIB_LD="ld -shared" - DL_OBJS="" - DL_LIBS="-ldld" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" -else - echo "$ac_t""no" 1>&6 -fi - - fi - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 889d817..360b3a1 100755 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1393,7 +1393,7 @@ dnl AC_CHECK_TOOL(AR, ar) fi fi ;; - Linux*) + Linux*|GNU*|NetBSD-Debian) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" @@ -1450,29 +1450,6 @@ dnl AC_CHECK_TOOL(AR, ar) [XIM peeking works under XFree86]) ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_SUFFIX=".so" - - if test "$have_dl" = yes; then - SHLIB_LD='${CC} -shared' - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - else - AC_CHECK_HEADER(dld.h, [ - SHLIB_LD="ld -shared" - DL_OBJS="" - DL_LIBS="-ldld" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS=""]) - fi - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" -- cgit v0.12