From 0c22d2042c9071e80fdc2df89bf300ca3cb39ccc 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 FossilOrigin-Name: 8dbe7bcb986073f02f8409507195a31e4bc076f3 --- 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 e676cf8ecfb97617e537da46fb02bc0b986eb838 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 7 Jan 2013 14:44:22 +0000 Subject: The proposed fix from Bug 3599312, which should make key map handling interact better with input methods. Note that this does not work on OSX (in X11 mode) because that handles the Alt key in its own special way. FossilOrigin-Name: 4bb01e25effddf91aa19ff0e5cb917807c0ce0a0 --- unix/tkUnixKey.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index b7fc97f..eaa33ae 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -280,6 +280,14 @@ TkpGetKeySym( int index; TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr; + /* + * Refresh the mapping information if it's stale + */ + + if (dispPtr->bindInfoStale) { + TkpInitKeymapInfo(dispPtr); + } + #ifdef TK_USE_INPUT_METHODS /* * If input methods are active, we may already have determined a keysym. @@ -292,6 +300,7 @@ TkpGetKeySym( Tcl_DString ds; TkWindow *winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, eventPtr->xany.window); + Tcl_DStringInit(&ds); (void) TkpGetString(winPtr, eventPtr, &ds); Tcl_DStringFree(&ds); @@ -303,14 +312,6 @@ TkpGetKeySym( #endif /* - * Refresh the mapping information if it's stale - */ - - if (dispPtr->bindInfoStale) { - TkpInitKeymapInfo(dispPtr); - } - - /* * Figure out which of the four slots in the keymap vector to use for this * key. Refer to Xlib documentation for more info on how this computation * works. -- cgit v0.12 From b593720965053a9ddd0434dffc89f204396dc2ab 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. FossilOrigin-Name: 202603bf2bfee83e288d8f893a4a113e14c3201e --- 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 0dec5242c5908d7eecce9f5161f861a8dad7c1d2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Jan 2013 10:28:39 +0000 Subject: wrong end brace location FossilOrigin-Name: af4ada42c2b1e7fa3c1ae10681fce66b4aadb127 --- 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 f7caeab0a32ce7b577c234e72fbe3b4d6bd4e029 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 FossilOrigin-Name: fb142fc75b97506d7b35c2a93ae51e22eb4b2973 --- 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 c5079cc60f8c6b2f91b6f6593e107a0b592bd404 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Jan 2013 16:03:41 +0000 Subject: More flexible search for win32 tclConfig.sh, backported from TEA. FossilOrigin-Name: 42e2a6b269602e3fed238389e8ec6baae3ce93d1 --- win/configure | 124 +++++++++++++++++++++++++------- win/tcl.m4 | 228 +++++++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 285 insertions(+), 67 deletions(-) diff --git a/win/configure b/win/configure index 5cc7819..b833f44 100755 --- a/win/configure +++ b/win/configure @@ -851,7 +851,8 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-tcl=DIR use Tcl 8.5 binaries from DIR + --with-tcl directory containing tcl configuration + (tclConfig.sh) --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: @@ -3115,40 +3116,113 @@ _ACEOF #-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking the location of tclConfig.sh" >&5 -echo $ECHO_N "checking the location of tclConfig.sh... $ECHO_C" >&6 - - if test -d ../../tcl8.5$TK_PATCH_LEVEL/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5$TK_PATCH_LEVEL/win - elif test -d ../../tcl8.5/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5/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 + # + 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 -else - TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd` + with_tclconfig="${withval}" fi; - if test ! -d $TCL_BIN_DIR; then - { { echo "$as_me:$LINENO: error: Tcl directory $TCL_BIN_DIR does not exist" >&5 -echo "$as_me: error: Tcl directory $TCL_BIN_DIR does not exist" >&2;} + echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 + if test "${ac_cv_c_tclconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + # 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 "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&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 "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } - fi - if test ! -f $TCL_BIN_DIR/tclConfig.sh; then - if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then - { { echo "$as_me:$LINENO: 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?" >&5 -echo "$as_me: 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?" >&2;} + 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 x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { { echo "$as_me:$LINENO: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" >&5 +echo "$as_me: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" >&2;} { (exit 1); exit 1; }; } + else + no_tcl= + TCL_BIN_DIR="${ac_cv_c_tclconfig}" + echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi - TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd` fi - echo "$as_me:$LINENO: result: $TCL_BIN_DIR/tclConfig.sh" >&5 -echo "${ECHO_T}$TCL_BIN_DIR/tclConfig.sh" >&6 echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 diff --git a/win/tcl.m4 b/win/tcl.m4 index 2f2964b..7559591 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -3,50 +3,120 @@ # # 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.5$1/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5$1/win - elif test -d ../../tcl8.5/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5/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, + AC_HELP_STRING([--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.5 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 +126,105 @@ 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.5$1/win; then - TK_BIN_DIR_DEFAULT=../../tk8.5$1/win - elif test -d ../../tk8.5/win; then - TK_BIN_DIR_DEFAULT=../../tk8.5/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, + AC_HELP_STRING([--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.5 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 ]) #------------------------------------------------------------------------ -- cgit v0.12 From a9c94af6ca87cdb88642e06cb61e5f8ca5ee5136 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Jan 2013 16:10:56 +0000 Subject: and ChangeLog as well FossilOrigin-Name: 8586f2cf497207676ac6337dd13bf632f03b8e74 --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 65f2bbf..90da117 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-14 Jan Nijtmans + + * win/tcl.m4: More flexible search for win32 tclConfig.sh, + * win/configure: backported from TEA. + 2012-12-04 Francois Vogel * generic/tkTextIndex.c: [Bug 3588824]: bug in image index handling -- cgit v0.12 From bcbbd496e01a2fc1b556db9a3391dc4f631d9cc4 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. FossilOrigin-Name: c72168ce320dc037392e618615fb4e7b8fec3828 --- 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 2ae4014f6cec470add9e8998bac1c02f3ae748a8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Jan 2013 17:21:18 +0000 Subject: fix comment FossilOrigin-Name: 62c60529895621f57c25972943acc33c372e0812 --- generic/tkConsole.c | 2 +- generic/tkMain.c | 2 +- generic/tkWindow.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkConsole.c b/generic/tkConsole.c index bf86f8f..f894638 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -220,7 +220,7 @@ Tk_InitConsoleChannels( Tcl_Channel consoleChannel; /* - * Ensure that we are getting the matching version of Tcl. This is really + * Ensure that we are getting a compatible version of Tcl. This is really * only an issue when Tk is loaded dynamically. */ diff --git a/generic/tkMain.c b/generic/tkMain.c index 4d348ef..b794ce0 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -132,7 +132,7 @@ Tk_MainEx( Tcl_DString appName; /* - * Ensure that we are getting the matching version of Tcl. This is really + * Ensure that we are getting a compatible version of Tcl. This is really * only an issue when Tk is loaded dynamically. */ diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 057be04..ac69455 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -3021,7 +3021,7 @@ Initialize( ThreadSpecificData *tsdPtr; /* - * Ensure that we are getting the matching version of Tcl. + * Ensure that we are getting a compatible version of Tcl. */ if (Tcl_InitStubs(interp, "8.5.0", 0) == NULL) { -- cgit v0.12 From fda0d73c795337ada632383d9372e383045f5d7c 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) FossilOrigin-Name: 62e30f2b6ba59a3dec920cb7993af7ea53d23f5d --- 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 7a8a5d4b5d98defaa630ae698608c8738fac069e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 17 Jan 2013 09:45:58 +0000 Subject: some formatting (backported from 8.6) FossilOrigin-Name: 3dc99a50652c0c94187a43d8d4d61b286064f927 --- generic/tk.h | 109 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index f1f81cd..7c686a3 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -18,7 +18,7 @@ #include #if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 5) -# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5 +# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5 or better #endif #ifndef _ANSI_ARGS_ @@ -28,7 +28,7 @@ # define _ANSI_ARGS_(x) () # endif #endif - + /* * For C++ compilers, use extern "C" */ @@ -77,11 +77,9 @@ extern "C" { #ifndef RC_INVOKED #ifndef _XLIB_H -# if defined(MAC_OSX_TK) -# include +# include +# ifdef MAC_OSX_TK # include -# else -# include # endif #endif #ifdef __STDC__ @@ -89,18 +87,20 @@ extern "C" { #endif #ifdef BUILD_tk -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT #endif - + /* + *---------------------------------------------------------------------- + * * Decide whether or not to use input methods. */ #ifdef XNQueryInputStyle #define TK_USE_INPUT_METHODS #endif - + /* * Dummy types that are used by clients: */ @@ -126,8 +126,10 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement; */ typedef const char *Tk_Uid; - + /* + *---------------------------------------------------------------------- + * * The enum below defines the valid types for Tk configuration options as * implemented by Tk_InitOptions, Tk_SetOptions, etc. */ @@ -225,7 +227,7 @@ typedef void (Tk_CustomOptionFreeProc) _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin, char *internalPtr)); typedef struct Tk_ObjCustomOption { - const char *name; /* Name of the custom option. */ + const char *name; /* Name of the custom option. */ Tk_CustomOptionSetProc *setProc; /* Function to use to set a record's option * value from a Tcl_Obj */ @@ -301,7 +303,7 @@ typedef struct Tk_SavedOptions { * old values in a single structure. NULL * means no more structures. */ } Tk_SavedOptions; - + /* * Structure used to describe application-specific configuration options: * indicates procedures to call to parse an option and to return a text string @@ -400,7 +402,7 @@ typedef enum { #define TK_CONFIG_OPTION_SPECIFIED (1 << 4) #define TK_CONFIG_USER_BIT 0x100 #endif /* __NO_OLD_CONFIG */ - + /* * Structure used to specify how to handle argv options. */ @@ -444,7 +446,7 @@ typedef struct { #define TK_ARGV_NO_LEFTOVERS 0x2 #define TK_ARGV_NO_ABBREV 0x4 #define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8 - + /* * Enumerated type for describing actions to be taken in response to a * restrictProc established by Tk_RestrictEvents. @@ -502,7 +504,7 @@ typedef enum { TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW, TK_ANCHOR_CENTER } Tk_Anchor; - + /* * Enumerated type for describing a style of justification: */ @@ -546,7 +548,7 @@ typedef struct Tk_FontMetrics { #define TK_IGNORE_TABS 8 #define TK_IGNORE_NEWLINES 16 - + /* * Widget class procedures used to implement platform specific widget * behavior. @@ -590,7 +592,7 @@ typedef struct Tk_ClassProcs { #define Tk_GetClassProc(procs, which) \ (((procs) == NULL) ? NULL : \ (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which)) - + /* * Each geometry manager (the packer, the placer, etc.) is represented by a * structure of the following form, which indicates procedures to invoke in @@ -624,13 +626,13 @@ typedef struct Tk_GeomMgr { #define TK_SCROLL_PAGES 2 #define TK_SCROLL_UNITS 3 #define TK_SCROLL_ERROR 4 - + /* - *--------------------------------------------------------------------------- + *---------------------------------------------------------------------- * * Extensions to the X event set * - *--------------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define VirtualEvent (MappingNotify + 1) @@ -689,12 +691,12 @@ typedef XActivateDeactivateEvent XActivateEvent; typedef XActivateDeactivateEvent XDeactivateEvent; /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Macros for querying Tk_Window structures. See the manual entries for * documentation. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display) @@ -891,11 +893,11 @@ typedef struct Tk_FakeWin { #define TK_WM_MANAGEABLE 0x80000 /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Procedure prototypes and structures used for defining new canvas items: * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ typedef enum { @@ -1132,7 +1134,7 @@ typedef struct Tk_CanvasTextInfo { * should be displayed in focusItemPtr. * Read-only to items.*/ } Tk_CanvasTextInfo; - + /* * Structures used for Dashing and Outline. */ @@ -1188,11 +1190,11 @@ typedef struct Tk_Outline { } Tk_Outline; /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Procedure prototypes and structures used for managing images: * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ typedef struct Tk_ImageType Tk_ImageType; @@ -1255,13 +1257,13 @@ struct Tk_ImageType { * manager. */ char *reserved; /* reserved for future expansion */ }; - + /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Additional definitions used to manage images of type "photo". * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ /* @@ -1371,18 +1373,13 @@ struct Tk_PhotoImageFormat { * currently known. Filled in by Tk, not by * image format handler. */ }; - -#ifdef USE_OLD_IMAGE -#define Tk_CreateImageType Tk_CreateOldImageType -#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat -#endif /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Procedure prototypes and structures used for managing styles: * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ /* @@ -1446,13 +1443,13 @@ typedef struct Tk_ElementSpec { #define TK_ELEMENT_STATE_PRESSED 1<<3 /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * The definitions below provide backward compatibility for functions and * types related to event handling that used to be in Tk but have moved to * Tcl. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define TK_READABLE TCL_READABLE @@ -1499,21 +1496,18 @@ EXTERN const char * Tk_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp, const char *version, int exact)); #ifndef USE_TK_STUBS - #define Tk_InitStubs(interp, version, exact) \ Tk_PkgInitStubsCheck(interp, version, exact) - -#endif +#endif /* USE_TK_STUBS */ #define Tk_InitImageArgs(interp, argc, argv) /**/ - /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * Additional procedure types defined by Tk. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ typedef int (Tk_ErrorProc) _ANSI_ARGS_((ClientData clientData, @@ -1531,18 +1525,27 @@ typedef Tk_RestrictAction (Tk_RestrictProc) _ANSI_ARGS_(( ClientData clientData, XEvent *eventPtr)); typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData, int offset, char *buffer, int maxBytes)); - + /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * - * Platform independant exported procedures and variables. + * Platform independent exported procedures and variables. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ #include "tkDecls.h" + +#ifdef USE_OLD_IMAGE +#undef Tk_CreateImageType +#define Tk_CreateImageType Tk_CreateOldImageType +#undef Tk_CreatePhotoImageFormat +#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat +#endif /* USE_OLD_IMAGE */ /* + *---------------------------------------------------------------------- + * * Allow users to say that they don't want to alter their source to add extra * arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK. * @@ -1582,11 +1585,7 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData, # endif # define Tk_PhotoSetSize Tk_PhotoSetSize_Panic #endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ - -/* - * Tcl commands exported by Tk: - */ - + #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT -- cgit v0.12 From c0f2c19ccf1b6c9a628a9792512086571951ac0e 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() FossilOrigin-Name: 6ecc1189e34999cc40e015f5d5ecb2abc46c0396 --- 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 5e70cece79cab05b0e8b989996149e8be902ddc0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Jan 2013 14:54:19 +0000 Subject: make TkBackgroundEvalObjv a static function, and eliminate the use of the deprecated SaveResult API from it. FossilOrigin-Name: 625ce391b82e8622e8fbbda12301ea5840b62352 --- generic/tkUtil.c | 83 ------------------------------------------------- macosx/tkMacOSXDialog.c | 65 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 83 deletions(-) diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 2a8240b..bfa5d5c 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -976,89 +976,6 @@ TkFindStateNumObj( } /* - * ---------------------------------------------------------------------- - * - * TkBackgroundEvalObjv -- - * - * Evaluate a command while ensuring that we do not affect the - * interpreters state. This is important when evaluating script - * during background tasks. - * - * Results: - * A standard Tcl result code. - * - * Side Effects: - * The interpreters variables and code may be modified by the script - * but the result will not be modified. - * - * ---------------------------------------------------------------------- - */ - -int -TkBackgroundEvalObjv( - Tcl_Interp *interp, - int objc, - Tcl_Obj *const *objv, - int flags) -{ - Tcl_DString errorInfo, errorCode; - Tcl_SavedResult state; - int n, r = TCL_OK; - - Tcl_DStringInit(&errorInfo); - Tcl_DStringInit(&errorCode); - - Tcl_Preserve(interp); - - /* - * Record the state of the interpreter - */ - - Tcl_SaveResult(interp, &state); - Tcl_DStringAppend(&errorInfo, - Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY), -1); - Tcl_DStringAppend(&errorCode, - Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY), -1); - - /* - * Evaluate the command and handle any error. - */ - - for (n = 0; n < objc; ++n) { - Tcl_IncrRefCount(objv[n]); - } - r = Tcl_EvalObjv(interp, objc, objv, flags); - for (n = 0; n < objc; ++n) { - Tcl_DecrRefCount(objv[n]); - } - if (r == TCL_ERROR) { - Tcl_AddErrorInfo(interp, "\n (background event handler)"); - Tcl_BackgroundError(interp); - } - - Tcl_Release(interp); - - /* - * Restore the state of the interpreter - */ - - Tcl_SetVar(interp, "errorInfo", - Tcl_DStringValue(&errorInfo), TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "errorCode", - Tcl_DStringValue(&errorCode), TCL_GLOBAL_ONLY); - Tcl_RestoreResult(interp, &state); - - /* - * Clean up references. - */ - - Tcl_DStringFree(&errorInfo); - Tcl_DStringFree(&errorCode); - - return r; -} - -/* * Local Variables: * mode: c * c-basic-offset: 4 diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index d9e824a..bc11b96 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -14,6 +14,9 @@ #include "tkMacOSXPrivate.h" #include "tkFileFilter.h" +static int TkBackgroundEvalObjv(Tcl_Interp *interp, int objc, + Tcl_Obj *const *objv, int flags); + static const char *colorOptionStrings[] = { "-initialcolor", "-parent", "-title", NULL }; @@ -1057,6 +1060,68 @@ end: } /* + * ---------------------------------------------------------------------- + * + * TkBackgroundEvalObjv -- + * + * Evaluate a command while ensuring that we do not affect the + * interpreters state. This is important when evaluating script + * during background tasks. + * + * Results: + * A standard Tcl result code. + * + * Side Effects: + * The interpreters variables and code may be modified by the script + * but the result will not be modified. + * + * ---------------------------------------------------------------------- + */ + +int +TkBackgroundEvalObjv( + Tcl_Interp *interp, + int objc, + Tcl_Obj *const *objv, + int flags) +{ + Tcl_InterpState state; + int n, r = TCL_OK; + + /* + * Record the state of the interpreter. + */ + + Tcl_Preserve(interp); + state = Tcl_SaveInterpState(interp, TCL_OK); + + /* + * Evaluate the command and handle any error. + */ + + for (n = 0; n < objc; ++n) { + Tcl_IncrRefCount(objv[n]); + } + r = Tcl_EvalObjv(interp, objc, objv, flags); + for (n = 0; n < objc; ++n) { + Tcl_DecrRefCount(objv[n]); + } + if (r == TCL_ERROR) { + Tcl_AddErrorInfo(interp, "\n (background event handler)"); + Tcl_BackgroundError(interp); + } + + /* + * Restore the state of the interpreter. + */ + + (void) Tcl_RestoreInterpState(interp, state); + Tcl_Release(interp); + + return r; +} + +/* * Local Variables: * mode: objc * c-basic-offset: 4 -- cgit v0.12 From c32fe15d3a6c416f8c27baba4b50088469e1f079 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Jan 2013 15:17:02 +0000 Subject: Tk_CancelIdleCall -> Tcl_CancelIdleCall FossilOrigin-Name: bc7979708ec5ff82ed7f4db353815137a933dc32 --- generic/ttk/ttkManager.c | 2 +- macosx/tkMacOSXWm.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index ba9e5c0..2fcb190 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -237,7 +237,7 @@ void Ttk_DeleteManager(Ttk_Manager *mgr) ckfree((ClientData)mgr->slaves); } - Tk_CancelIdleCall(ManagerIdleProc, mgr); + Tcl_CancelIdleCall(ManagerIdleProc, mgr); ckfree((ClientData)mgr); } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index cb6e3c4..fbc167d 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -669,7 +669,7 @@ TkWmMapWindow( wmPtr->flags |= WM_ABOUT_TO_MAP; if (wmPtr->flags & WM_UPDATE_PENDING) { - Tk_CancelIdleCall(UpdateGeometryInfo, winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } UpdateGeometryInfo(winPtr); wmPtr->flags &= ~WM_ABOUT_TO_MAP; @@ -773,7 +773,7 @@ TkWmDeadWindow( ckfree(wmPtr->clientMachine); } if (wmPtr->flags & WM_UPDATE_PENDING) { - Tk_CancelIdleCall(UpdateGeometryInfo, winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } /* @@ -4400,7 +4400,7 @@ Tk_MoveToplevelWindow( if (!(wmPtr->flags & WM_NEVER_MAPPED)) { if (wmPtr->flags & WM_UPDATE_PENDING) { - Tk_CancelIdleCall(UpdateGeometryInfo, winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } UpdateGeometryInfo(winPtr); } -- cgit v0.12 From 274f13d8306116d843e80291952497b1e20c3d1f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Jan 2013 16:17:51 +0000 Subject: Eliminate use of deprecated Tcl_VarEval function from ttk. FossilOrigin-Name: 75a151fda0d2d81e215dfc4d197e36e29e80d01a --- generic/ttk/ttkScroll.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c index defe05a..b670540 100644 --- a/generic/ttk/ttkScroll.c +++ b/generic/ttk/ttkScroll.c @@ -78,6 +78,7 @@ static int UpdateScrollbar(Tcl_Interp *interp, ScrollHandle h) char arg1[TCL_DOUBLE_SPACE + 2]; char arg2[TCL_DOUBLE_SPACE + 2]; int code; + Tcl_DString buf; h->flags &= ~SCROLL_UPDATE_REQUIRED; @@ -88,9 +89,14 @@ static int UpdateScrollbar(Tcl_Interp *interp, ScrollHandle h) arg1[0] = arg2[0] = ' '; Tcl_PrintDouble(interp, (double)s->first / s->total, arg1+1); Tcl_PrintDouble(interp, (double)s->last / s->total, arg2+1); + Tcl_DStringInit(&buf); + Tcl_DStringAppend(&buf, s->scrollCmd, -1); + Tcl_DStringAppend(&buf, arg1, -1); + Tcl_DStringAppend(&buf, arg2, -1); Tcl_Preserve(corePtr); - code = Tcl_VarEval(interp, s->scrollCmd, arg1, arg2, NULL); + code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL); + Tcl_DStringFree(&buf); if (WidgetDestroyed(corePtr)) { Tcl_Release(corePtr); return TCL_ERROR; -- cgit v0.12 From 3c6d92b95cd66e7881d343b1fe82825dbbe078ef Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 24 Jan 2013 13:30:44 +0000 Subject: remove duplicate code FossilOrigin-Name: 52a6c71921e2aa5834857eda7f764885a178c5b6 --- win/tkWinWm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f6723e0..9ea4957 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -5309,11 +5309,6 @@ WmStateCmd( return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - if (winPtr->flags & TK_EMBEDDED) { int state = 0; -- cgit v0.12 From 2aa2f1fd6c43115fa5aa75877f530280d749b430 Mon Sep 17 00:00:00 2001 From: stwo Date: Thu, 31 Jan 2013 11:27:17 +0000 Subject: Bug [3602534]: Test for XScreensaver last. FossilOrigin-Name: c96d3630bcd3c649c4305b7d2e21fb3e130857c9 --- unix/configure | 433 +++++++++++++++++++++++++++--------------------------- unix/configure.in | 103 ++++++------- 2 files changed, 271 insertions(+), 265 deletions(-) diff --git a/unix/configure b/unix/configure index cc918fa..6cfff2a 100755 --- a/unix/configure +++ b/unix/configure @@ -862,8 +862,8 @@ Optional Features: on) --enable-symbols build with debugging symbols (default: off) --enable-aqua use Aqua windowingsystem on Mac OS X (default: off) - --enable-xss use XScreenSaver for activity timer (default: on) --enable-xft use freetype/fontconfig/xft (default: on) + --enable-xss use XScreenSaver for activity timer (default: on) --enable-framework package shared libraries in MacOSX frameworks (default: off) @@ -10106,7 +10106,7 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. + # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10114,7 +10114,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -10141,7 +10141,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then + if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi @@ -10155,18 +10155,18 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" + LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XrmInitialize () +XtMalloc (0) ; return 0; } @@ -10632,6 +10632,217 @@ rm -f conftest.err conftest.$ac_objext \ fi #-------------------------------------------------------------------- +# Check for freetype / fontconfig / Xft support. +#-------------------------------------------------------------------- + +if test $tk_aqua = no; then + echo "$as_me:$LINENO: checking whether to use xft" >&5 +echo $ECHO_N "checking whether to use xft... $ECHO_C" >&6 + # Check whether --enable-xft or --disable-xft was given. +if test "${enable_xft+set}" = set; then + enableval="$enable_xft" + enable_xft=$enableval +else + enable_xft="default" +fi; + XFT_CFLAGS="" + XFT_LIBS="" + if test "$enable_xft" = "no" ; then + echo "$as_me:$LINENO: result: $enable_xft" >&5 +echo "${ECHO_T}$enable_xft" >&6 + else + found_xft="yes" + XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" + XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" + if test "$found_xft" = "no" ; then + found_xft=yes + XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" + XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" + fi + echo "$as_me:$LINENO: result: $found_xft" >&5 +echo "${ECHO_T}$found_xft" >&6 + if test "$found_xft" = "yes" ; then + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" + tk_oldLibs=$LIBS + LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" + echo "$as_me:$LINENO: checking for X11/Xft/Xft.h" >&5 +echo $ECHO_N "checking for X11/Xft/Xft.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_X11_Xft_Xft_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_X11_Xft_Xft_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xft_Xft_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xft_Xft_h" >&6 +if test $ac_cv_header_X11_Xft_Xft_h = yes; then + : +else + + found_xft=no + +fi + + + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs + fi + if test "$found_xft" = "yes" ; then + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" + tk_oldLibs=$LIBS + LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" + +echo "$as_me:$LINENO: checking for XftFontOpen in -lXft" >&5 +echo $ECHO_N "checking for XftFontOpen in -lXft... $ECHO_C" >&6 +if test "${ac_cv_lib_Xft_XftFontOpen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXft $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XftFontOpen (); +int +main () +{ +XftFontOpen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xft_XftFontOpen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xft_XftFontOpen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xft_XftFontOpen" >&5 +echo "${ECHO_T}$ac_cv_lib_Xft_XftFontOpen" >&6 +if test $ac_cv_lib_Xft_XftFontOpen = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXFT 1 +_ACEOF + + LIBS="-lXft $LIBS" + +else + + found_xft=no + +fi + + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs + fi + if test "$found_xft" = "no" ; then + if test "$enable_xft" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: Can't find xft configuration, or xft is unusable" >&5 +echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} + fi + enable_xft=no + XFT_CFLAGS="" + XFT_LIBS="" + else + enable_xft=yes + fi + fi + if test $enable_xft = "yes" ; then + UNIX_FONT_OBJS=tkUnixRFont.o + +cat >>confdefs.h <<\_ACEOF +#define HAVE_XFT 1 +_ACEOF + + else + UNIX_FONT_OBJS=tkUnixFont.o + fi + + + +fi + +#-------------------------------------------------------------------- +# XXX Do this last. +# It might modify XLIBSW which could affect other tests. +# # Check whether the header and library for the XScreenSaver # extension are available, and set HAVE_XSS if so. # XScreenSaver is needed for Tk_GetUserInactiveTime(). @@ -10975,214 +11186,6 @@ _ACEOF fi #-------------------------------------------------------------------- -# Check for freetype / fontconfig / Xft support. -#-------------------------------------------------------------------- - -if test $tk_aqua = no; then - echo "$as_me:$LINENO: checking whether to use xft" >&5 -echo $ECHO_N "checking whether to use xft... $ECHO_C" >&6 - # Check whether --enable-xft or --disable-xft was given. -if test "${enable_xft+set}" = set; then - enableval="$enable_xft" - enable_xft=$enableval -else - enable_xft="default" -fi; - XFT_CFLAGS="" - XFT_LIBS="" - if test "$enable_xft" = "no" ; then - echo "$as_me:$LINENO: result: $enable_xft" >&5 -echo "${ECHO_T}$enable_xft" >&6 - else - found_xft="yes" - XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" - XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" - if test "$found_xft" = "no" ; then - found_xft=yes - XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" - XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" - fi - echo "$as_me:$LINENO: result: $found_xft" >&5 -echo "${ECHO_T}$found_xft" >&6 - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - echo "$as_me:$LINENO: checking for X11/Xft/Xft.h" >&5 -echo $ECHO_N "checking for X11/Xft/Xft.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_X11_Xft_Xft_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_X11_Xft_Xft_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xft_Xft_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xft_Xft_h" >&6 -if test $ac_cv_header_X11_Xft_Xft_h = yes; then - : -else - - found_xft=no - -fi - - - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - -echo "$as_me:$LINENO: checking for XftFontOpen in -lXft" >&5 -echo $ECHO_N "checking for XftFontOpen in -lXft... $ECHO_C" >&6 -if test "${ac_cv_lib_Xft_XftFontOpen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXft $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XftFontOpen (); -int -main () -{ -XftFontOpen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_Xft_XftFontOpen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xft_XftFontOpen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xft_XftFontOpen" >&5 -echo "${ECHO_T}$ac_cv_lib_Xft_XftFontOpen" >&6 -if test $ac_cv_lib_Xft_XftFontOpen = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBXFT 1 -_ACEOF - - LIBS="-lXft $LIBS" - -else - - found_xft=no - -fi - - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - if test "$found_xft" = "no" ; then - if test "$enable_xft" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: Can't find xft configuration, or xft is unusable" >&5 -echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} - fi - enable_xft=no - XFT_CFLAGS="" - XFT_LIBS="" - else - enable_xft=yes - fi - fi - if test $enable_xft = "yes" ; then - UNIX_FONT_OBJS=tkUnixRFont.o - -cat >>confdefs.h <<\_ACEOF -#define HAVE_XFT 1 -_ACEOF - - else - UNIX_FONT_OBJS=tkUnixFont.o - fi - - - -fi - -#-------------------------------------------------------------------- # Figure out whether "char" is unsigned. If so, set a # #define for __CHAR_UNSIGNED__. #-------------------------------------------------------------------- diff --git a/unix/configure.in b/unix/configure.in index d052675..e199eaf 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -457,56 +457,6 @@ if test -d /usr/include/mit -a $tk_aqua = no; then fi #-------------------------------------------------------------------- -# Check whether the header and library for the XScreenSaver -# extension are available, and set HAVE_XSS if so. -# XScreenSaver is needed for Tk_GetUserInactiveTime(). -#-------------------------------------------------------------------- - -if test $tk_aqua = no; then - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS $XINCLUDES" - tk_oldLibs=$LIBS - LIBS="$tk_oldLibs $XLIBSW" - xss_header_found=no - xss_lib_found=no - AC_MSG_CHECKING([whether to try to use XScreenSaver]) - AC_ARG_ENABLE(xss, - AC_HELP_STRING([--enable-xss], - [use XScreenSaver for activity timer (default: on)]), - [enable_xss=$enableval], [enable_xss=yes]) - if test "$enable_xss" = "no" ; then - AC_MSG_RESULT([$enable_xss]) - else - AC_MSG_RESULT([$enable_xss]) - AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [ - xss_header_found=yes - ],,[#include ]) - AC_CHECK_FUNC(XScreenSaverQueryInfo,,[ - AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [ - XLIBSW="$XLIBSW -lXext" - xss_lib_found=yes - ], [ - AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [ - if test "$tcl_cv_ld_weak_l" = yes; then - # On Darwin, weak link libXss if possible, - # as it is only available on Tiger or later. - XLIBSW="$XLIBSW -Wl,-weak-lXss -lXext" - else - XLIBSW="$XLIBSW -lXss -lXext" - fi - xss_lib_found=yes - ],, -lXext) - ]) - ]) - fi - if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then - AC_DEFINE(HAVE_XSS, 1, [Is XScreenSaver available?]) - fi - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs -fi - -#-------------------------------------------------------------------- # Check for freetype / fontconfig / Xft support. #-------------------------------------------------------------------- @@ -580,6 +530,59 @@ if test $tk_aqua = no; then fi #-------------------------------------------------------------------- +# XXX Do this last. +# It might modify XLIBSW which could affect other tests. +# +# Check whether the header and library for the XScreenSaver +# extension are available, and set HAVE_XSS if so. +# XScreenSaver is needed for Tk_GetUserInactiveTime(). +#-------------------------------------------------------------------- + +if test $tk_aqua = no; then + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS $XINCLUDES" + tk_oldLibs=$LIBS + LIBS="$tk_oldLibs $XLIBSW" + xss_header_found=no + xss_lib_found=no + AC_MSG_CHECKING([whether to try to use XScreenSaver]) + AC_ARG_ENABLE(xss, + AC_HELP_STRING([--enable-xss], + [use XScreenSaver for activity timer (default: on)]), + [enable_xss=$enableval], [enable_xss=yes]) + if test "$enable_xss" = "no" ; then + AC_MSG_RESULT([$enable_xss]) + else + AC_MSG_RESULT([$enable_xss]) + AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [ + xss_header_found=yes + ],,[#include ]) + AC_CHECK_FUNC(XScreenSaverQueryInfo,,[ + AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [ + XLIBSW="$XLIBSW -lXext" + xss_lib_found=yes + ], [ + AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [ + if test "$tcl_cv_ld_weak_l" = yes; then + # On Darwin, weak link libXss if possible, + # as it is only available on Tiger or later. + XLIBSW="$XLIBSW -Wl,-weak-lXss -lXext" + else + XLIBSW="$XLIBSW -lXss -lXext" + fi + xss_lib_found=yes + ],, -lXext) + ]) + ]) + fi + if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then + AC_DEFINE(HAVE_XSS, 1, [Is XScreenSaver available?]) + fi + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs +fi + +#-------------------------------------------------------------------- # Figure out whether "char" is unsigned. If so, set a # #define for __CHAR_UNSIGNED__. #-------------------------------------------------------------------- -- cgit v0.12 From 5ca0b055755f8700947e4498792c5184f04f764c Mon Sep 17 00:00:00 2001 From: stwo Date: Thu, 31 Jan 2013 11:49:40 +0000 Subject: Bug [3599928]: Use XkbKeycodeToKeysym if available. FossilOrigin-Name: fe704e1442e647b9d9159a16fbeb74e58215be07 --- unix/configure | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ unix/configure.in | 30 +++++++++++ unix/tkUnixKey.c | 7 ++- 3 files changed, 193 insertions(+), 1 deletion(-) diff --git a/unix/configure b/unix/configure index 6cfff2a..c99f25e 100755 --- a/unix/configure +++ b/unix/configure @@ -10840,6 +10840,163 @@ _ACEOF fi #-------------------------------------------------------------------- +# Check for XkbKeycodeToKeysym. +#-------------------------------------------------------------------- + +if test $tk_aqua = no; then + tk_oldCFlags=$CFLAGS + tk_oldLibs=$LIBS + CFLAGS="$CFLAGS $XINCLUDES" + LIBS="$LIBS $XLIBSW" + echo "$as_me:$LINENO: checking for X11/XKBlib.h" >&5 +echo $ECHO_N "checking for X11/XKBlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_XKBlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_X11_XKBlib_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_X11_XKBlib_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_XKBlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_XKBlib_h" >&6 +if test $ac_cv_header_X11_XKBlib_h = yes; then + + xkblib_header_found=yes + +else + + xkblib_header_found=no + +fi + + + if test $xkblib_header_found = "yes" ; then + echo "$as_me:$LINENO: checking for XkbKeycodeToKeysym in -lX11" >&5 +echo $ECHO_N "checking for XkbKeycodeToKeysym in -lX11... $ECHO_C" >&6 +if test "${ac_cv_lib_X11_XkbKeycodeToKeysym+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XkbKeycodeToKeysym (); +int +main () +{ +XkbKeycodeToKeysym (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_X11_XkbKeycodeToKeysym=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_X11_XkbKeycodeToKeysym=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5 +echo "${ECHO_T}$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6 +if test $ac_cv_lib_X11_XkbKeycodeToKeysym = yes; then + + xkbkeycodetokeysym_found=yes + +else + + xkbkeycodetokeysym_found=no + +fi + + else + xkbkeycodetokeysym_found=no + fi + if test $xkbkeycodetokeysym_found = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_XKBKEYCODETOKEYSYM 1 +_ACEOF + + fi + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs +fi + +#-------------------------------------------------------------------- # XXX Do this last. # It might modify XLIBSW which could affect other tests. # diff --git a/unix/configure.in b/unix/configure.in index e199eaf..86d46ad 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -530,6 +530,36 @@ if test $tk_aqua = no; then fi #-------------------------------------------------------------------- +# Check for XkbKeycodeToKeysym. +#-------------------------------------------------------------------- + +if test $tk_aqua = no; then + tk_oldCFlags=$CFLAGS + tk_oldLibs=$LIBS + CFLAGS="$CFLAGS $XINCLUDES" + LIBS="$LIBS $XLIBSW" + AC_CHECK_HEADER(X11/XKBlib.h, [ + xkblib_header_found=yes + ], [ + xkblib_header_found=no + ], [#include ]) + if test $xkblib_header_found = "yes" ; then + AC_CHECK_LIB(X11, XkbKeycodeToKeysym, [ + xkbkeycodetokeysym_found=yes + ], [ + xkbkeycodetokeysym_found=no + ]) + else + xkbkeycodetokeysym_found=no + fi + if test $xkbkeycodetokeysym_found = "yes" ; then + AC_DEFINE(HAVE_XKBKEYCODETOKEYSYM, 1, [Do we have XkbKeycodeToKeysym?]) + fi + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs +fi + +#-------------------------------------------------------------------- # XXX Do this last. # It might modify XLIBSW which could affect other tests. # diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index b7fc97f..ef5b22c 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -11,7 +11,12 @@ */ #include "tkInt.h" -#include + +#ifdef HAVE_XKBKEYCODETOKEYSYM +# include +#else +# define XkbKeycodeToKeysym(D,K,G,L) XKeycodeToKeysym(D,K,L) +#endif /* * Prototypes for local functions defined in this file: -- cgit v0.12 From 14f5385a1c48ed6f62e1cfb15c9a94467695d06a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 1 Feb 2013 13:41:04 +0000 Subject: Use internalRep.twoPtrValue.ptr1 in stead of internalRep.otherValuePtr everywhere. FossilOrigin-Name: 094afa492019f34b4607c65d5911aa7dd2365c27 --- generic/tkObj.c | 98 +++++++++++++++++++++++++++---------------------------- generic/tkStyle.c | 33 ++++++++----------- 2 files changed, 62 insertions(+), 69 deletions(-) diff --git a/generic/tkObj.c b/generic/tkObj.c index 7672240..f30742b 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -189,7 +189,7 @@ GetPixelsFromObjEx( int *intPtr, double *dblPtr) /* Places to store resulting pixels. */ { - int result,fresh; + int result, fresh; double d; PixelRep *pixelPtr; static double bias[] = { @@ -204,16 +204,16 @@ GetPixelsFromObjEx( */ if (objPtr->typePtr != &pixelObjType) { - ThreadSpecificData *tsdPtr = GetTypeCache(); + ThreadSpecificData *typeCache = GetTypeCache(); - if (objPtr->typePtr == tsdPtr->doubleTypePtr) { + if (objPtr->typePtr == typeCache->doubleTypePtr) { (void) Tcl_GetDoubleFromObj(interp, objPtr, &d); if (dblPtr != NULL) { *dblPtr = d; } *intPtr = (int) (d<0 ? d-0.5 : d+0.5); return TCL_OK; - } else if (objPtr->typePtr == tsdPtr->intTypePtr) { + } else if (objPtr->typePtr == typeCache->intTypePtr) { (void) Tcl_GetIntFromObj(interp, objPtr, intPtr); if (dblPtr) { *dblPtr = (double) (*intPtr); @@ -223,14 +223,12 @@ GetPixelsFromObjEx( } retry: - if (objPtr->typePtr != &pixelObjType) { + fresh = (objPtr->typePtr != &pixelObjType); + if (fresh) { result = SetPixelFromAny(interp, objPtr); if (result != TCL_OK) { return result; } - fresh = 1; - } else { - fresh = 0; } if (SIMPLE_PIXELREP(objPtr)) { @@ -242,14 +240,14 @@ GetPixelsFromObjEx( pixelPtr = GET_COMPLEXPIXEL(objPtr); if ((!fresh) && (pixelPtr->tkwin != tkwin)) { /* - * In case of exo-screen conversions of non-pixels we force a + * In the case of exo-screen conversions of non-pixels, we force a * recomputation from the string. */ FreePixelInternalRep(objPtr); goto retry; } - if ((pixelPtr->tkwin != tkwin)||dblPtr) { + if ((pixelPtr->tkwin != tkwin) || dblPtr) { d = pixelPtr->value; if (pixelPtr->units >= 0) { d *= bias[pixelPtr->units] * WidthOfScreen(Tk_Screen(tkwin)); @@ -294,7 +292,7 @@ Tk_GetPixelsFromObj( Tcl_Obj *objPtr, /* The object from which to get pixels. */ int *intPtr) /* Place to store resulting pixels. */ { - return GetPixelsFromObjEx(interp,tkwin,objPtr,intPtr,NULL); + return GetPixelsFromObjEx(interp, tkwin, objPtr, intPtr, NULL); } /* @@ -326,7 +324,7 @@ Tk_GetDoublePixelsFromObj( double *doublePtr) /* Place to store resulting pixels. */ { double d; - int result,val; + int result, val; result = GetPixelsFromObjEx(interp, tkwin, objPtr, &val, &d); if (result != TCL_OK) { @@ -448,7 +446,7 @@ SetPixelFromAny( double d; int i, units; - string = Tcl_GetStringFromObj(objPtr, NULL); + string = Tcl_GetString(objPtr); d = strtod(string, &rest); if (rest == string) { @@ -561,7 +559,7 @@ Tk_GetMMFromObj( } } - mmPtr = (MMRep *) objPtr->internalRep.otherValuePtr; + mmPtr = (MMRep *) objPtr->internalRep.twoPtrValue.ptr1; if (mmPtr->tkwin != tkwin) { d = mmPtr->value; if (mmPtr->units == -1) { @@ -600,8 +598,8 @@ static void FreeMMInternalRep( Tcl_Obj *objPtr) /* MM object with internal rep to free. */ { - ckfree((char *) objPtr->internalRep.otherValuePtr); - objPtr->internalRep.otherValuePtr = NULL; + ckfree((char *) objPtr->internalRep.twoPtrValue.ptr1); + objPtr->internalRep.twoPtrValue.ptr1 = NULL; objPtr->typePtr = NULL; } @@ -631,13 +629,13 @@ DupMMInternalRep( MMRep *oldPtr, *newPtr; copyPtr->typePtr = srcPtr->typePtr; - oldPtr = (MMRep *) srcPtr->internalRep.otherValuePtr; + oldPtr = (MMRep *) srcPtr->internalRep.twoPtrValue.ptr1; newPtr = (MMRep *) ckalloc(sizeof(MMRep)); newPtr->value = oldPtr->value; newPtr->units = oldPtr->units; newPtr->tkwin = oldPtr->tkwin; newPtr->returnValue = oldPtr->returnValue; - copyPtr->internalRep.otherValuePtr = (VOID *) newPtr; + copyPtr->internalRep.twoPtrValue.ptr1 = (VOID *) newPtr; } /* @@ -667,7 +665,7 @@ UpdateStringOfMM( char buffer[TCL_DOUBLE_SPACE]; register int len; - mmPtr = (MMRep *) objPtr->internalRep.otherValuePtr; + mmPtr = (MMRep *) objPtr->internalRep.twoPtrValue.ptr1; /* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */ if ((mmPtr->units != -1) || (objPtr->bytes != NULL)) { Tcl_Panic("UpdateStringOfMM: false precondition"); @@ -705,17 +703,17 @@ SetMMFromAny( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ Tcl_Obj *objPtr) /* The object to convert. */ { - ThreadSpecificData *tsdPtr = GetTypeCache(); + ThreadSpecificData *typeCache = GetTypeCache(); const Tcl_ObjType *typePtr; char *string, *rest; double d; int units; MMRep *mmPtr; - if (objPtr->typePtr == tsdPtr->doubleTypePtr) { + if (objPtr->typePtr == typeCache->doubleTypePtr) { Tcl_GetDoubleFromObj(interp, objPtr, &d); units = -1; - } else if (objPtr->typePtr == tsdPtr->intTypePtr) { + } else if (objPtr->typePtr == typeCache->intTypePtr) { Tcl_GetIntFromObj(interp, objPtr, &units); d = (double) units; units = -1; @@ -726,13 +724,13 @@ SetMMFromAny( * ints again from mm obj types. */ - (void) Tcl_GetStringFromObj(objPtr, NULL); + (void) Tcl_GetString(objPtr); } else { /* * It wasn't a known int or double, so parse it. */ - string = Tcl_GetStringFromObj(objPtr, NULL); + string = Tcl_GetString(objPtr); d = strtod(string, &rest); if (rest == string) { @@ -780,15 +778,15 @@ SetMMFromAny( (*typePtr->freeIntRepProc)(objPtr); } - objPtr->typePtr = &mmObjType; + objPtr->typePtr = &mmObjType; - mmPtr = (MMRep *) ckalloc(sizeof(MMRep)); - mmPtr->value = d; - mmPtr->units = units; - mmPtr->tkwin = NULL; + mmPtr = (MMRep *) ckalloc(sizeof(MMRep)); + mmPtr->value = d; + mmPtr->units = units; + mmPtr->tkwin = NULL; mmPtr->returnValue = d; - objPtr->internalRep.otherValuePtr = (VOID *) mmPtr; + objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) mmPtr; return TCL_OK; } @@ -821,7 +819,7 @@ TkGetWindowFromObj( Tcl_Obj *objPtr, /* The object from which to get window. */ Tk_Window *windowPtr) /* Place to store resulting window. */ { - TkMainInfo *mainPtr = ((TkWindow *)tkwin)->mainPtr; + TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr; register WindowRep *winPtr; int result; @@ -830,28 +828,28 @@ TkGetWindowFromObj( return result; } - winPtr = (WindowRep *) objPtr->internalRep.otherValuePtr; - if ( winPtr->tkwin == NULL - || winPtr->mainPtr == NULL - || winPtr->mainPtr != mainPtr - || winPtr->epoch != mainPtr->deletionEpoch) + winPtr = (WindowRep *) objPtr->internalRep.twoPtrValue.ptr1; + if (winPtr->tkwin == NULL + || winPtr->mainPtr == NULL + || winPtr->mainPtr != mainPtr + || winPtr->epoch != mainPtr->deletionEpoch) { /* * Cache is invalid. */ winPtr->tkwin = Tk_NameToWindow(interp, - Tcl_GetStringFromObj(objPtr, NULL), tkwin); + Tcl_GetString(objPtr), tkwin); + if (winPtr->tkwin == NULL) { + /* ASSERT: Tk_NameToWindow has left error message in interp */ + return TCL_ERROR; + } + winPtr->mainPtr = mainPtr; winPtr->epoch = mainPtr ? mainPtr->deletionEpoch : 0; } *windowPtr = winPtr->tkwin; - - if (winPtr->tkwin == NULL) { - /* ASSERT: Tk_NameToWindow has left error message in interp */ - return TCL_ERROR; - } return TCL_OK; } @@ -887,7 +885,7 @@ SetWindowFromAny( * Free the old internalRep before setting the new one. */ - Tcl_GetStringFromObj(objPtr, NULL); + (void)Tcl_GetString(objPtr); typePtr = objPtr->typePtr; if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) { (*typePtr->freeIntRepProc)(objPtr); @@ -898,7 +896,7 @@ SetWindowFromAny( winPtr->mainPtr = NULL; winPtr->epoch = 0; - objPtr->internalRep.otherValuePtr = (VOID*)winPtr; + objPtr->internalRep.twoPtrValue.ptr1 = (VOID*)winPtr; objPtr->typePtr = &windowObjType; return TCL_OK; @@ -929,12 +927,12 @@ DupWindowInternalRep( { register WindowRep *oldPtr, *newPtr; - oldPtr = srcPtr->internalRep.otherValuePtr; + oldPtr = srcPtr->internalRep.twoPtrValue.ptr1; newPtr = (WindowRep *) ckalloc(sizeof(WindowRep)); newPtr->tkwin = oldPtr->tkwin; newPtr->mainPtr = oldPtr->mainPtr; newPtr->epoch = oldPtr->epoch; - copyPtr->internalRep.otherValuePtr = (VOID *)newPtr; + copyPtr->internalRep.twoPtrValue.ptr1 = (VOID *)newPtr; copyPtr->typePtr = srcPtr->typePtr; } @@ -960,13 +958,13 @@ static void FreeWindowInternalRep( Tcl_Obj *objPtr) /* Window object with internal rep to free. */ { - ckfree((char *) objPtr->internalRep.otherValuePtr); - objPtr->internalRep.otherValuePtr = NULL; + ckfree((char *) objPtr->internalRep.twoPtrValue.ptr1); + objPtr->internalRep.twoPtrValue.ptr1 = NULL; objPtr->typePtr = NULL; } /* - *-------------------------------------------------------------- + *---------------------------------------------------------------------- * * TkParsePadAmount -- * @@ -984,7 +982,7 @@ FreeWindowInternalRep( * An error message is written to the interpreter if something is not * right. * - *-------------------------------------------------------------- + *---------------------------------------------------------------------- */ int diff --git a/generic/tkStyle.c b/generic/tkStyle.c index dd3b2e8..c2eed8f 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -62,7 +62,7 @@ typedef struct StyleEngine { StyledElement *elements; /* Table of widget element descriptors. Each * element is indexed by a unique system-wide * ID. Table grows dynamically as new elements - * are registered. Malloc'd*/ + * are registered. Malloc'd. */ struct StyleEngine *parentPtr; /* Parent engine. Engines may be layered to * form a fallback chain, terminated by the @@ -146,7 +146,7 @@ static int SetStyleFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); /* * The following structure defines the implementation of the "style" Tcl - * object, used for drawing. The internalRep.otherValuePtr field of each style + * object, used for drawing. The internalRep.twoPtrValue.ptr1 field of each style * object points to the Style structure for the stylefont, or NULL. */ @@ -375,14 +375,12 @@ InitStyleEngine( */ enginePtr->parentPtr = NULL; - } else if (parentPtr == NULL) { /* * The default style engine is the parent. */ enginePtr->parentPtr = tsdPtr->defaultEnginePtr; - } else { enginePtr->parentPtr = parentPtr; } @@ -602,17 +600,16 @@ FreeStyledElement( static int CreateElement( - const char *name, /* Name of the element. */ - int create) /* Boolean, whether the element is being created - * explicitly (being registered) or implicitly (by a - * derived element). */ + const char *name, /* Name of the element. */ + int create) /* Boolean, whether the element is being + * created explicitly (being registered) or + * implicitly (by a derived element). */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr, *engineEntryPtr; Tcl_HashSearch search; - int newEntry; - int elementId, genericId = -1; + int newEntry, elementId, genericId = -1; char *dot; StyleEngine *enginePtr; @@ -1261,8 +1258,7 @@ Tk_CreateStyle( stylePtr = (Style *) ckalloc(sizeof(Style)); InitStyle(stylePtr, Tcl_GetHashKey(&tsdPtr->styleTable, entryPtr), - (engine != NULL ? (StyleEngine *) engine : - tsdPtr->defaultEnginePtr), + (engine!=NULL ? (StyleEngine *) engine : tsdPtr->defaultEnginePtr), clientData); Tcl_SetHashValue(entryPtr, (ClientData) stylePtr); @@ -1415,10 +1411,8 @@ Tk_AllocStyleFromObj( if (objPtr->typePtr != &styleObjType) { SetStyleFromAny(interp, objPtr); - stylePtr = (Style *) objPtr->internalRep.otherValuePtr; - } else { - stylePtr = (Style *) objPtr->internalRep.otherValuePtr; } + stylePtr = (Style *) objPtr->internalRep.twoPtrValue.ptr1; return (Tk_Style) stylePtr; } @@ -1450,7 +1444,7 @@ Tk_GetStyleFromObj( SetStyleFromAny(NULL, objPtr); } - return (Tk_Style) objPtr->internalRep.otherValuePtr; + return (Tk_Style) objPtr->internalRep.twoPtrValue.ptr1; } /* @@ -1505,7 +1499,7 @@ SetStyleFromAny( } objPtr->typePtr = &styleObjType; - objPtr->internalRep.otherValuePtr = (VOID *) Tk_GetStyle(interp, name); + objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) Tk_GetStyle(interp, name); return TCL_OK; } @@ -1528,7 +1522,7 @@ static void FreeStyleObjProc( Tcl_Obj *objPtr) /* The object we are releasing. */ { - objPtr->internalRep.otherValuePtr = NULL; + objPtr->internalRep.twoPtrValue.ptr1 = NULL; objPtr->typePtr = NULL; } @@ -1549,7 +1543,8 @@ DupStyleObjProc( Tcl_Obj *dupObjPtr) /* The object we are copying to. */ { dupObjPtr->typePtr = srcObjPtr->typePtr; - dupObjPtr->internalRep.otherValuePtr=srcObjPtr->internalRep.otherValuePtr; + dupObjPtr->internalRep.twoPtrValue.ptr1 = + srcObjPtr->internalRep.twoPtrValue.ptr1; } /* -- cgit v0.12 From a557173cb0c824ccab0ceb4a5501a9599a7c011d Mon Sep 17 00:00:00 2001 From: jenglish Date: Mon, 4 Feb 2013 19:46:57 +0000 Subject: ttk::treeview: schedule redisplay when adding or removing tags [Bug 3603077]. FossilOrigin-Name: 070944a1a8a1f4a5a27ef01af835d053471754d6 --- generic/ttk/ttkTreeview.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 862c7f6..f0a3003 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -3169,6 +3169,8 @@ static int TreeviewTagAddCommand( AddTag(items[i], tag); } + TtkRedisplayWidget(&tv->core); + return TCL_OK; } @@ -3213,6 +3215,9 @@ static int TreeviewTagRemoveCommand( item=NextPreorder(item); } } + + TtkRedisplayWidget(&tv->core); + return TCL_OK; } -- cgit v0.12 From b6f41e0bbd9323c559c7d75dceacd74f2cc8fa54 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 FossilOrigin-Name: 67d52fd47f8c21e76eb576cf5e989afde7c6dfaa --- 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 a0d89b5ac2d726f86a1209cc0e9666e5890bd49a 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. FossilOrigin-Name: 40c52cd5f2fdc9ae91b4953e36d167c551016994 --- 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 23dab05dae692da443c702fb8b8ea596fee5153d 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 FossilOrigin-Name: ba787bf9f20e9aa3197fcdd1c43f336025d5dc06 --- 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 af1b169ca78c4d5a1e97f3a5d71af586d7ffc53a Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 28 Feb 2013 09:35:51 +0000 Subject: minor: tidy up change log formatting FossilOrigin-Name: 5a0a5e30dec0b18da7c851a70d8de3bbbdc1535e --- ChangeLog | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index c915ef0..d471002 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,33 +1,33 @@ 2013-02-28 Donal K. Fellows * unix/tkUnixKey.c (TkpGetKeySym): [Bug 3599312]: Put the - initialization of the key mapping before the input method handling - so that Alt key handling is correct on non-OSX Unix. Thanks to - Colin McDonald for developing the fix. + initialization of the key mapping before the input method handling so + that Alt key handling is correct on non-OSX Unix. Thanks to Colin + McDonald for developing the fix. 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) + * win/Makefile.in: Don't compile Tk with -DTCL_NO_DEPRECATED by + * unix/Makefile.in: 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). 2013-01-14 Jan Nijtmans - * win/tcl.m4: More flexible search for win32 tclConfig.sh, + * win/tcl.m4: More flexible search for win32 tclConfig.sh, * win/configure: backported from TEA. 2012-12-03 François Vogel - * generic/tkTextIndex.c: [Bug 3588824]: bug in image index handling - * tests/textIndex.test: for weird image names + * 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 - * tests/winDialog.test: interaction. Renumber test-cases as in - Tk 8.6, and convert various to tcltest-2 style. + * tests/winDialog.test: interaction. Renumber test-cases as in Tk 8.6, + and convert various to tcltest-2 style. 2012-11-09 Don Porter -- cgit v0.12 From e8f42ef4f2c2d542c1a2a2ec471b2f697f489a08 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 11 Mar 2013 18:02:47 +0000 Subject: 3607326 Stop segfault from [listbox .l -listvariable $array]. FossilOrigin-Name: 645ca43c5df0c4ff338e240aba2114bcf5ae99cb --- ChangeLog | 5 +++++ generic/tkListbox.c | 3 --- tests/listbox.test | 11 +++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d471002..19a5bac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-03-11 Don Porter + + * generic/tkListbox.c: [Bug 3607326] Stop segfault from + * tests/listbox.test: [listbox .l -listvariable $array]. + 2013-02-28 Donal K. Fellows * unix/tkUnixKey.c (TkpGetKeySym): [Bug 3599312]: Put the diff --git a/generic/tkListbox.c b/generic/tkListbox.c index d803d7b..248dd7b 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -1630,9 +1630,6 @@ ConfigureListbox( if (Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL, listVarObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { - if (oldListObj == NULL) { - Tcl_DecrRefCount(listVarObj); - } continue; } } diff --git a/tests/listbox.test b/tests/listbox.test index 25bc606..b4046b6 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -2158,6 +2158,17 @@ test listbox-29.1 {listbox selection behavior, -state disabled} { lappend out [.l selection includes 2] [.l curselection] } {1 1 2} +test listbox-30.1 {Bug 3607326} -setup { + destroy .l + unset -nocomplain a +} -body { + array set a {} + listbox .l -listvariable a +} -cleanup { + destroy .l + unset -nocomplain a +} -result * -match glob -returnCodes error + resetGridInfo deleteWindows option clear -- cgit v0.12 From 96e8b67ff72d1c229d652d212925a504ddbf3fd0 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. FossilOrigin-Name: 43608b4ddc954c9e3845e7cbbbb743e54c19797d --- 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